Python - OpenCV VideoCapture = False (Windows)
Question: I have a simple piece of code, written in Python (version 2.7.11) designed to
do things to a video file as follows:

    
    
    import cv2
    
    cap = cv2.VideoCapture('MyVideo.mov')
    print(cap)
    print(cap.isOpened())
    
    while(cap.isOpened()):
        #Do some stuff
    

The result of print(cap) is a 8 digit hex number, so I don't know if that
means that the video has been found.

However, the print statement for cap.isOpened() returns False. I have tried
several fixes, but none of them worked. Any help or insight would be very
helpful.

Things to note/things I have tried

  * I am running Windows 8.1, Python 2.7.11 and OpenCV 3.1.0
  * The location of the video file is in the same directory as the Python script
  * I have the following directories appended to my PATH variable: 
    
        C:\Users\MyName\OpenCV3\opencv\build\x64\vc14\bin; 
    C:\Users\MyName\OpenCV3\opencv\sources\3rdparty\ffmpeg;
    C:\Python27\;
    C:\Python27\Scripts
    

  * I have checked that I have opencv_ffmpeg.dll in the OpenCV vc14 bin directory

  * I have checked that said dll file is titled opencv_ffmpeg310_64.dll

  * I have tried redownloading said dll file, and renaming it to include the version of OpenCV and the fact that my system is a 64-bit one

  * I have tried placing the dll file in the Python27 directory

  * The code above works on Mac, but not on Windows (tried the code on 2 different Macs and it worked, tried it on 2 different Windows machines and it returned false both times)


Answer: Since your code shows no issues on Mac, try using other file extensions (eg.
mp4 or wmv) on your Windows system, for testing. If your video is loaded then,
that means OpenCV is correctly configured on your Windows, but apparently
there is no driver to play .mov files

