阅读背景:

【python下使用OpenCV实现计算机视觉读书笔记3】读写视频文件

来源:互联网 

代码如下:

import cv2
videoCapture = cv2.VideoCapture('car.avi')
fps = videoCapture.get(cv2.cv.CV_CAP_PROP_FPS)
size = (int(videoCapture.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)),int(videoCapture.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)))
videoWriter = cv2.VideoWriter('carDemo.avi', cv2.cv.CV_FOURCC('I','4','2','0'), fps, size)
success, frame = videoCapture.read()
while success: # Loop until there are no more frames.
    videoWriter.write(frame)
    success, frame = videoCapture.read()
import cv2
videoCapture = cv2.VideoC



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: