picamera icon indicating copy to clipboard operation
picamera copied to clipboard

Getting actual framerate/frame timing

Open anemo-hypostasis opened this issue 5 years ago • 0 comments

I would like to know the camera's actual frame rate. This might seem trivial, but I could not find an obvious solution. I'm using PiCamera 1.13 with Python 3.7.3.

My current approach is

    with picamera.PiCamera(resolution='416x416', framerate=60) as camera:
        time.sleep(2)
        camera.start_preview()
        
        while True:
            fps = camera.framerate.numerator / camera.framerate.denominator
            camera.wait_recording(0.01)
     
     ...

But I've found that camera.framerate only follows the framerate that I set, even if it's something absurd like

picamera.PiCamera(resolution='416x416', framerate=500)

I'm fairly sure the Pi HQ camera does not support 500 FPS, but that's what camera.framerate returns.

Is there a way to know the PiCamera's actual framerate? Or at least frame time so I may calculate it myself.

anemo-hypostasis avatar Jan 28 '21 05:01 anemo-hypostasis