MoviePy “The End” 效果

分类:Python, 发布于 2017-02-07 10:40:26,浏览(370),评论(0)

MoviePy “The End” 效果代码:

from moviepy.editor import *
from moviepy.video.tools.drawing import circle
clip = VideoFileClip("/tmp/a.mp4",audio=False).subclip(2,7).add_mask()
w,h = clip.size          
clip.mask.get_frame = lambda t: circle(screensize=(clip.w,clip.h),center=(clip.w/2,clip.h/2),radius=max(0,int(800-200*t)),col1=1, col2=0, blur=4)
the_end = TextClip("The End", font="Amiri-bold", color="white",fontsize=70).set_duration(clip.duration)
final = CompositeVideoClip([the_end.set_pos('center'),clip],size =clip.size)                           
final.write_videofile("/tmp/theEnd.mp4")

效果演示:

评论: