dowinlee / pyopencv

Automatically exported from code.google.com/p/pyopencv
0 stars 0 forks source link

VideoCapture doesn't load video file #44

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Windows 7 SP1
2. Eclipse platform 3.5.2
3.pyopencv 2.1.0 wr1.1.0

I tried to run the following code and always returns "Error opening capture 
device". In other other words I've never been able to load a video file.

The file is in the folder and I could watch it with my regular viewer so the 
codec is installed.

I think it tries to capture the flow from the webcam (that i don't have).

Could you help me with that issue ?

Thanks,
if __name__ == '__main__':

    # a small welcome
    print("OpenCV Python capture video")

    # first, create the necessary window
    namedWindow('Camera', CV_WINDOW_AUTOSIZE)

    # move the new window to a better place
    moveWindow('Camera', 10, 10)

    capture = VideoCapture("video.mpg")

    # check that capture device is OK
    if not capture.isOpened():
        print("Error opening capture device")
        sys.exit (1)

Original issue reported on code.google.com by benjamin...@gmail.com on 4 Aug 2011 at 2:20