moviepy.video.fx.Loop#
- class moviepy.video.fx.Loop.Loop(n: int = None, duration: float = None)[source]#
Returns a clip that plays the current clip in an infinite loop. Ideal for clips coming from GIFs.
- Parameters:
n (int) -- Number of times the clip should be played. If None the the clip will loop indefinitely (i.e. with no set duration).
duration (float) -- Total duration of the clip. Can be specified instead of n.
- copy()#
Return a shallow copy of an Effect.
You must always copy an
Effectbefore applying, because some of them will modify their own attributes when applied. For example, setting a previously unset property by using target clip property.If we was to use the original effect, calling the same effect multiple times could lead to different properties, and different results for equivalent clips.
By using copy, we ensure we can use the same effect object multiple times while maintaining the same behavior/result.
In a way, copy makes the effect himself being kind of idempotent.