Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.07k stars 1.51k forks source link

Unspecified loop duration causes clip to blank #2135

Open dcaponi opened 3 months ago

dcaponi commented 3 months ago

Expected Behavior

Using either the .loop() method on VideoFileClip or the loop function imported from fx should loop my gif forever when placed inside another video (so for the duration of the video)

Actual Behavior

The gif clip takes up the whole screen and is just black

Steps to Reproduce the Problem

from moviepy.editor import VideoFileClip, CompositeVideoClip
from moviepy.video.fx.all import loop

bg = VideoFileClip(stock_footage_path).resize((1080, 1920))
fg = VideoFileClip(gif_path).resize((300, 300)).loop()
# loop(VideoFileClip(gif_path).resize((300, 300))
clip = CompositeVideoClip([bg, fg])

I also tried taking out the resize calls and it still has the same effect

Specifications

dcaponi commented 3 months ago

Workaround:

Specify an absurdly long loop duration (I did 10 days)

VideoFileClip(gif_path).resize((300, 300)).loop(999999)