2
votes

I am attempting to stream a Webm video file encoded from FFmpeg.

However when I seek to a position which hasn't been buffered, video playback stops.

I've verified that the correct byte range has been downloaded.

Any idea whats causing this? Seeking worked flawlessly for mp4 files encoded in x264. Webm seems to be the problem. Might be a problem with the way video was encoded.

ffmpeg -i input.mp4 -codec:v libvpx -quality best -b:v 4000k -qmin 10 -qmax 42 -maxrate 4024k -bufsize 8048k -vf scale=-1:1080 -codec:a libvorbis -b:a 384k -movflags faststart out.webm

1

1 Answers

0
votes

You can use -g parameter to set group of pictures.
Following command work fine only the file size is increased:

ffmpeg -i input.mp4 -codec:v libvpx -g 10 -quality best -b:v 4000k -qmin 10 -qmax 42 -maxrate 4024k -bufsize 8048k -vf scale=-1:1080 -codec:a libvorbis -b:a 384k -movflags faststart out.webm

For more details visit https://trac.ffmpeg.org/wiki/EncodingForStreamingSites#a-g

Please let me know if it work for you.