我想从视频文件中每隔10秒捕获一帧,如果有人能帮助我,我将非常感激。我的Python代码如下:
import cv2
print(cv2.__version__)
vidcap = cv2.VideoCapture('Standoff.avi')
vidcap.set(cv2.CAP_PROP_POS_MSEC,96000)
success,image = vidcap.read()
count = 0
success = True
while success:
success,image = vidcap.read()
print 'Read a new frame: ', success
cv2.imwrite("frame%d.jpg" % count, image) # save frame as JPEG file
cv2.waitKey(200)
count += 1