GStreamer Video Stabilizer for NVIDIA Jetson Boards/Performance/Xavier: Difference between revisions

From RidgeRun Developer Wiki
mNo edit summary
 
(37 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
{{GStreamer Video Stabilizer for NVIDIA Jetson Boards/Head|next=Contact Us}}
{{GStreamer Video Stabilizer for NVIDIA Jetson Boards/Head|previous=Performance/TX1/TX2|next=Contact Us|metakeywords=TX1/TX2_pipelines performance, Xavier pipelines performance, examples, performance analysis, GstNvStabilize performance, GstNvStabilize performance analysis, Xavier performance, CPU performance, GPU performance}}
</noinclude>
</noinclude>


The following section describes some relevant performance measurements during video stabilization. It begins with a summary of the results detailed on the following sections, as well as the pipelines used to capture such results.
The following section describes some relevant performance measurements during video stabilization for a few standard resolutions. It begins with a summary of the results detailed in the following sections, as well as the pipelines used to capture such results.




Line 9: Line 9:


= Summary =  
= Summary =  
== Reading buffers from file ==  
== Benchmarking ==
{| class="wikitable"
 
=== Standalone element ===
==== Test Conditions ====
 
All the measurements below were made using the following minimal pipeline.
 
<syntaxhighlight lang=bash>
PATH_TO_FILE=path_to_file.rgba
WIDTH=1920
HEIGHT=1080
FRAME_SIZE=$(($WIDTH * $HEIGHT * 4))
 
gst-launch-1.0  filesrc location=$PATH_TO_FILE blocksize=$FRAME_SIZE ! videoparse format=rgba width=$WIDTH height=$HEIGHT ! nvstabilize ! fakesink sync=true
</syntaxhighlight>
 
Note that this pipeline attempts to be as the least invasive as possible so the only processing element is GstNvStabilize.
 
==== Maximum and minimum framerate ====
These measurements were taken with the pipeline above, but without any limitation regarding the framerate. In the next table, you can find the maximum, minimum, and average framerate for video input and different resolution stabilized by the plugin.
 
{| class="wikitable" style="margin: 1em auto 1em auto"
|-
! Resolution !! Maximum framerate !! Minimum framerate !! Average
|-
| 640x480 || 220.77 || 182.53 || 204.0
|-
| 1280x720 || 141.57 || 119.88 || 129.87
|-
| 1920x1080 || 91.36 || 60.69 || 79.20
|-
| 3840×2160 || 31.96 || 17.17 || 25.12
 
|}
<span style="color:red"> '''Note:''' To take into account the framerate relies on the movement of the video. </span>
[[File:Max-min-framerate-xavier.png|frame|center|Maximum and minimum framerate for different resolutions.]]
 
 
==== CPU ====
 
{| class="wikitable" style="margin: 1em auto 1em auto"
|-
! Resolution !! CPU 0 !! CPU 1 !! CPU 2 !! CPU 3 !! Average (reported by top)
|-
| 640x480@25Fps || 23.6 || 2.9 || 0.7 || 0 || 22.7
|-
| 1280x720@25Fps || 27.55 || 12.33 || 0 || 1.44 ||27.3
|-
|-
! !! RAM !! CPU 0 !! CPU 1 !! CPU 2 !! CPU 3 !! GPU !! Framerate
| 1920x1080@25Fps || 42.05 || 1.44 || 1.27 || 4.055 || 41.5
|-
|-
| 1920x1080@30FPS || 1948/15828MB (lfb 3250x4MB) || 5.14 || 6.42 || 6.14 || 70 || 32  || 43.5
| 2048×1080@25Fps || 51.17 || 3.73 || 2.70 || 0.20 || 49.2
|}
|}


== Capturing buffers using v4l2src ==  
[[File:Cpu xav.png|frame|center|CPU consumption for different resolutions.]]
{| class="wikitable"
 
==== GPU ====
{| class="wikitable" style="margin: 1em auto 1em auto"
|-
|-
! Resolution !! RAM !! CPU 0 !! CPU 1 !! CPU 2 !! CPU 3 !! GPU !! Framerate
! Resolution !! GPU
|-
|-
| 640x480@30FPS || 1915/15828MB (lfb 3253x4MB) || 4 || 11.5 || 5.6 || 0.7 || 6.6 || 30
| 640x480@25Fps ||1.41
|-
|-
| 1280x720@10FPS || 1422/15828MB (lfb 3438x4MB)  || 3 || 8.7 || 4.6 || 1.6 || 8.11 || 10
| 1280x720@25Fps || 2.53
|-
|-
| 1920x1080@5FPS || 1578/15828MB (lfb 3398x4MB) || 6.3 || 2.6 || 32 || 0.1 || 2 || 5
| 1920x1080@25Fps || 3.87
|-
| 2048×1080@25Fps || 4.6
|}
|}


= Performance monitoring =  
[[File:Gpu xav.png|frame|center|GPU consumption for different resolutions.]]
== Read buffers from file ==
 
<pre>
==== RAM ====
gst-launch-1.0  filesrc location=$PATH_TO_FILE ! qtdemux ! h264parse ! omxh264dec ! nvvidconv ! 'video/x-raw, width=(int)1920, height=(int)1080, format=(string)RGBA' ! nvstabilize ! perf print-arm-load=true ! fakesink -v sync=true
{| class="wikitable" style="margin: 1em auto 1em auto"
</pre>
|-
<pre>
! Resolution !! RAM
RAM 1564/15828MB (lfb 3421x4MB) CPU [3%@1190,63%@1190,3%@1190,27%@1190,off,off,off,off] GR3D_FREQ 0%
|-
RAM 1564/15828MB (lfb 3421x4MB) CPU [9%@1190,68%@1190,3%@1190,1%@1190,off,off,off,off]  GR3D_FREQ 6%
| 640x480@25Fps || 2136/15828MB
RAM 1564/15828MB (lfb 3420x4MB) CPU [5%@1190,38%@1190,4%@1190,0%@1190,off,off,off,off]  GR3D_FREQ 28%
|-
RAM 1564/15828MB (lfb 3420x4MB) CPU [10%@1190,31%@1190,0%@1190,5%@1190,off,off,off,off] GR3D_FREQ 0%
| 1280x720@25Fps || 2153/15828MB
RAM 1564/15828MB (lfb 3420x4MB) CPU [5%@1190,46%@1190,1%@1190,2%@1190,off,off,off,off]  GR3D_FREQ 0%
|-
RAM 1564/15828MB (lfb 3419x4MB) CPU [11%@1190,32%@1190,0%@1190,3%@1190,off,off,off,off] GR3D_FREQ 38%
| 1920x1080@25Fps || 2528/15828MB
RAM 1564/15828MB (lfb 3419x4MB) CPU [9%@1190,39%@1190,1%@1190,1%@1190,off,off,off,off]  GR3D_FREQ 10%
|-
RAM 1564/15828MB (lfb 3418x4MB) CPU [10%@1190,38%@1190,1%@1190,2%@1190,off,off,off,off] GR3D_FREQ 0%
| 2048×1080@25Fps || 2572/15828MB
RAM 1564/15828MB (lfb 3418x4MB) CPU [9%@1190,38%@1190,0%@1190,0%@1190,off,off,off,off]  GR3D_FREQ 34%
|}
RAM 1564/15828MB (lfb 3418x4MB) CPU [8%@1190,37%@1190,1%@1190,1%@1190,off,off,off,off] GR3D_FREQ 19%
 
RAM 1564/15828MB (lfb 3417x4MB) CPU [9%@1190,33%@1190,0%@1190,2%@1190,off,off,off,off] GR3D_FREQ 30%
[[File:Ram xav.png|frame|center|RAM consumption for different resolutions.]]


</pre>
== Full pipeline ==
The following measurements were taken using an OV10635 camera at '''1280x720@30FPS'''. As further explained on the [https://developer.ridgerun.com/wiki/index.php?title=GStreamer_Video_Stabilizer_for_NVIDIA_Jetson_Boards/User_Guide User Guide], the resulting stabilization, latency and resources the element consumes are all affected by the chosen queue-size, as shown in the results reported as follows:
<pre>
<pre>
perf: perf0; timestamp: 0:27:39.169478723; bps: 1989273227.944; mean_bps: 1995077777.687; fps: 29.979; mean_fps: 30.067; cpu: 9;
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1280,height=720' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1280,height=720,format=RGBA'  ! nvvidconv ! queue max-size-buffers=1 leaky=downstream ! nvstabilize queue-size=5 ! fakesink
INFO:
perf: perf0; timestamp: 0:27:40.203579516; bps: 1989178631.256; mean_bps: 1994750047.330; fps: 29.978; mean_fps: 30.062; cpu: 9;
INFO:
perf: perf0; timestamp: 0:27:41.205048688; bps: 1987735674.404; mean_bps: 1994380869.807; fps: 29.956; mean_fps: 30.056; cpu: 9;
INFO:
perf: perf0; timestamp: 0:27:42.234629332; bps: 1997911685.682; mean_bps: 1994557410.601; fps: 30.109; mean_fps: 30.059; cpu: 9;
INFO:
perf: perf0; timestamp: 0:27:43.271330293; bps: 1984189537.179; mean_bps: 1994063702.343; fps: 29.903; mean_fps: 30.051; cpu: 9;
INFO:
perf: perf0; timestamp: 0:27:44.287287235; bps: 1894077121.233; mean_bps: 1989518857.747; fps: 28.545; mean_fps: 29.983; cpu: 9;
</pre>
</pre>


<pre>
{| class="wikitable" style="margin: 1em auto 1em auto"
gst-launch-1.0  filesrc location=$PATH_TO_FILE ! qtdemux ! h264parse ! omxh264dec ! nvvidconv ! 'video/x-raw, width=(int)1920, height=(int)1080, format=(string)RGBA' ! nvstabilize ! perf print-arm-load=true ! fakesink -v sync=false
|-
</pre>
! Queue-size !! RAM !! CPU 0 !! CPU 1 !! CPU 2 !! CPU 3 !! GPU !! Framerate
<pre>
|-
RAM 1577/15828MB (lfb 3405x4MB) CPU [6%@1190,65%@1190,11%@1190,12%@1190,off,off,off,off] GR3D_FREQ 21%
| No stabilization || 1384/15828MB || 18.875 || 8.625 || 11 || 0.75 || 2.125 || 30
RAM 1578/15828MB (lfb 3405x4MB) CPU [6%@1190,67%@1190,13%@1190,4%@1190,off,off,off,off] GR3D_FREQ 21%
|-
RAM 1578/15828MB (lfb 3405x4MB) CPU [7%@1190,70%@1190,9%@1190,5%@1190,off,off,off,off]  GR3D_FREQ 11%
| 1|| 1396/15828MB  || 31.11 || 29 || 1.55 || 3.22 || 10.33 || 30
RAM 1578/15828MB (lfb 3405x4MB) CPU [8%@1190,60%@1190,12%@1190,13%@1190,off,off,off,off] GR3D_FREQ 25%
|-
RAM 1578/15828MB (lfb 3405x4MB) CPU [10%@1190,64%@1190,1%@1190,10%@1190,off,off,off,off] GR3D_FREQ 40%
| 2 || 1406/15828MB || 23.625 || 22.75 || 9.125 || 9 || 13.125 || 30
RAM 1578/15828MB (lfb 3405x4MB) CPU [11%@1190,70%@1190,2%@1190,2%@1190,off,off,off,off] GR3D_FREQ 31%
|-
RAM 1578/15828MB (lfb 3405x4MB) CPU [11%@1190,69%@1190,1%@1190,4%@1190,off,off,off,off]  GR3D_FREQ 38%
| 3 || 1426/15828MB || 17.625 || 20.375 || 11.75 || 12.75 || 15.25 || 30
RAM 1578/15828MB (lfb 3405x4MB) CPU [9%@1190,71%@1190,3%@1190,4%@1190,off,off,off,off]  GR3D_FREQ 38%
|-
</pre>
| 4 || 1441/15828MB || 16.42 || 20.71 || 14.85 || 14.28 || 8.57 || 30
<pre>
|-
perf: perf0; timestamp: 0:49:03.086145386; bps: 3355382918.498; mean_bps: 3355382918.498; fps: 50.567; mean_fps: 50.567; cpu: 6;
| 5 || 1551/15828MB || 10 || 11.7 || 23 || 11.7 || 7.8 || 30
INFO:
|-
perf: perf0; timestamp: 0:49:04.119962865; bps: 2374831582.819; mean_bps: 2865107250.659; fps: 35.790; mean_fps: 43.178; cpu: 6;
| 6 || 1563/15828MB || 14.77 || 13.77 || 21.11 || 11.77 || 10 || 30
INFO:
|}
perf: perf0; timestamp: 0:49:05.131582409; bps: 2230163319.186; mean_bps: 2653459273.501; fps: 33.609; mean_fps: 39.989; cpu: 6;
INFO:
perf: perf0; timestamp: 0:49:06.151425864; bps: 2212179515.336; mean_bps: 2543139333.960; fps: 33.338; mean_fps: 38.326; cpu: 6;
INFO:
perf: perf0; timestamp: 0:49:07.152486874; bps: 2319970488.112; mean_bps: 2498505564.790; fps: 34.963; mean_fps: 37.654; cpu: 6;
INFO:
perf: perf0; timestamp: 0:49:08.160844239; bps: 2105767730.471; mean_bps: 2433049259.070; fps: 31.735; mean_fps: 36.667; cpu: 6;
INFO:
perf: perf0; timestamp: 0:49:09.169190775; bps: 3882550948.735; mean_bps: 2640120929.022; fps: 58.512; mean_fps: 39.788; cpu: 6;
INFO:
perf: perf0; timestamp: 0:49:10.171828956; bps: 3639933197.397; mean_bps: 2765097462.569; fps: 54.855; mean_fps: 41.671; cpu: 6;
INFO:
perf: perf0; timestamp: 0:49:11.183369089; bps: 3870293102.844; mean_bps: 2887896978.155; fps: 58.327; mean_fps: 43.522; cpu: 6;


</pre>
== Glass-to-glass latency ==
Latency was measured as shown in the picture, and the following are the approximate results. It is important to notice that latency can be affected by the parameters selected on the pipeline, specifically the queue-size property of the gst-nvstabilize element, as further explained on the [https://developer.ridgerun.com/wiki/index.php?title=GStreamer_Video_Stabilizer_for_NVIDIA_Jetson_Boards/User_Guide User Guide]. The pipeline used was the following:


== Read buffers from v4l2src ==
'''Note:''' the following latency measurements were '''NOT''' taken with high-performance enabled, given that the chosen resolution did not require it.
''' 640x360@30Fps camera source '''


Pipeline:
<syntaxhighlight lang=bash>
<pre>
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1280,height=720' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1280,height=720,format=RGBA'  ! nvvidconv ! queue max-size-buffers=1 leaky=downstream ! nvstabilize queue-size=5 ! nvvidconv ! nvoverlaysink sync=false
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=640,height=480' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=640,height=480,format=BGRx'  ! nvvidconv ! nvstabilize queue-size=5 ! perf print-arm-load=true ! fakesink
</syntaxhighlight>
</pre>
   
Tegrastats:
<pre>
RAM 1915/15828MB (lfb 3253x4MB) CPU [5%@1190,6%@1190,5%@1190,3%@1190,off,off,off,off] GR3D_FREQ 0%
RAM 1915/15828MB (lfb 3253x4MB) CPU [5%@1190,11%@1190,0%@1190,0%@1190,off,off,off,off] GR3D_FREQ 9%
RAM 1915/15828MB (lfb 3253x4MB) CPU [4%@1190,11%@1190,2%@1190,0%@1190,off,off,off,off] GR3D_FREQ 7%
RAM 1915/15828MB (lfb 3253x4MB) CPU [4%@1190,16%@1190,1%@1190,0%@1190,off,off,off,off] GR3D_FREQ 0%
RAM 1915/15828MB (lfb 3253x4MB) CPU [4%@1190,17%@1190,1%@1190,0%@1190,off,off,off,off] GR3D_FREQ 9%
RAM 1915/15828MB (lfb 3253x4MB) CPU [5%@1190,19%@1190,1%@1190,0%@1190,off,off,off,off] GR3D_FREQ 20%
RAM 1915/15828MB (lfb 3253x4MB) CPU [5%@1190,22%@1190,0%@1190,1%@1190,off,off,off,off] GR3D_FREQ 3%
RAM 1915/15828MB (lfb 3253x4MB) CPU [2%@1190,1%@1190,20%@1190,2%@1190,off,off,off,off] GR3D_FREQ 1%
RAM 1915/15828MB (lfb 3253x4MB) CPU [2%@1190,1%@1190,21%@1190,1%@1190,off,off,off,off] GR3D_FREQ 11%
</pre>
Framerate and average CPU consumption: (negotiated framerate: 30 fps)
<pre>
INFO:
perf: perf0; timestamp: 1:08:26.619340314; bps: 296077774.528; mean_bps: 267035771.375; fps: 30.119; mean_fps: 27.164; cpu: 5;
INFO:
perf: perf0; timestamp: 1:08:27.620205839; bps: 294656967.029; mean_bps: 270488420.832; fps: 29.974; mean_fps: 27.516; cpu: 5;
INFO:
perf: perf0; timestamp: 1:08:28.658325183; bps: 293552375.997; mean_bps: 273051082.517; fps: 29.862; mean_fps: 27.776; cpu: 5;
INFO:
perf: perf0; timestamp: 1:08:29.687389555; bps: 296135410.273; mean_bps: 275359515.293; fps: 30.124; mean_fps: 28.011; cpu: 5;
INFO:
perf: perf0; timestamp: 1:08:30.692569786; bps: 283612422.139; mean_bps: 276109779.551; fps: 28.851; mean_fps: 28.087; cpu: 5;
INFO:
perf: perf0; timestamp: 1:08:31.720799605; bps: 305936274.350; mean_bps: 278595320.785; fps: 31.121; mean_fps: 28.340; cpu: 5;
INFO:
perf: perf0; timestamp: 1:08:32.752303453; bps: 285904895.626; mean_bps: 279157595.772; fps: 29.084; mean_fps: 28.397; cpu: 5;
</pre>


''' 1280x720@10Fps camera source '''
[[File:Photo5174730964096624673.jpg| 800x411px| frame thumb |center|Glass-to-glass latency measurement]]
Pipeline:
<pre>
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1280,height=720' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1280,height=720,format=BGRx'  ! nvvidconv ! nvstabilize queue-size=5 ! perf print-arm-load=true ! fakesink
</pre>
Tegrastats:
<pre>
RAM 1422/15828MB (lfb 3438x4MB) CPU [2%@1190,1%@1190,10%@1190,5%@1190,off,off,off,off] GR3D_FREQ 18%
RAM 1422/15828MB (lfb 3438x4MB) CPU [2%@1190,0%@1190,13%@1190,0%@1190,off,off,off,off] GR3D_FREQ 16%
RAM 1422/15828MB (lfb 3438x4MB) CPU [3%@1190,1%@1190,5%@1190,8%@1190,off,off,off,off]  GR3D_FREQ 0%
RAM 1422/15828MB (lfb 3438x4MB) CPU [5%@1190,9%@1190,0%@1190,2%@1190,off,off,off,off] GR3D_FREQ 0%
RAM 1422/15828MB (lfb 3438x4MB) CPU [5%@1190,16%@1190,0%@1190,0%@1190,off,off,off,off] GR3D_FREQ 0%
RAM 1422/15828MB (lfb 3438x4MB) CPU [3%@1190,17%@1190,0%@1190,0%@1190,off,off,off,off] GR3D_FREQ 13%
RAM 1422/15828MB (lfb 3438x4MB) CPU [2%@1190,16%@1190,0%@1190,0%@1190,off,off,off,off] GR3D_FREQ 0%
RAM 1422/15828MB (lfb 3438x4MB) CPU [2%@1190,17%@1190,0%@1190,0%@1190,off,off,off,off] GR3D_FREQ 20%
RAM 1422/15828MB (lfb 3438x4MB) CPU [3%@1190,2%@1190,14%@1190,0%@1190,off,off,off,off] GR3D_FREQ 6%
</pre>
Framerate and average CPU consumption: (negotiated framerate: 15 fps)
<pre>
INFO:
perf: perf0; timestamp: 0:21:16.175312915; bps: 294770087.952; mean_bps: 295687663.966; fps: 9.995; mean_fps: 10.026; cpu: 4;
INFO:
perf: perf0; timestamp: 0:21:17.176574979; bps: 294540271.327; mean_bps: 295572924.702; fps: 9.987; mean_fps: 10.022; cpu: 4;
INFO:
perf: perf0; timestamp: 0:21:18.177108331; bps: 294754791.942; mean_bps: 295498548.997; fps: 9.995; mean_fps: 10.020; cpu: 4;
INFO:
perf: perf0; timestamp: 0:21:19.246683534; bps: 275728157.471; mean_bps: 293851016.370; fps: 9.350; mean_fps: 9.964; cpu: 4;
INFO:
perf: perf0; timestamp: 0:21:20.247672144; bps: 294620734.995; mean_bps: 293910225.495; fps: 9.990; mean_fps: 9.966; cpu: 4;
</pre>


''' 1920x1080@5Fps camera source'''


Pipeline:
''' 1280x720@30Fps '''
<pre>
{| class="wikitable" style="margin: 1em auto 1em auto"
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1920,height=1080' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1920,height=1080,format=BGRx'  ! nvvidconv ! nvstabilize queue-size=5 ! perf print-arm-load=true ! fakesink
|-
</pre>
! queue-size !! Latency (ms)
Tegrastats:
|-
<pre>
| No stabilizer || 132
RAM 1578/15828MB (lfb 3398x4MB) CPU [2%@1190,0%@1190,37%@1190,0%@1190,off,off,off,off]  GR3D_FREQ 0%
|-
RAM 1578/15828MB (lfb 3398x4MB) CPU [18%@1190,3%@1190,24%@1190,0%@1190,off,off,off,off] GR3D_FREQ 0%
| 1 || 199
RAM 1578/15828MB (lfb 3398x4MB) CPU [3%@1190,7%@1190,30%@1190,0%@1190,off,off,off,off]  GR3D_FREQ 0%
|-
RAM 1578/15828MB (lfb 3398x4MB) CPU [17%@1190,0%@1190,24%@1190,0%@1190,off,off,off,off] GR3D_FREQ 0%
| 2 || 232
RAM 1578/15828MB (lfb 3398x4MB) CPU [3%@1190,1%@1190,41%@1190,1%@1190,off,off,off,off]  GR3D_FREQ 0%
|-
RAM 1578/15828MB (lfb 3398x4MB) CPU [6%@1190,9%@1190,28%@1190,0%@1190,off,off,off,off]  GR3D_FREQ 0%
| 3 || 265
RAM 1578/15828MB (lfb 3398x4MB) CPU [4%@1190,0%@1190,36%@1190,0%@1190,off,off,off,off]  GR3D_FREQ 0%
|-
RAM 1578/15828MB (lfb 3398x4MB) CPU [4%@1190,0%@1190,35%@1190,0%@1190,off,off,off,off]  GR3D_FREQ 0%
| 4 || 297
RAM 1578/15828MB (lfb 3398x4MB) CPU [3%@1190,0%@1190,36%@1190,0%@1190,off,off,off,off]  GR3D_FREQ 20%
|-
RAM 1578/15828MB (lfb 3398x4MB) CPU [3%@1190,6%@1190,35%@1190,0%@1190,off,off,off,off]  GR3D_FREQ 0% 
| 5 || 320
</pre>
|-
Framerate and average CPU consumption: (negotiated framerate: 5 fps)
| 6 || 365
<pre>
|}
INFO:
perf: perf0; timestamp: 0:26:07.954658555; bps: 0.000; mean_bps: 0.000; fps: 0.000; mean_fps: 0.000; cpu: 4;
INFO:
perf: perf0; timestamp: 0:26:09.201932927; bps: 319200978.500; mean_bps: 319200978.500; fps: 4.810; mean_fps: 4.810; cpu: 4;
INFO:
perf: perf0; timestamp: 0:26:10.402853309; bps: 331521727.808; mean_bps: 325361353.154; fps: 4.996; mean_fps: 4.903; cpu: 4;
INFO:
perf: perf0; timestamp: 0:26:11.548650907; bps: 347470793.005; mean_bps: 332731166.437; fps: 5.237; mean_fps: 5.014; cpu: 4;
INFO:
perf: perf0; timestamp: 0:26:12.604827888; bps: 314129171.501; mean_bps: 328080667.703; fps: 4.734; mean_fps: 4.944; cpu: 4;
INFO:
perf: perf0; timestamp: 0:26:13.800567792; bps: 332958027.635; mean_bps: 329056139.690; fps: 5.018; mean_fps: 4.959; cpu: 4;
INFO:
perf: perf0; timestamp: 0:26:14.801171755; bps: 331575740.521; mean_bps: 329476073.161; fps: 4.997; mean_fps: 4.965; cpu: 4;
</pre>


[[File:Lat xav.png|frame|center|Latency measurements varying queue size.]]


<noinclude>
<noinclude>
{{GStreamer Video Stabilizer for NVIDIA Jetson Boards/Foot||Contact Us}}
{{GStreamer Video Stabilizer for NVIDIA Jetson Boards/Foot|Performance/TX1/TX2|Contact Us}}
</noinclude>
</noinclude>

Latest revision as of 11:13, 27 February 2023




Previous: Performance/TX1/TX2 Index Next: Contact Us





The following section describes some relevant performance measurements during video stabilization for a few standard resolutions. It begins with a summary of the results detailed in the following sections, as well as the pipelines used to capture such results.


Summary

Benchmarking

Standalone element

Test Conditions

All the measurements below were made using the following minimal pipeline.

PATH_TO_FILE=path_to_file.rgba
WIDTH=1920
HEIGHT=1080
FRAME_SIZE=$(($WIDTH * $HEIGHT * 4))

gst-launch-1.0  filesrc location=$PATH_TO_FILE blocksize=$FRAME_SIZE ! videoparse format=rgba width=$WIDTH height=$HEIGHT ! nvstabilize ! fakesink sync=true

Note that this pipeline attempts to be as the least invasive as possible so the only processing element is GstNvStabilize.

Maximum and minimum framerate

These measurements were taken with the pipeline above, but without any limitation regarding the framerate. In the next table, you can find the maximum, minimum, and average framerate for video input and different resolution stabilized by the plugin.

Resolution Maximum framerate Minimum framerate Average
640x480 220.77 182.53 204.0
1280x720 141.57 119.88 129.87
1920x1080 91.36 60.69 79.20
3840×2160 31.96 17.17 25.12

Note: To take into account the framerate relies on the movement of the video.

Maximum and minimum framerate for different resolutions.


CPU

Resolution CPU 0 CPU 1 CPU 2 CPU 3 Average (reported by top)
640x480@25Fps 23.6 2.9 0.7 0 22.7
1280x720@25Fps 27.55 12.33 0 1.44 27.3
1920x1080@25Fps 42.05 1.44 1.27 4.055 41.5
2048×1080@25Fps 51.17 3.73 2.70 0.20 49.2
CPU consumption for different resolutions.

GPU

Resolution GPU
640x480@25Fps 1.41
1280x720@25Fps 2.53
1920x1080@25Fps 3.87
2048×1080@25Fps 4.6
GPU consumption for different resolutions.

RAM

Resolution RAM
640x480@25Fps 2136/15828MB
1280x720@25Fps 2153/15828MB
1920x1080@25Fps 2528/15828MB
2048×1080@25Fps 2572/15828MB
RAM consumption for different resolutions.

Full pipeline

The following measurements were taken using an OV10635 camera at 1280x720@30FPS. As further explained on the User Guide, the resulting stabilization, latency and resources the element consumes are all affected by the chosen queue-size, as shown in the results reported as follows:

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1280,height=720' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1280,height=720,format=RGBA'  ! nvvidconv ! queue max-size-buffers=1 leaky=downstream ! nvstabilize queue-size=5 ! fakesink
Queue-size RAM CPU 0 CPU 1 CPU 2 CPU 3 GPU Framerate
No stabilization 1384/15828MB 18.875 8.625 11 0.75 2.125 30
1 1396/15828MB 31.11 29 1.55 3.22 10.33 30
2 1406/15828MB 23.625 22.75 9.125 9 13.125 30
3 1426/15828MB 17.625 20.375 11.75 12.75 15.25 30
4 1441/15828MB 16.42 20.71 14.85 14.28 8.57 30
5 1551/15828MB 10 11.7 23 11.7 7.8 30
6 1563/15828MB 14.77 13.77 21.11 11.77 10 30

Glass-to-glass latency

Latency was measured as shown in the picture, and the following are the approximate results. It is important to notice that latency can be affected by the parameters selected on the pipeline, specifically the queue-size property of the gst-nvstabilize element, as further explained on the User Guide. The pipeline used was the following:

Note: the following latency measurements were NOT taken with high-performance enabled, given that the chosen resolution did not require it.

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,width=1280,height=720' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1280,height=720,format=RGBA'  ! nvvidconv ! queue max-size-buffers=1 leaky=downstream ! nvstabilize queue-size=5 ! nvvidconv ! nvoverlaysink sync=false


Glass-to-glass latency measurement
Glass-to-glass latency measurement


1280x720@30Fps

queue-size Latency (ms)
No stabilizer 132
1 199
2 232
3 265
4 297
5 320
6 365
Latency measurements varying queue size.


Previous: Performance/TX1/TX2 Index Next: Contact Us