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)
please, stop using the old cv interface in favour of cv2, it won't be there anymore in opencv3.0