How to set the capture frame rate?

I used to set the capture framerate by using the follow command:
gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! ‘video/x-raw(memory:NVMM), width=4000, height=3000, format=(string)NV12, framerate=21/1’ ! ‘video/x-raw,witdth=1920,height=1080’ ! nvvidconv ! nvegltransform ! nveglglessink -e
He can set it up success,But when I used it today to set up a new sensor(imx586), it didn’t work.Does it need the driver’s support? Or is there another way I can set the frame rate?

Hi blstcvLiu,
From what I know, the framerate parameter only sets it up for the pipeline, but doesn’t affect the rate to get images from the camera.
Your camera should have a defined fixed framerate, you can use VideoCapture.get(cv::CAP_PROP_FPS); and VideoCapture.set(); to get and/or set the FPS.
I’m fairly new on this so you may need confirmation from others.

Framerate in GstCaps has to fit sensor mode. For example, imx219 supports 3264 x 2464p21, and we have to set

video/x-raw(memory:NVMM), width=3264, height=2464, format=(string)NV12, framerate=21/1

Thank you for your reply!
Do you know the plugin which name is ”tee“? My application needs a video source which can output multiple different frame rates videos.I want to do it by the follow picture,Is there a problem with this architecture?

It seems to be fine, but may try to link … ! tee ! queue ! … always. Sometime we see pipeline gets stuck with only tee. Better to be along with queue.

Thank you for your answer,but I’m worried that the queue-plugin will have some data buffers inside. I need real-time data for AutoFocus. Do you have any good suggestions?

The nvarguscamerasrc plugin is open source. Maybe you can add the autofocus logic in the sourc code directly and rebuild/replace the plugin.

1 Like