备份下,总是用。
python-opencv实现
视频转图片
采样间隔可调
# coding:utf-8
# Copyright@hitzym
# video2img
# Dec,7,2017
import cv2
vc=cv2.VideoCapture("~/video.mp4")
c=1
if vc.isOpened():
rval,frame=vc.read()
else:
rval=False
while rval:
rval,frame=vc.read()
rows, cols, channel = frame.shape
# frame2=cv2.resize(frame,(cols/3,rows/3