Ask Your Question

Revision history [back]

how to limit frame using FSP property using python opencv

i was trying to set FPS property to limit the frame per second... but, values are same and no frame are setting.

vid=cv.CaptureFromFile('out.mp4') print cv.GetCaptureProperty(vid,cv.CV_CAP_PROP_FPS) cv.SetCaptureProperty(vid,cv.CV_CAP_PROP_FPS,1) print cv.GetCaptureProperty(vid,cv.CV_CAP_PROP_FPS) fgbg = cv2.BackgroundSubtractorMOG()

success,image=vid.read()

image=cv.QueryFrame(vid) count=0 while image: #fgmask=fgbg.apply(image) #cv2.imwrite("frame%d.jpg" % count,fgmask) cv.SaveImage('pic'+str(count)+'.jpg', image) if cv.WaitKey(10)==27: break count+=1 #success,image=vid.read() image=cv.QueryFrame(vid)

click to hide/show revision 2
No.2 Revision

updated 2015-02-26 01:14:45 -0600

berak gravatar image

how to limit frame using FSP property using python opencv

i was trying to set FPS property to limit the frame per second... but, values are same and no frame are setting.

vid=cv.CaptureFromFile('out.mp4')
print cv.GetCaptureProperty(vid,cv.CV_CAP_PROP_FPS)
cv.SetCaptureProperty(vid,cv.CV_CAP_PROP_FPS,1)
print cv.GetCaptureProperty(vid,cv.CV_CAP_PROP_FPS)
fgbg = cv2.BackgroundSubtractorMOG()

success,image=vid.read()

cv2.BackgroundSubtractorMOG() #success,image=vid.read() image=cv.QueryFrame(vid) count=0 while image: #fgmask=fgbg.apply(image) #cv2.imwrite("frame%d.jpg" % count,fgmask) cv.SaveImage('pic'+str(count)+'.jpg', image) if cv.WaitKey(10)==27: break count+=1 #success,image=vid.read() image=cv.QueryFrame(vid)

image=cv.QueryFrame(vid)