def label_clip(video_path, label, start_second, end_second):
clip = VideoFileClip(video_path)
text_clip = TextClip(label, fontsize=40, color='white', bg_color='red')
text_clip = text_clip.set_pos(('center', 'bottom'))
text_clip = text_clip.set_start(start_second).set_duration(end_second -
start_second)
return CompositeVideoClip([clip, text_clip])
评论列表
文章目录