2017-07-20 5 views
3

Ich verwende derzeit Opencv 3.2.0 und Python 3.5.2. Wenn folgenden Code ausführen:Opencv-Python cv2.CV_CAP_PROP_FPS Fehler

videoCapture = cv2.VideoCapture(file_path) 
fps = videoCapture.get(cv2.CV_CAP_PROP_FPS) 
size = (int(videoCapture.get(cv2.CV_CAP_PROP_FRAME_WIDTH)), 
     int(videoCapture.get(cv2.CV_CAP_PROP_FRAME_HEIGHT))) 

ich folgende Fehler aufgetreten:

Traceback (most recent call last): 
    File "videoEditor.py", line 29, in <module> 
    fps = videoCapture.get(cv2.CV_CAP_PROP_FPS) 
AttributeError: module 'cv2.cv2' has no attribute 'CV_CAP_PROP_FPS' 

Könnte mir jemand sagen, was soll ich tun?

Antwort

6

In OpenCV 3.2, lassen Sie die CV vor der Flagge. Dies sollte

videoCapture = cv2.VideoCapture(file_path) 
fps = videoCapture.get(cv2.CAP_PROP_FPS) 
size = (int(videoCapture.get(cv2.CAP_PROP_FRAME_WIDTH)), 
     int(videoCapture.get(cv2.CAP_PROP_FRAME_HEIGHT))) 
+0

Thank u so viel !!!! –