#Authored by Monana
Contact me via hemonan@vip.163.com
比如,类似这段代码无法运行,检查是VideoCapture读取不到视频,该怎么办呢?
import cv2
videoCapture=cv2.VideoCapture('myinput.avi')
fps=videoCapture.get(cv2.CAP_PROP_FPS)
size=(int(videoCapture.get(cv2.CAP_PROP_FRAME_WIDTH)),int(videoCapture.get(cv2.CAP_PROP_FRAME_HEIGHT)))
videoWriter=cv2.VideoWriter('out.avi',cv2.VideoWriter_fourcc('I','4','2','0'),fps,size)
success,frame=videoCapture.read()
while success:
videoWriter.write(frame)
success,frame=videoCapture.read()
#无法运行
1.你的opencv是否安装成功?这点很容易验证,至少不