1、安装moviepy
pip install moviepy
2、下载ffmpeg
import imageio
imageio.plugins.ffmpeg.download()
3、代码
from moviepy.editor import *
video = VideoFileClip("1.mp4").subclip(50,60)
result = CompositeVideoClip([video,]) # Overlay text on video
result.write_videofile("clips.mp4",fps=25) # Many options...
4、运行结果