Код: Выделить всё
#!/usr/bin/env python
import cv
import sys
files = sys.argv[1:]
for f in files:
capture = cv.CaptureFromFile(f)
print capture
print 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
Код: Выделить всё
ubuntu@local:~/opencv$ ./test.py bbb.avi
0.0
0.0
Я перекодировал видеофайл в формат i420, используя:
Код: Выделить всё
mencoder $1 -nosound -ovc raw -vf format=i420 -o $2