Search code examples
ffmpegstreamingvlcvideo-processingtranscoding

Pushing on-fly transcoded video to embeded http results with no seekbar


I'm trying to achieve a simple home-based solution for streaming/transcoding video to low-end machine that is unable to play file properly.

I'm trying to do it with ffmpeg (as ffserver will be discontinued) I found out that ffmpeg have build in http server that can be used for this.

The application Im' testing with (for seekbar) is vlc

I'm probably doing something wrong here (or trying to do something that other does with other applications)

My ffmpeg code I use is:

d:\ffmpeg\bin\ffmpeg.exe -r 24 -i "D:\test.mkv" -threads 2 -vf scale=1280:720 -c:v libx264 -preset medium -crf 20 -maxrate 1000k -bufsize 2000k -c:a ac3 -seekable 1 -movflags faststart -listen 1 -f mpegts http://127.0.0.1:8080/test.mpegts

This code also give me ability to start watching it when I want (as opposite to using rtmp via udp that would start video as soon as it transcode it)

I readed about moving atoom thing at file begging which should be handled by movflags faststart

I also checked the -re option without any luck, -r 25 is just to suppress the Past duration 0.xx too large warning which I read is normal thing. test file is one from many ones with different encoder setting etc.

The setting above give me a seekbar but it doesn't work and no overall duration (and no progress bar), when I switch from mpegts to matroska/mkv I see duration of video (and progress) but no seekbar.

If its possible with only ffmpeg I would prefer to stick to it as standalone solution without extra rtmp/others servers.


Solution

  • after some time I get to point where:

    seek bar is a thing on player side , hls in version v6 support pointing to start item as v3 start where ever it whats (not more than 3 items from end of list)

    playback and seek is based on player (safari on ios support it other dosn't) also ffserver is no needed to push the content.

    In the end it work fine without seek and if seek is needed support it on your end with player/js.player or via middle-ware like proxy video server.