Difference between revisions of "NVIDIA Jetson Orin/GStreamer Pipelines/Capture and Display"

From RidgeRun Developer Connection
Jump to: navigation, search
(Performance Measurement)
Line 95: Line 95:
 
''' 1280x720@30 using xvimagesink '''
 
''' 1280x720@30 using xvimagesink '''
 
<pre>
 
<pre>
  gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! xvimagesink sync=true
+
  gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! xvimagesink
 
</pre>
 
</pre>
  
Line 135: Line 135:
  
 
<pre>
 
<pre>
  gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink sync=true
+
  gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink
 
</pre>
 
</pre>
  
Line 191: Line 191:
 
* For the FPS, [https://github.com/RidgeRun/gst-perf RidgeRun's gst-perf plugin] is used. This plugin computes the FPS mean. For the measurement, we compute the average over 30 samples of the FPS mean values. The following example shows a pipeline with the perf element incorporated:
 
* For the FPS, [https://github.com/RidgeRun/gst-perf RidgeRun's gst-perf plugin] is used. This plugin computes the FPS mean. For the measurement, we compute the average over 30 samples of the FPS mean values. The following example shows a pipeline with the perf element incorporated:
 
<pre>
 
<pre>
  gst-launch-1.0 -v v4l2src device=/dev/video0 ! perf ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink sync=true
+
  gst-launch-1.0 -v v4l2src device=/dev/video0 ! perf ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink
 
</pre>
 
</pre>
  
Line 198: Line 198:
 
* In the case of the Latency metric, the [https://developer.ridgerun.com/wiki/index.php?title=GstShark RidgeRun GstShark plugin] is used. For this metric, it is important to take into account that it is not a glass-to-glass measurement. GstShark provides the time needed by a buffer to travel from the source pad of the source element to the source pad of the remaining elements of the pipeline. The following pipeline shows an example of the GstShark interlatency tracer execution:
 
* In the case of the Latency metric, the [https://developer.ridgerun.com/wiki/index.php?title=GstShark RidgeRun GstShark plugin] is used. For this metric, it is important to take into account that it is not a glass-to-glass measurement. GstShark provides the time needed by a buffer to travel from the source pad of the source element to the source pad of the remaining elements of the pipeline. The following pipeline shows an example of the GstShark interlatency tracer execution:
 
<pre>
 
<pre>
  GST_DEBUG="GST_TRACER:7" GST_TRACERS="interlatency" gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink sync=true
+
  GST_DEBUG="GST_TRACER:7" GST_TRACERS="interlatency" gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink
 
</pre>
 
</pre>
  
== Remote usage ==
 
  
In case you would to work with the board in a remote way, you need to know the '''DISPLAY''' environment variable. For this, before you continue working in a remote way, you need to connect a mouse and keyboard to the board, open a terminal and  look for the '''DISPLAY''' variable as follows:
+
== Remote Development ==
 +
 
 +
Often we want to run tests in a Jetson that is in another physical location. In these cases, you will need to have a display connected to the Jetson and also find out the proper value of the '''DISPLAY''' environment variable. For this, before you move to developing remotely or with someone's help at the Jetson location, connect a keyboard to the Jetson, open a terminal and  check for the '''DISPLAY''' variable executing the following command:
  
 
<pre>
 
<pre>
Line 210: Line 211:
 
<noinclude>
 
<noinclude>
  
After doing the above step, you can run the GStreamer Pipeline such as:
+
This command will print the needed value, usually something like :0. Then you can run the GStreamer Pipeline from an SSH terminal as follows:
  
 +
<pre>
 
  DISPLAY=:0 GST_DEBUG=2 gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! xvimagesink sync=true
 
  DISPLAY=:0 GST_DEBUG=2 gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! xvimagesink sync=true
 +
</pre>
 +
 +
 +
Make sure to replace the :0 value in the pipeline command according to your $DISPLAY environment variable. More information about accessing the Jetson Orin AGX through SSH can be found in our [[NVIDIA_Jetson_Orin/In_Board/Getting_in_Board/SSH|SSH section.]]
  
 
{{NVIDIA Jetson Orin/Foot|GStreamer Pipelines|GStreamer Pipelines/H264}}
 
{{NVIDIA Jetson Orin/Foot|GStreamer Pipelines|GStreamer Pipelines/H264}}
 
</noinclude>
 
</noinclude>

Revision as of 16:35, 22 July 2022



Previous: GStreamer Pipelines Index Next: GStreamer Pipelines/H264


Nvidia-preferred-partner-badge-rgb-for-screen.png



This section presents GStreamer pipelines to capture from MIPI CSI-2 and USB cameras and render the video to the display connected to the Orin. Key performance indicators are measured using three power profiles (operation modes). You can find information on how the performance metrics were extracted in the Performance Measurement subsection.


MIPI CSI-2 Camera

For the pipelines in this section, we used the IMX477 camera.


1920x1080@30 using nv3dsink

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=1920,height=1080,framerate=30/1,format=NV12' ! nv3dsink
Table 1: Performance of pipeline at 1920x1080@30 using nv3dsink
Operation Mode CPU (%) GPU 1 (%) GPU 2 (%) FPS latency (ms)
0 (max performance)
1 (min power)
2 (30W)


1920x1080@30 using xvimagesink

gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM),width=1920,height=1080,framerate=30/1,format=NV12' ! nvvidconv ! xvimagesink
Table 2: Performance of pipeline at 1920x1080@30 using xvimagesink
Operation Mode CPU (%) GPU 1 (%) GPU 2 (%) FPS latency (ms)
0 (max performance)
1 (min power)
2 (30W)


USB Camera

For the pipelines in this section, we used the LI-10635 USB camera.


1280x720@30 using xvimagesink

 gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! xvimagesink


Table 3: Performance of pipeline at 1280x720@30 using xvimagesink
Operation Mode CPU (%) GPU 1 (%) GPU 2 (%) FPS latency (ms)
0 (max performance) 32.27 22.2 23.87 30.01 0.13
1 (min power) 23.97 6.27 63.4 30.01 0.13
2 (30W) 27.6 5.87 64.87 30.01 0.16


1280x720@30 using nv3dsink

 gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink

Performance:

Table 4: Performance of pipeline at 1280x720@30 using nv3dsink
Operation Mode CPU (%) GPU 1 (%) GPU 2 (%) FPS latency (ms)
0 (max performance) 24.5 31.33 28.27 30.01 1.92
1 (min power) 32.87 17.93 52.17 30.01 2.47
2 (30W) 28.5 14.9 52.63 30.01 2.34


Performance Measurement

The performance measurements are extracted using the specified power profile (operation mode) and with the GStreamer pipeline running in the system.


Operation Mode:


CPU usage:

  • For the CPU percentage utilization, the tegrastats utility was used as follows: sudo tegrastats -readall. This command shows the percentage utilization of the 12 cores that the Jetson AGX Orin devkit has. For the measurement, we compute the average over 30 samples of the utilization values for the CPU cores.


GPU Usage:

  • The same procedure described for the CPU usage is done in the case of GPU percentage. As the board has 2 GPUs, 30 samples of each one are taken, and then, the average is obtained.


FPS:

  • For the FPS, RidgeRun's gst-perf plugin is used. This plugin computes the FPS mean. For the measurement, we compute the average over 30 samples of the FPS mean values. The following example shows a pipeline with the perf element incorporated:
 gst-launch-1.0 -v v4l2src device=/dev/video0 ! perf ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink


Latency:

  • In the case of the Latency metric, the RidgeRun GstShark plugin is used. For this metric, it is important to take into account that it is not a glass-to-glass measurement. GstShark provides the time needed by a buffer to travel from the source pad of the source element to the source pad of the remaining elements of the pipeline. The following pipeline shows an example of the GstShark interlatency tracer execution:
 GST_DEBUG="GST_TRACER:7" GST_TRACERS="interlatency" gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink


Remote Development

Often we want to run tests in a Jetson that is in another physical location. In these cases, you will need to have a display connected to the Jetson and also find out the proper value of the DISPLAY environment variable. For this, before you move to developing remotely or with someone's help at the Jetson location, connect a keyboard to the Jetson, open a terminal and check for the DISPLAY variable executing the following command:

echo $DISPLAY


This command will print the needed value, usually something like :0. Then you can run the GStreamer Pipeline from an SSH terminal as follows:

 DISPLAY=:0 GST_DEBUG=2 gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=1280,height=720 ! nvvidconv ! xvimagesink sync=true


Make sure to replace the :0 value in the pipeline command according to your $DISPLAY environment variable. More information about accessing the Jetson Orin AGX through SSH can be found in our SSH section.


Previous: GStreamer Pipelines Index Next: GStreamer Pipelines/H264