从视频中提取图片,并保存在硬盘上

python学习网 2017-06-18 06:00:17

extract images from video, than save them to disk

from moviepy.editor import VideoFileClip

clip1 = VideoFileClip('./project_video.mp4')
i = 1
for frame in clip1.iter_frames():
    im = Image.fromarray(frame)
    im.save("frame_image/your_file_%07d.jpg" % i)
    i = i+1
阅读(904) 评论(0)