OpenCV - VideoCapture(filename) works in Java but not in Python (Windows 7)
Question: I've been trying to open a video file using OpenCV and process its frames. I
have both avi file and mp4 file, the mp4 file works well in Java but in Python
(where I really need it...) it doesn't work (I keep getting None in
videocapture.read()).

Any ideas what can this be? how can it be solved?

EDIT: Here's the code I have:

    
    
    import cv2
    video_capture = cv2.VideoCapture('myfile.mp4')
    video_capture.set(propId=cv2.cv.CV_CAP_PROP_FRAME_WIDTH, value=1280.0)
    video_capture.set(propId=cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, value=720.0)
    ret, frame = self.video_capture.read()
    
    if frame is not None:
        # processing code...never reaches here
    

Thanks.


Answer: Check [this](http://stackoverflow.com/questions/16374633/opencv-videocapture-
cannot-read-video-in-python-but-able-in-vs11) question and the solution
provided by [this](http://stackoverflow.com/a/11703998/410487) answer.

Maybe it could help.

