使用python的moviepy库来提取视频中的图片,按照视频每帧一个图片的方式来保存。
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