docs/integrations/block-integrations/video/loop.md
This block repeats a video to extend its duration, either to a specific length or a set number of repetitions.
<!-- END MANUAL -->Block to loop a video to a given duration or number of repeats.
The block uses MoviePy's Loop effect to repeat a video clip. You can specify either a target duration (the video will repeat until reaching that length) or a number of loops (the video will repeat that many times). The Loop effect handles both video and audio looping automatically, maintaining sync. Either duration or n_loops must be provided. The output is encoded with H.264 video codec and AAC audio codec.
| Input | Description | Type | Required |
|---|---|---|---|
| video_in | The input video (can be a URL, data URI, or local path). | str (file) | Yes |
| duration | Target duration (in seconds) to loop the video to. Either duration or n_loops must be provided. | float | No |
| n_loops | Number of times to repeat the video. Either n_loops or duration must be provided. | int | No |
| Output | Description | Type |
|---|---|---|
| error | Error message if the operation failed | str |
| video_out | Looped video returned either as a relative path or a data URI. | str (file) |