1

I'm trying to play an avi file with python cv2

 cap = cv2.VideoCapture('lot1.avi')

but the cap.isOpen() is always False. Dose it have to do with the file type? do I have to install somthing?

Thanks...

ifryed
  • 605
  • 9
  • 21

2 Answers2

4

I solved the problem by adding opencv_ffmpeg.dll to the c:/python27/ folder and changing it's name to opencv_ffmpeg246. I found the answer here: https://stackoverflow.com/a/17672734/2154827

Community
  • 1
  • 1
ifryed
  • 605
  • 9
  • 21
0

Try to use:

cv.CaptureFromFile()

There is some code you can look at here if you run in to any more problems: Watch Video in Python with OpenCV. Hope this helps you!

Øystein W.
  • 517
  • 3
  • 16