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.

  • Did you manage to solve this? I am facing this for audio loops
    – workwise
    May 2, 2023 at 13:36
  • See comments below, it's been fixed. May 3, 2023 at 14:17

2 Answers 2


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.

  • Wow, reported 11 months ago already and it's still there.. Re-encoding is not an option for me unfortunately, clients have pre-made loops. Jun 23, 2017 at 8:15
  • Do you intend to 'live-stream' the looped output?
    – Gyan
    Jun 23, 2017 at 8:30
  • It is processed live, so I guess that is a 'yes'. So it's not possible to cut out pauses, if that's where you're heading.. Jun 23, 2017 at 8:59
  • BTW: wrapping in ts (no difference) or mkv (shorter pause) is no fix either. Neither is re-encoding to intraframe. The very visible pause remains present. Jun 23, 2017 at 9:09
  • Strange. Can you upload your sample?
    – Gyan
    Jun 23, 2017 at 9:13

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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