I'm trying to use the basic example code from OpenCv's Website to open a video file. I have tried everything I could find online but no matter what I get this error
VIDEOIO(cvCreateFileCapture_AVFoundation (filename)): raised unknown C++ exception!
I have no clue what is going on. My example code is 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()
I got the same exception.
In my case, the format is destroyed.