#video player
vidFile = cv.CaptureFromFile( "/home/leonardo/Filmes/0SV1NG.TS.LPark.Lege.rmvb" )
nFrames = int( cv.GetCaptureProperty( vidFile, cv.CV_CAP_PROP_FRAME_COUNT ) )
fps = cv.GetCaptureProperty( vidFile, cv.CV_CAP_PROP_FPS )
waitPerFrameInMillisec = int( 1/fps * 1000/1 )
print 'Num. Frames = ', nFrames
print 'Frame Rate = ', fps, ' frames per sec'
for f in xrange( nFrames ):
frameImg = cv.QueryFrame( vidFile )
cv.ShowImage( "My Video Window", frameImg )
cv.WaitKey( waitPerFrameInMillisec )
cv.DestroyWindow( "My Video Window" )
#### Tem como vc usar com o opencv2, ele manipula usando o numpy (Fica bem melhor):
import cv2
camcapture = cv2.VideoCapture('/home/leonardo/Filmes/0SV1NG.TS.LPark.Lege.rmvb')
fps = camcapture.get(cv2.cv.CV_CAP_PROP_FPS)
totalFrames = camcapture.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT)
res, frame = camcapture.read()