> ## Content Index
> Fetch the complete content index at: https://ffmpeguru.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Loop a short clip to a target duration
- URL: https://ffmpeguru.com/loop-a-short-clip-to-a-target-duration/
- Published: 2026-09-15T09:00:00.000Z
- Updated: 2026-10-13T17:59:44.000Z
- Author: FFmpeguru
- Tags: ffmpeg

If you have a 30-second bumper and need a 5-minute placeholder, the \`stream\_loop\` flag tells the demuxer to loop the input a fixed number of times. Combined with \`-t\` to limit the output duration, you get a precise-length file that uses only the source material.

## The command

```
ffmpeg -stream_loop -1 -i short.mp4 -t 300 -c copy looped.mp4
```

## What it does

\`-stream\_loop -1\` loops the input indefinitely; \`-t 300\` stops the output after 300 seconds. The result is a 5-minute file made by concatenating the 30-second source 10 times. The command uses \`-c copy\`, so no re-encoding happens — it runs at I/O speed. The output plays in any player that supports the container, with the source material repeated end to end.

## Requirements

Any container FFmpeg can both read and write. Stream copy is sufficient, so no encoder is loaded. The loop count and the target duration must be consistent: a 30-second source looped 10 times is exactly 300 seconds.

## Things to avoid

- Looping a clip with audio that has a hard out at the end. The cut will be audible at the loop boundary; crossfade the audio with \`acrossfade\` for a smoother loop.
- Looping a clip with a different framerate than the target. The output will have the source framerate, which may not match the project's expected framerate.
- Using \`-stream\_loop -1\` without \`-t\`. The output will run forever; the command will not exit on its own.
- Expecting the loop to be seamless. The demuxer concatenates the source end to end, so any silence or hard cut at the end of the source will be audible.