I am currently grabbing a live stream video with the following command:

ffmpeg -i https://urlToTheStream/playlist.m3u8 -f image2 -q:v 30 C:\pathToOutputFolder\%01d.bmp

video is running in 24 fps.

I am then live-processing the bmp files with a self written java program. My processing program is a bit faster than the output of ffmpeg. i can see that ffmpeg produces packages of bmp files. Around 25 and then pauses.

Is it possible to tell ffmpeg not to buffer anything and instead just producing "in realtime"?

At first I used jpg format which was clearly slower than bmp. I changed quality to 30 which helped too. But I still have a latency about 0.7 seconds compared watching the stream in the browser. I also tried the no buffering option with no efford.

Thanks for any tips!

edit: code format settings in text

ffmpeg -i https://urlToTheStream/playlist.m3u8 -f yuv4mpegpipe -

Read from stdout pipe, The format is documented here https://wiki.multimedia.cx/index.php/YUV4MPEG2

  • Thanks for the answer. Before I start messing around with piping (I am using Java under Windows) I tried to route the pipe to ffplay to see if lag is less. fmpeg -i https://urlToTheStream/playlist.m3u8 -f yuv4mpegpipe - | ffplay -f rawvideo -pix_fmt yuv420p -s 1440x1080 - encoding seems not quite to function right, i have a shifting picture, but its quite recognizable, that the lag is still there. – Che Jun 12 at 11:12
  • You need to force the same format on ffplay, or skip it altogether. – Gyan Jun 12 at 19:31
  • @Gyan Thanks for the reply. ffplay doesnt support the yuv4mpegpipe format I think. Do you have a hint for me, what you mean by >forcing or >skipping together ? – Che Jun 13 at 7:13
  • 1
    ffplay supports everything ffmpeg does. ffmpeg -i https://urlToTheStream/playlist.m3u8 -f yuv4mpegpipe - | ffplay -i - – Gyan Jun 13 at 7:29
  • ffmpeg -i https://urlToTheStream/playlist.m3u8 -f yuv4mpegpipe - | ffplay -i - works, but the lag is still around 1 second compared to the video playing in my browser in parallel. image.ibb.co/jietEd/z.jpg See, that the speed should be high enough. – Che Jun 13 at 8:29

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.