Opening video with openCV +python


Question

I using python 2.7 and openCV 2.3.1 (win 7). I trying open video file:

stream = cv.VideoCapture("test1.avi")
if stream.isOpened() == False:
print "Cannot open input video!"
exit()

But I have warning:

warning: Error opening file (../../modules/highgui/src/cap_ffmpeg_impl_v2.hpp:394)

If use video camera (stream = cv.VideoCapture(0)), this code works. Any ideas as to what I'm doing wrong? Thanks a lot to all!

1
2
4/27/2012 4:02:22 PM

Try using cv.CaptureFromFile() instead.

Copy this code if you must: Watch Video in Python with OpenCV.

3
4/27/2012 4:11:20 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon