ai-content-maker/.venv/Lib/site-packages/moviepy/video/fx/make_loopable.py

15 lines
532 B
Python
Raw Permalink Normal View History

2024-05-11 23:00:43 +03:00
import moviepy.video.compositing.transitions as transfx
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
def make_loopable(clip, cross):
"""
Makes the clip fade in progressively at its own end, this way
it can be looped indefinitely. ``cross`` is the duration in seconds
of the fade-in. """
d = clip.duration
clip2 = clip.fx(transfx.crossfadein, cross).\
set_start(d - cross)
return CompositeVideoClip([ clip, clip2 ]).\
subclip(cross,d)