I have tested several files with the added option
-fflags +genpts -stream_loop -1
to make them loop, but all have a slight pause just before they loop (250 ms or so). The loop filter does not have this issue, but it has other issues.
Video Production Stack Exchange is a question and answer site for engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation. It only takes a minute to sign up.
Sign up to join this communityI have tested several files with the added option
-fflags +genpts -stream_loop -1
to make them loop, but all have a slight pause just before they loop (250 ms or so). The loop filter does not have this issue, but it has other issues.
This is a known bug with stream_loop. See https://trac.ffmpeg.org/ticket/5719
Wrapping to MKV or TS and then looping may work. Re-encoding your video as intraframe is the safest option.
I am streaming a looping video and was struggling with pauses in-between loops too. What I discovered was that I was streaming at 24 FPS, but my input video was 23.97. Re-encoding the video at 24 FPS with the FPS filter fps=fps=24
resolved the issue.
See https://trac.ffmpeg.org/wiki/ChangingFrameRate for more information on changing the frame rate with FFmpeg.