I can't seem to capture frames from a file using OpenCV -- I've compiled from source on Ubuntu with all the necessary prereqs according to: http://opencv.willowgarage.com/wiki/InstallGuide%20%3A%20Debian
#!/usr/bin/env pythonimport cv
import sysfiles = sys.argv[1:]for f in files:capture = cv.CaptureFromFile(f)print captureprint cv.GetCaptureProperty(capture, cv.CV_CAP_PROP_FRAME_WIDTH)print cv.GetCaptureProperty(capture, cv.CV_CAP_PROP_FRAME_HEIGHT)for i in xrange(10000):frame = cv.QueryFrame(capture)if frame:print frame
Output:
ubuntu@local:~/opencv$ ./test.py bbb.avi
<Capture 0xa37b130>
0.0
0.0
The frames are always None...
I've transcoded a video file to i420 format using:
mencoder $1 -nosound -ovc raw -vf format=i420 -o $2
Any ideas?