The cleanest way to repeat a clip is -stream_loop, an input option that plays the source N extra times before encoding. Because it's an input flag, it goes before -i. Use -1 for an infinite loop, paired with a duration cap so the output isn't endless.
Key takeaways
-stream_loop Ngoes before-iand repeats the input N extra times.-stream_loop -1loops forever; cap it with-t.- Loop a still image into video with
-loop 1+-t. - A boomerang reverses the clip and appends it for a seamless back-and-forth.
Repeat a clip N times
Play the clip three more times (four total). Copying the stream keeps it lossless when the loop count is exact:
# 3 extra loops = clip plays 4 times total ffmpeg -stream_loop 3 -i in.mp4 -c copy out.mp4
Loop to a target duration
Loop infinitely but stop at an exact length — handy for filling a 30-second background:
# loop forever, cut off at 30 seconds ffmpeg -stream_loop -1 -i in.mp4 -t 30 -c copy out.mp4
Loop a still image into video
Turn a single image into a clip of any length — great for title cards or audio-with-cover-art:
# 10-second video from one image ffmpeg -loop 1 -i cover.png -t 10 -c:v libx264 -pix_fmt yuv420p out.mp4
Seamless boomerang
Append a reversed copy so the clip plays forward then backward with no visible seam:
ffmpeg -i in.mp4 -filter_complex \ "[0:v]reverse[r];[0:v][r]concat=n=2:v=1[v]" -map "[v]" -an boomerang.mp4
Loop visually instead
FFmpegLab lets you set a loop count or target duration on the timeline and writes the matching -stream_loop command for you — fully offline. Trim to a clean loop point first, then export a looping GIF.