Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

changing the fps of a video?

I have some demo videos with the FPS=60. I would like to change the FPS to 30. I am using OpenCV 3.4.I used the following code. This is just a snippet of the code.

 while True:
        cap = cap.set(cv2.CV_CAP_PROP_FPS, 30) 
        ret,frame = cap.read()
        fps = cap.get(cv2.CAP_PROP_FPS)
        print(fps)

But I am getting the following error:

AttributeError: module 'cv2.cv2' has no attribute 'CV_CAP_PROP_FPS'

I would appreciate any help any help. Thank you.