picamera2 icon indicating copy to clipboard operation
picamera2 copied to clipboard

Manually Set Framerate

Open SamM-Springbok opened this issue 4 years ago • 2 comments

Libcamera allows a camera's framerate to be manually set/requested if compatible. I can't find anything in the current picamera2 documentation about how to set the framerate, and it seems to be automatically set based on the camera and resolution.

Folling https://github.com/raspberrypi/picamera2/blob/main/examples/controls.py and trying to set FrameDuration results in: RuntimeError: Control FrameDuration not found

SamM-Springbok avatar Apr 01 '22 18:04 SamM-Springbok

You should be able to use

picam2.start({"FrameDurationLimits": (33333, 33333)})

(or you can set it after starting the camera with set_controls). The two numbers are the minimum and maximum allowed frame durations in microseconds. Or you can make them the same to fix the framerate completely, as per the example (to 30fps).

davidplowman avatar Apr 03 '22 10:04 davidplowman

I think this issue should be resolved, so I'll go ahead and close it. However, please post back if there are any further problems. Thanks!

davidplowman avatar Apr 06 '22 15:04 davidplowman