moviepy version: 1.0.3 python version: 3.8.0 OS: Windows 11 ImageMagick Version 7.1.1
I have a VideoClip
on which I am trying to put multiple TextClips
audioclip = AudioFileClip("title.mp3")
# fetching minecraft parkour clip
clip = VideoFileClip("minecraft_parkour.mp4").subclip(2,2+audioclip.duration+0.4)
# cropping the minecraft parkour video to a portrait
(w, h) = clip.size
crop_width = h * 9/16
x1, x2 = (w - crop_width)//2, (w+crop_width)//2
y1, y2 = 0, h
croppedClip = clip.crop(x1=x1, y1=y1, x2=x2, y2=y2)
vid = croppedClip.set_audio(audioclip)
print(vid.size)
###### ----- TODO: Fix error in adding multiple textclips
txt_1 = TextClip("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an", size=vid.size, align='West', fontsize=35, color ='white', method='caption').set_duration(5)
txt_2 = TextClip("Idk", align='West', fontsize=20, color ='white', method='caption').set_duration(5)
txt_1 = txt_1.set_position(('center', 'top'))
txt_2 = txt_2.set_position(('center', 'left'))
a = CompositeVideoClip([vid, txt_1, txt_2])
a.write_videofile('video.mp4', fps=25)
Expected Result: