from moviepy import *
clips = []
clip = ImageClip("path1.png", duration=3).with_start(0)
clips.append(clip)
title = TextClip("path3.ttf", text="Text...", font_size=80, color="#fff", text_align="center", duration=1,)
title = title.with_start(1).with_position((0,0))
title = title.with_effects([vfx.SlideIn(0.25, "left")])
title = title.with_effects([vfx.SlideOut(0.25, "left")])
clips.append(title)
final_clip = CompositeVideoClip(clips)
final_clip.write_videofile("final_clip.mp4")
尝试这个:
from moviepy import *
clips = []
clip = ImageClip("loopvideo/nature with water and small animals in 1920 x 1080 ratio.png", duration=3).with_start(0)
clips.append(clip)
title = TextClip(font="arial", text="Text...", font_size=80, color="#fff", text_align="center", duration=1,)
title = title.with_start(1)
title = title.with_effects([
vfx.SlideIn(0.25, "left"),
vfx.SlideOut(0.25, "left")
]).with_position((0,0))
clips.append(title)
final_clip = CompositeVideoClip(clips)
final_clip.write_videofile("final_clip.mp4", fps=17)