python3 opencv 视频格式转换:
import cv2
videoCapture = cv2.VideoCapture('ad3.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('oto_other.mp4', cv2.cv.CV_FOURCC('M', 'J', 'P', 'G'), fps, size)
success, frame = videoCapture.read()
while success :
cv2.imshow(ad3 Video, frame)
cv2.waitKey(1000/int(fps))
videoWriter.write(frame)
success, frame = videoCapture.read()