I want to concatenate 4 clips of the same videoclip, Fimage, for a certain duration of time. The print tests and logic tests say that this should work, but it generates a 7 second clip with half of it bugging out. My suspicion is that the concatenate_videoclips is messing up in the for loop as print statements are working inside the for loop, so is there another way I can concatenate it?
This should be really straight forward, but it bugs out on me. In theory it should generate a 23 second video clip of the same image, but instead it generates a 7 second image with it bugging at 4 second mark.
from moviepy.editor import *
# Create an ImageClip object
Fimage = ImageClip("Z:/Programming Stuff/Images/Testing/Char3.png")
Fimage = Fimage.set_duration(5)
Fimage.fps = 30
durations = [5,10,5,3] #Durations of each clip
clips = [Fimage, Fimage, Fimage, Fimage] #The same clip 4 times
Final = clips[0].set_duration(durations[0])
#IT SEEMS THAT WHENEVER I PUT FOR LOOP CONCATENATE, IT DOESNT WORK
for i in range(1, len(clips)):
clip = clips[i].set_duration(durations[i])
Final = concatenate_videoclips([Final, clip])
#The print statements oddly work fine so the loop isn't the problem, I suspect it's the concatenate logic.
Final.write_videofile("wiggles1.mp4")