# Got different fps when using V4l2 and Gst-launch nvarguscamera

**URL:** <https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733>\
**Category:** Jetson Orin Nano\
**Tags:** nvbugs, camera\
**Created:** [January 12, 2024, 6:17am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733 "2024-01-12T06:17:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![EmondCai](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/emondcai/32/249533_2.png) [@EmondCai](https://forums.developer.nvidia.com/u/EmondCai)\
**Post date:** [January 12, 2024, 6:17am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/1 "2024-01-12T06:17:29Z")

</div>

Hi!

I have a official **orin nano 8g devkit** which can drive imx577, it’s flashed with **jetpack 5.1.1** :

 ![image](https://global.discourse-cdn.com/nvidia/original/4X/7/a/b/7aba75fd1f347065367ff6d415ac8a784329a7e1.jpeg)

The result of v4l2-ctl --list-formats-ext -d /dev/video1 here:

```auto
ioctl: VIDIOC_ENUM_FMT
        Type: Video Capture

        [0]: 'RG10' (10-bit Bayer RGRG/GBGB)
                Size: Discrete 4056x3040
                        Interval: Discrete 0.025s (40.000 fps)
                Size: Discrete 4056x2288
                        Interval: Discrete 0.017s (60.000 fps)
                Size: Discrete 2024x1144
                        Interval: Discrete 0.017s (60.000 fps)
                Size: Discrete 2028x1520
                        Interval: Discrete 0.008s (130.000 fps)
                Size: Discrete 2028x1112
                        Interval: Discrete 0.005s (240.000 fps)
                Size: Discrete 4056x3040
                        Interval: Discrete 0.025s (40.000 fps)
                Size: Discrete 4056x2288
                        Interval: Discrete 0.017s (60.000 fps)

```

I’m trying to test whether the sensor mode 4 can reach 240 fps, when I try with

```auto
v4l2-ctl -d /dev/video1 --set-ctrl sensor_mode=4,bypass_mode=0,frame_rate=240000000 --stream-mmap

```

 ![1af807eada0f1d39940da0c63be3b92](https://global.discourse-cdn.com/nvidia/original/4X/d/2/5/d2535c5f10b750732a1a5f6bec2172a70fc992d5.png)  
I can got the result of 238.

But when I use gst-launch with nvarguscamera

```auto
gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! "video/x-raw(memory:NVMM), width=(int)2028, height=(int)1112, format=(string)NV12, framerate=(fraction)240/1" ! nvvidconv ! fpsdisplaysink text-overlay=false video-sink=fakesink --verbose

```

can only get a framerate below 110:

 ![11fdca0401e56de7d13ffedaee5240f](https://global.discourse-cdn.com/nvidia/original/4X/3/a/a/3aa9d5127c8e979b7ddb2d7aa5997b2f629ba06c.png)

Looks like there are kinds of limitations when using the nvarguscamera plugin, but no idea on what’s happening. Beg for your help,

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [January 12, 2024, 8:07am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/3 "2024-01-12T08:07:11Z")

</div>

hello EmondCai,

it looks nvarguscamerasrc already select sensor-mode=4 for streaming.  
could you please try below commands to boost all the VI/CSI/ISP clocks.  
for instance,

```auto
sudo su
echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/isp/rate
cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate

```

> [@EmondCai](#):
>
> it’s flashed with **jetpack 5.1.1** :

BTW,  
is it possible for moving to the latest release, Jetpack-5.1.2 for quick confirmation?

---

<div class="post-metadata">

**Author:** ![EmondCai](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/emondcai/32/249533_2.png) [@EmondCai](https://forums.developer.nvidia.com/u/EmondCai)\
**Post date:** [January 12, 2024, 10:40am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/4 "2024-01-12T10:40:47Z")

</div>

still the same result even I boost the clock.

I tryied the gst command with nvarguscamerasec, the framerate is about 100 to 115. And can’t get any result with the v4l2 command on 5.1.2 so we choose 5.1.1

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [January 15, 2024, 1:54am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/5 "2024-01-15T01:54:45Z")

</div>

> [@EmondCai](#):
>
> ```auto
> Size: Discrete 2028x1520
> Interval: Discrete 0.008s (130.000 fps)
> Size: Discrete 2028x1112
> Interval: Discrete 0.005s (240.000 fps)
> 
> ```

hello EmondCai,

please also give it a try with 2028x1520@130-fps sensor mode,  
let’s check it could reach 130-fps via nvarguscamerasrc plugin?

---

<div class="post-metadata">

**Author:** ![EmondCai](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/emondcai/32/249533_2.png) [@EmondCai](https://forums.developer.nvidia.com/u/EmondCai)\
**Post date:** [January 15, 2024, 5:56am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/6 "2024-01-15T05:56:44Z")

</div>

![2028_1520_130fps](https://global.discourse-cdn.com/nvidia/original/4X/f/9/b/f9b5594023b17708646e19f3b79a20f8eb1a4401.jpeg)  
The 2028x1520@130-fps also can’t get the highest frame via nvarguscamerasrc .

Both can got the highest-frame with v4l2

 ![v4l2](https://global.discourse-cdn.com/nvidia/original/4X/7/c/8/7c8dd5e689879fc42240f64a9e5a4fa0819240f9.png)

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [January 15, 2024, 6:31am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/7 "2024-01-15T06:31:19Z")

</div>

hello EmondCai,

may I have your helps, as I don’t have such high frame-rate sensor to test this locally.  
let’s try convert the format as `I420`, and adding `queue` elements to the gst pipeline.  
for instance,  
`$ gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! "video/x-raw(memory:NVMM), width=(int)2028, height=(int)1112, format=(string)NV12, framerate=(fraction)240/1" ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! queue ! fpsdisplaysink text-overlay=false video-sink=fakesink --verbose`

---

<div class="post-metadata">

**Author:** ![EmondCai](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/emondcai/32/249533_2.png) [@EmondCai](https://forums.developer.nvidia.com/u/EmondCai)\
**Post date:** [January 15, 2024, 7:33am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/8 "2024-01-15T07:33:36Z")

</div>

Hey Jerry,

Appreciate for your help, the pipeline you provide can reach a framerate over170+(no matter have queue or not in the pipeline), through still can’t get the highest.

 ![image](https://global.discourse-cdn.com/nvidia/original/4X/6/0/b/60bebc2210f201199ffbdfec785a94fc96057a63.png)

Can you explain to me why convert the format as `I420`can get higher framerate?

---

<div class="post-metadata">

**Author:** ![EmondCai](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/emondcai/32/249533_2.png) [@EmondCai](https://forums.developer.nvidia.com/u/EmondCai)\
**Post date:** [January 15, 2024, 7:36am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/9 "2024-01-15T07:36:42Z")

</div>

For mode 2028x1520@130fps, the pipeline can reach the highest framerate:

 ![image](https://global.discourse-cdn.com/nvidia/original/4X/e/e/1/ee129dbd3832c8b8a70d325fabd8a056ef134d6c.png)

---

<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 15, 2024, 8:07am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/11 "2024-01-15T08:07:58Z")

</div>

Hi,  
Along with enabling ISP and CSI at maximum clocks, please enable VIC at maximum clock by executing the script:  
[VPI - Vision Programming Interface: Performance Benchmark](https://docs.nvidia.com/vpi/algo_performance.html#maxout_clocks)

And run the command with _fakesink sync=0_:

```auto
$ gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! "video/x-raw(memory:NVMM), width=(int)2028, height=(int)1520, format=(string)NV12, framerate=(fraction)130/1" ! nvvidconv ! fpsdisplaysink text-overlay=false video-sink=fakesink sync=0 --verbose

```

---

<div class="post-metadata">

**Author:** ![EmondCai](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/emondcai/32/249533_2.png) [@EmondCai](https://forums.developer.nvidia.com/u/EmondCai)\
**Post date:** [January 15, 2024, 8:19am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/12 "2024-01-15T08:19:27Z")

</div>

Hi,  
The framerate I can get goes up to over 206 after I use the execute the clock.sh():

 ![6edb1a864e5d4c50c24b006756af730](https://global.discourse-cdn.com/nvidia/original/4X/b/3/6/b366e12e7f7a52c9ba5f1d5548e4497bd8e844f3.png)

 ![e038422d002460461f6cd193af3daf8](https://global.discourse-cdn.com/nvidia/original/4X/3/7/6/3764cf1add9f1ff7889c625dc2def2715ad49f19.png)

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [January 15, 2024, 8:31am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/13 "2024-01-15T08:31:41Z")

</div>

> [@EmondCai](#):
>
> up to over 206 after I use the execute the clock.sh():

hello EmondCai,

thanks for testing, it might be performance bottleneck as we’ve never test with such high frame-rate sensors.  
let me check this with dev team internally.

---

<div class="post-metadata">

**Author:** ![EmondCai](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/emondcai/32/249533_2.png) [@EmondCai](https://forums.developer.nvidia.com/u/EmondCai)\
**Post date:** [January 15, 2024, 9:03am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/15 "2024-01-15T09:03:04Z")

</div>

Okay, thank you so much with your support

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [January 15, 2024, 9:16am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/16 "2024-01-15T09:16:38Z")

</div>

hello EmondCai,

BTW, may I have more details of your 206-fps results.  
besides boosting ISP, CSI, and VIC clock to maximum. do you still doing the trick with converting the format as `I420` ?

---

<div class="post-metadata">

**Author:** ![EmondCai](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/emondcai/32/249533_2.png) [@EmondCai](https://forums.developer.nvidia.com/u/EmondCai)\
**Post date:** [January 15, 2024, 10:18am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/17 "2024-01-15T10:18:09Z")

</div>

> [@JerryChang](#):
>
> gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! “video/x-raw(memory:NVMM), width=(int)2028, height=(int)1112, format=(string)NV12, framerate=(fraction)240/1” ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=I420’ ! queue ! fpsdisplaysink text-overlay=false video-sink=fakesink --verbose

The result of pipline with I420 here:

 ![image](https://global.discourse-cdn.com/nvidia/original/4X/c/2/3/c23c078fa61e91dfb92caf7af22d9a87cd4f3174.png)

---

<div class="post-metadata">

**Author:** ![EmondCai](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/emondcai/32/249533_2.png) [@EmondCai](https://forums.developer.nvidia.com/u/EmondCai)\
**Post date:** [January 15, 2024, 10:24am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/18 "2024-01-15T10:24:46Z")

</div>

In summary, before executing the clock.sh:

110fps

```auto
gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! "video/x-raw(memory:NVMM), width=(int)2028, height=(int)1112, format=(string)NV12, framerate=(fraction)240/1" ! nvvidconv ! fpsdisplaysink text-overlay=false video-sink=fakesink --verbose

```

174fps

```auto
 gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! "video/x-raw(memory:NVMM), width=(int)2028, height=(int)1112, format=(string)NV12, framerate=(fraction)240/1" ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! queue ! fpsdisplaysink text-overlay=false video-sink=fakesink --verbose

```

After executing the clock.sh:  
206fps:

```auto
$ gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! "video/x-raw(memory:NVMM), width=(int)2028, height=(int)1112, format=(string)NV12, framerate=(fraction)240/1" ! nvvidconv ! fpsdisplaysink text-overlay=false video-sink=fakesink sync=0 --verbose

```

182fps:

```auto
 gst-launch-1.0 nvarguscamerasrc sensor-id=1 ! "video/x-raw(memory:NVMM), width=(int)2028, height=(int)1112, format=(string)NV12, framerate=(fraction)240/1" ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! queue ! fpsdisplaysink text-overlay=false video-sink=fakesink --verbose

```

---

<div class="post-metadata">

**Author:** ![EmondCai](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/emondcai/32/249533_2.png) [@EmondCai](https://forums.developer.nvidia.com/u/EmondCai)\
**Post date:** [January 16, 2024, 1:48am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/19 "2024-01-16T01:48:08Z")

</div>

> [@JerryChang](#):
>
> ```auto
> sudo su
> echo 1 > /sys/kernel/debug/bpmp/debug/clk/vi/mrq_rate_locked
> echo 1 > /sys/kernel/debug/bpmp/debug/clk/isp/mrq_rate_locked
> echo 1 > /sys/kernel/debug/bpmp/debug/clk/nvcsi/mrq_rate_locked
> echo 1 > /sys/kernel/debug/bpmp/debug/clk/emc/mrq_rate_locked
> cat /sys/kernel/debug/bpmp/debug/clk/vi/max_rate |tee /sys/kernel/debug/bpmp/debug/clk/vi/rate
> cat /sys/kernel/debug/bpmp/debug/clk/isp/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/isp/rate
> cat /sys/kernel/debug/bpmp/debug/clk/nvcsi/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/nvcsi/rate
> cat /sys/kernel/debug/bpmp/debug/clk/emc/max_rate | tee /sys/kernel/debug/bpmp/debug/clk/emc/rate
> 
> ```

May I also ask about the difference between these commands and the clock.sh your provide? Both of them are useing for boosting the VI/CSI/ISP clocks?

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [January 16, 2024, 2:02am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/20 "2024-01-16T02:02:14Z")

</div>

as you can see, those were command to boost VI/ISP/NVCSI/EMC clocks.  
the script file, `clocks.sh` has further to increase VIC clock.

---

<div class="post-metadata">

**Author:** ![EmondCai](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/emondcai/32/249533_2.png) [@EmondCai](https://forums.developer.nvidia.com/u/EmondCai)\
**Post date:** [January 16, 2024, 7:33am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/21 "2024-01-16T07:33:05Z")

</div>

Hi JerryChang

For these two ways to boost clock, only executing the clock.sh can make a difference on the highest framerate. Could you please explain why boost these clocks can make the sensor got higher framerate with gstreamer + nvarguscamerasrc and Why the v4l2 command doesn’t require the boost.

Many thanks

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [January 16, 2024, 8:14am UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/22 "2024-01-16T08:14:12Z")

</div>

hello EmondCai,

FYI,  
v4l and nvarguscamerasrc they’re using different pipelines, as nvarguscamerasrc had more loadings at buffer transmits, for example, EGL is used by ARGUS APIs for buffer/stream management.  
in addition, it might be performance bottleneck of video converter as well, (as you executed `clocks.sh` to to increase VIC clock shows better fps results)

hence,  
please take your 206-fps evaluation results in [comment #18](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/18) for current nvarguscamerasrc maximum frame-rate.

let me emphasize this again, we’ve never test such high frame-rate sensors.  
please contact with sensor vendor for further supports. or, you may based-on 60-fps, or 120-fps sensor modes for your camera solution development.

---

<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 13, 2024, 12:51pm UTC](https://forums.developer.nvidia.com/t/got-different-fps-when-using-v4l2-and-gst-launch-nvarguscamera/278733/24 "2024-02-13T12:51:41Z")

</div>

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