输入输出路径
import cv2
videoFile = '/Users/fanc/Downloads/image/PeppaPig.mp4'
outputFile = '/Users/fanc/Downloads/image/frame'
cv2在opencv-python包里面,安装的时候pip install opencv-python
上面是输入文件的路径,下面是输出文件的路径,注意最后的frame是文件名的前缀
vc = cv2.VideoCapture(videoFile)
c = 1
if vc.isOpened():
rval, frame = vc.read()
else:
print('openerro