I am trying to use the basic sample code from the OpenCv site to open a video file. I tried everything I could find on the Internet, but no matter what I get this error
VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!
I have no idea what is going on. My sample code below
import numpy as np import cv2 print('running'); cap = cv2.VideoCapture('t1low.avi') print('running') while(cap.isOpened()): ret, frame = cap.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) cv2.imshow('frame',gray) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows()
source share