FFmpeg recipe
FFmpeg: Loop a Video 3× (or any number)
For exact-N loops with one input, -stream_loop is faster and simpler than concat. Use 2 to play 3 times total (initial + 2 loops).
Command
ffmpeg -stream_loop 2 -i input.mp4 -c copy -y output_looped.mp4Prefer no terminal?
Use the Video Looper in your browser
What each flag does
| -i | Input file. Can be a video, audio, or image. Repeat for multiple inputs. |
|---|---|
| -c copy | Stream-copy: no re-encoding. Output is bit-identical between cut points. Fastest possible. |
| -y | Overwrite output file without confirmation. |
| -stream_loop 2 | Loop the input 2 additional times → input plays 3 times total. |
Notes & gotchas
- For perfect seamless loops, the first frame should match the last. Trim with the Video Trimmer first.
- For boomerang motion, append a reversed copy via concat instead.
Check it worked
ffprobe -v error -show_entries format=duration -of csv=p=0 output.mp4Three times the source duration.
What to change
| -stream_loop counts repeats, not plays | 2 gives you three passes of the clip. Off-by-one here is the usual surprise. |
|---|---|
| It must come before -i | As an input option it applies to the file that follows. After -i it is ignored silently. |
| -c copy keeps it lossless | Looping concatenates the same stream, so nothing needs re-encoding. It is instant regardless of length. |
If it fails
The output is the same length as the input.
Why: -stream_loop was placed after -i, where it applies to nothing.
Fix: Put -stream_loop before the -i it applies to.
There is a visible jump at each repeat.
Why: The first and last frames differ, so the loop point is a hard cut.
Fix: Trim so the clip starts and ends on a similar frame, or crossfade the join with xfade.