标签:文件 color Edito res rom ide over lam span
第一下。
# coding=utf-8 from moviepy.editor import * from moviepy.video.tools.subtitles import SubtitlesClip generator = lambda txt: TextClip(txt, font=‘SimHei‘, fontsize=24, color=‘black‘) sub = SubtitlesClip("demo.srt", generator) main_clip = VideoFileClip("main_clip.mp4").subclip(0, 9.0).resize((700, 500)).crossfadein(0.5).crossfadeout(0.5) left_clip = VideoFileClip("left_clip.mp4").subclip(0, 9.0).resize((300, 500)).crossfadein(0.5).crossfadeout(0.5) img_clip = ImageClip("wzj_cover.png", duration=3).fx(vfx.resize, width=300) right_clip = CompositeVideoClip([main_clip, sub]) final_clip = clips_array([[left_clip, main_clip]]) final_clip.resize(width=1000, height=500).write_videofile("my_stack.mp4")
srt文件的规则(最后不要有多的空行,序号,空行,时间轴,都是严谨的)
1 00:00:01,410 --> 00:00:04,740 这是只小松鼠! 2 00:00:05,410 --> 00:00:07,740 这是只小松鼠!
标签:文件 color Edito res rom ide over lam span
原文地址:https://www.cnblogs.com/aguncn/p/11020439.html