# Fps is reduced to 48 when running two 4k camera in 60fps in xavier nx platform

**URL:** <https://forums.developer.nvidia.com/t/fps-is-reduced-to-48-when-running-two-4k-camera-in-60fps-in-xavier-nx-platform/238271>\
**Category:** Jetson Xavier NX\
**Tags:** fps, gstreamer\
**Created:** [December 30, 2022, 8:08am UTC](https://forums.developer.nvidia.com/t/fps-is-reduced-to-48-when-running-two-4k-camera-in-60fps-in-xavier-nx-platform/238271 "2022-12-30T08:08:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr\_JP](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Mr\_JP](https://forums.developer.nvidia.com/u/Mr_JP)\
**Post date:** [December 30, 2022, 8:08am UTC](https://forums.developer.nvidia.com/t/fps-is-reduced-to-48-when-running-two-4k-camera-in-60fps-in-xavier-nx-platform/238271/1 "2022-12-30T08:08:08Z")

</div>

Hi Team

We are trying to stream two 4k camera in 60 fps using nvcompositor in gstreamer, and we faced some fps loss in compositor view that is the fps of both camera is reduced to a varying range of 43 - 47fps.

So in order to debug the issue we used below pipeline to run both camera simultaneously, by running it in two different terminals. But when we run both the cameras simultaneously then the fps of both cameras is reduce to a fixed value of 47fps.

But when we run the cameras individually we are getting 60 fps.  
We have also tried with fake sink and the result is the same.

```auto
WIDTH_IN=3840
HEIGHT_IN=2160
WIDTH_CROP=3840
HEIGHT_CROP=2160
DOWNSCALE=2
LEFT_CROP=$((($WIDTH_IN - $WIDTH_CROP)/2))
TOP_CROP=$((($HEIGHT_IN - $HEIGHT_CROP)/2))
RIGHT_CROP=$(($LEFT_CROP + $WIDTH_CROP))
BOTTOM_CROP=$(($TOP_CROP + $HEIGHT_CROP))
WIDTH_OUT=$(($WIDTH_CROP/$DOWNSCALE))
HEIGHT_OUT=$(($HEIGHT_CROP/$DOWNSCALE))
ARGUS=exposuretimerange="33000000 33000000"

CAPS_IN="video/x-raw(memory:NVMM), width=$WIDTH_IN, height=$HEIGHT_IN, format=NV12"
#CAPS_OUT="video/x-raw(memory:NVMM), width=$WIDTH_OUT, height=$HEIGHT_OUT, format=RGBA, pixel-aspect-ratio=$WIDTH_OUT/$HEIGHT_OUT"
CAPS_OUT="video/x-raw(memory:NVMM), width=$WIDTH_OUT, height=$HEIGHT_OUT, pixel-aspect-ratio=$WIDTH_OUT/$HEIGHT_OUT"
CAPS_COMP="video/x-raw(memory:NVMM), width=$WIDTH_OUT, height=$HEIGHT_OUT"
CROP="left=$LEFT_CROP top=$TOP_CROP right=$RIGHT_CROP bottom=$BOTTOM_CROP flip-method=6"

gst-launch-1.0 -v nvarguscamerasrc sensor-id=1 "$ARGUS" ! $CAPS_IN ! nvvidconv $CROP ! $CAPS_OUT ! nvoverlaysink sync=false 

```

Can you suggest us some methods to debug this issue. Or is it a limitation of xavier NX ?

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [January 3, 2023, 2:26am UTC](https://forums.developer.nvidia.com/t/fps-is-reduced-to-48-when-running-two-4k-camera-in-60fps-in-xavier-nx-platform/238271/3 "2023-01-03T02:26:50Z")

</div>

Hi,  
By default, hardware converter runs in dynamic frequency scaling. Please follow the steps to run it at maximum clock and check if there is improvement:  
[Nvvideoconvert issue, nvvideoconvert in DS4 is better than Ds5? - #3 by DaneLLL](https://forums.developer.nvidia.com/t/142115/3)

---

<div class="post-metadata">

**Author:** ![Mr\_JP](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Mr\_JP](https://forums.developer.nvidia.com/u/Mr_JP)\
**Post date:** [January 4, 2023, 4:38am UTC](https://forums.developer.nvidia.com/t/fps-is-reduced-to-48-when-running-two-4k-camera-in-60fps-in-xavier-nx-platform/238271/4 "2023-01-04T04:38:39Z")

</div>

Hi DaneLLL

We have tried the above methods but our scenario remains the same and we were not able to achieve any increase in fps.

But on further inspecting the gstreamer elements we have understood that the NV12 → RGBA conversion is causing the drop.

Is there any other suggestions to improve the fps. Or is there any other element that can help us with the conversion without affecting the performance.

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [January 4, 2023, 4:57am UTC](https://forums.developer.nvidia.com/t/fps-is-reduced-to-48-when-running-two-4k-camera-in-60fps-in-xavier-nx-platform/238271/5 "2023-01-04T04:57:12Z")

</div>

Hi,  
If you have run hardware converter at maximum clock, this is the maximum throughput the system can offer. One more thing you can try is to customize _nvarguscamerasrc_ to output RGBA directly. This scan save the conversion through _nvvidconv_ plugin. The plugins are open source and please take a look at the source code.

---

<div class="post-metadata">

**Author:** ![Mr\_JP](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Mr\_JP](https://forums.developer.nvidia.com/u/Mr_JP)\
**Post date:** [January 4, 2023, 7:26am UTC](https://forums.developer.nvidia.com/t/fps-is-reduced-to-48-when-running-two-4k-camera-in-60fps-in-xavier-nx-platform/238271/6 "2023-01-04T07:26:37Z")

</div>

Hi DaneLLL

Do you have any reference documents related to this.

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [January 4, 2023, 8:26am UTC](https://forums.developer.nvidia.com/t/fps-is-reduced-to-48-when-running-two-4k-camera-in-60fps-in-xavier-nx-platform/238271/7 "2023-01-04T08:26:30Z")

</div>

Hi,  
Plese download the package from:  
[https://developer.nvidia.com/embedded/linux-tegra-r3273](https://developer.nvidia.com/embedded/linux-tegra-r3273)

> Driver Package (BSP) Sources

And the implementation is based on NvBuffer APIs. For more information, please check the document:

> Jetson Linux API Reference (formerly named Multimedia API Reference

And after installing SDK components, you can see the samples on Xavier NX:

> /usr/src/jetson\_multimedia\_api/samples/

Please take a look. The links are for Jetpack 4.6.3(r32.7.3). Please go to the release page fitting your version.

---

<div class="post-metadata">

**Author:** ![Dilna](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Dilna](https://forums.developer.nvidia.com/u/Dilna)\
**Post date:** [January 9, 2023, 9:07am UTC](https://forums.developer.nvidia.com/t/fps-is-reduced-to-48-when-running-two-4k-camera-in-60fps-in-xavier-nx-platform/238271/8 "2023-01-09T09:07:19Z")

</div>

Hi DaneLL,  
We have tried to customize nvarguscamerasrc to output RGBA directly. for this we have made some modification in gstnvarguscamerasrc.cpp file. we tried to replace NV12 pixel format settings with RGBA. please find the attached patch file below.

gst-launch-1.0 -v nvarguscamerasrc sensor-id=1 ! nvoverlaysink sync=false  
this is the pipeline now we are using.

we are facing the error  
"

ERROR: from element /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0: Internal data stream error.  
Additional debug info:  
gstbasesrc.c(3055): gst\_base\_src\_loop (): /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0:  
streaming stopped, reason not-negotiated (-4)  
ERROR: pipeline doesn’t want to preroll.  
Setting pipeline to PAUSED …  
Setting pipeline to READY …

(gst-launch-1.0:13876): GLib-CRITICAL \*\*: 14:48:15.389: g\_thread\_join: assertion ‘thread’ failed

(gst-launch-1.0:13876): GLib-CRITICAL \*\*: 14:48:15.389: g\_thread\_join: assertion ‘thread’ failed

(gst-launch-1.0:13876): GLib-CRITICAL \*\*: 14:48:15.389: g\_queue\_is\_empty: assertion ‘queue != NULL’ failed

(gst-launch-1.0:13876): GLib-CRITICAL \*\*: 14:48:15.389: g\_queue\_free: assertion ‘queue != NULL’ failed

(gst-launch-1.0:13876): GLib-CRITICAL \*\*: 14:48:15.389: g\_queue\_free: assertion ‘queue != NULL’ failed  
"

could you please suggest us how to modify nvarguscamerasrc to provide RGBA format at output.  
[rgbaconvarion.txt](https://forums.developer.nvidia.com/uploads/short-url/c3bXMvnZWKttPOupDwVGixK2O5C.txt) (2.7 KB)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [February 21, 2023, 6:05am UTC](https://forums.developer.nvidia.com/t/fps-is-reduced-to-48-when-running-two-4k-camera-in-60fps-in-xavier-nx-platform/238271/10 "2023-02-21T06:05:58Z")

</div>

Closed on February 21, 2023, 6:05am UTC

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