An unexpected change in the maximum fps get from gstreamer pipeline

Hello, I am trying to use gstreamer to read video from usb cameras from python code on Jetson Orin Nano. I use 2 pipelines for different cameras with same model. I need same fps on both cameras. Ideally 30 fps but 20 is also fine.

My command for one camera looks like:

v4l2src device=/dev/video0 io-mode=2 name=source ! image/jpeg, width=640, height=480, type=video, framerate=30/1 ! jpegdec ! videoconvert ! video/x-raw, format=RGB ! appsink max-buffers=1 drop=True name=appsink0

At first everything was working fine, both pipelines were returning 30 fps, but at some moment one of them permanently dropped to 15 fps. I was able to get fps lower than 15 (for example 10) but not higher. I tried multiple times with different pipeline commands. Next, I connected camera with this problem to some program on Windows where I was able to get 30 fps stream from it. After that gstreamer pipeline also started returning images in 30fps on Jetson but another camera decreased to 25 fps. I still can get images lower than 25fps from it but not 30 even if I use framerate=30/1.

Could you please explain what is going on and how to prevent from this behavior? Thanks

Hi,
Since jpegdec and videoconvert plugins use CPU, please execute sudo jetson_clocks to run CPU cores at maximum clock. And please try gst-launch-1.0 command and see if the issue it present:

$ gst-launch-1.0 -v v4l2src device=/dev/video0 io-mode=2 name=source ! image/jpeg, width=640, height=480, type=video, framerate=30/1 ! jpegdec ! videoconvert ! video/x-raw, format=RGB ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0

To clarify if it is specific to using appsink

Thanks for the answer. Your command let me get 30fps on both cameras. Also after that I was able read data from two cameras at 30fps from python using my previous command.

So I need to change appsink in my pipeline to avoid similar problems in the future?

Hi,
Please set appsink sync=0 and check if it helps. Ideally if appsink doesn’t hold the buffers longer than expected, it should be able to achieve target frame rate.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.