Files
AutoGPT/docs/integrations/block-integrations/video/loop.md

1.8 KiB

Video Loop

This block repeats a video to extend its duration, either to a specific length or a set number of repetitions.

Loop Video

What it is

Block to loop a video to a given duration or number of repeats.

How it works

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.

Inputs

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. If omitted, defaults to no looping. float No
n_loops Number of times to repeat the video. If omitted, defaults to 1 (no repeat). int No
output_return_type How to return the output video. Either a relative path or base64 data URI. "file_path" | "data_uri" No

Outputs

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

Possible use case

  • Extending a short background video to match the length of narration audio
  • Creating seamless looping content for digital signage
  • Repeating a product demo video multiple times for emphasis
  • Extending short clips to meet minimum duration requirements for platforms