5

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()

1 Answer 1

1

I got the same exception.

In my case, the format is destroyed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.