Jump to content

GStreamer pipelines for Jetson TX2: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 3: Line 3:
{{GStreamer debug}}
{{GStreamer debug}}


= Introduction =
== Introduction ==


On this page you are going to find a set of pipelines used on Jetson TX2, specifically used with the Jetson board. The wiki page tries to describe some of the multimedia features of the platform like the NVIDIA model to handle the ISP through its custom (and close) plugin called nvcamerasrc. It also includes a brief description of the sample application called nvgstcapture-1.0 and ways to measure the ARM load. The goal is to provide you some example pipelines and introduction to the board. It is a work in progress.
On this page you are going to find a set of pipelines used on Jetson TX2, specifically used with the Jetson board. The wiki page tries to describe some of the multimedia features of the platform like the NVIDIA model to handle the ISP through its custom (and close) plugin called nvcamerasrc. It also includes a brief description of the sample application called nvgstcapture-1.0 and ways to measure the ARM load. The goal is to provide you some example pipelines and introduction to the board. It is a work in progress.
Line 9: Line 9:
The camera sensor used for tests is the OV5693. These steps were run on Jetson TX2.
The camera sensor used for tests is the OV5693. These steps were run on Jetson TX2.


= Gstreamer pipelines =
== Jetson TX2 GStreamer pipelines ==


Recall that this board is a quad core A57 with some hardware units dedicated to encode/decode. Plugins accelerated by Hardware available:
Recall that this board is a quad core A57 with some hardware units dedicated to encode/decode. Plugins accelerated by Hardware available:
Line 48: Line 48:
</syntaxhighlight>
</syntaxhighlight>


== Measure ARM load ==
=== Measure ARM load ===


There is a tool to measure the ARM load created by NVIDIA for the Jetson TX2. This tool seems to give better statistics of the ARM cores than top. In the remaining sections of this wiki the ARM load reported by top is included for reference to the reader but tegrastats should contain the real load.
There is a tool to measure the ARM load created by NVIDIA for the Jetson TX2. This tool seems to give better statistics of the ARM cores than top. In the remaining sections of this wiki the ARM load reported by top is included for reference to the reader but tegrastats should contain the real load.
Line 67: Line 67:
</syntaxhighlight>
</syntaxhighlight>


=== Jetson TX2 ARM load ===
==== Jetson TX2 ARM load ====


This table tries to summarize the ARM load of different user cases of the Jetson TX2 using gstreamer and the capture plugin. The second column has the ARM load of the pipeline measured in one instant, using that value and the known value for the capture process the third column estimates the load of the encoding or display process (subtract the capture load). The load represent a global load of the system (4 ARMs) just to give an idea to the reader of the system capabilities.
This table tries to summarize the ARM load of different user cases of the Jetson TX2 using gstreamer and the capture plugin. The second column has the ARM load of the pipeline measured in one instant, using that value and the known value for the capture process the third column estimates the load of the encoding or display process (subtract the capture load). The load represent a global load of the system (4 ARMs) just to give an idea to the reader of the system capabilities.
Line 100: Line 100:
|}
|}


== VLC on Jetson TX1 and Jetson TX2 ==
=== VLC on Jetson TX1 and Jetson TX2 ===


In order to test some of the videos or incoming streams produced by the pipelines below you might need VLC installed in your Jetson module, there is a known issue with VLC version 2.2 and you need to download and install VLC 2.4 or newer, in order to do it please follow these steps:
In order to test some of the videos or incoming streams produced by the pipelines below you might need VLC installed in your Jetson module, there is a known issue with VLC version 2.2 and you need to download and install VLC 2.4 or newer, in order to do it please follow these steps:
Line 119: Line 119:
this issue has been reported on [https://devtalk.nvidia.com/default/topic/990198/?comment=5079474 NVIDIA's forum]
this issue has been reported on [https://devtalk.nvidia.com/default/topic/990198/?comment=5079474 NVIDIA's forum]


== Capture ==
=== Capture ===


In order to capture there are two ways: Using v4l2 or using nvcamerasrc.
In order to capture there are two ways: Using v4l2 or using nvcamerasrc.


=== nvcamerasrc ===
==== nvcamerasrc ====


This plugin was created by nvidia and it has access to the ISP that helps converting from bayer to yuv suitable for the video encoders. However, it seems that its usage is limited to the ov5693 sensor until NVIDIA releases its source code or until it adds support to v4l2 to use the ISP.
This plugin was created by nvidia and it has access to the ISP that helps converting from bayer to yuv suitable for the video encoders. However, it seems that its usage is limited to the ov5693 sensor until NVIDIA releases its source code or until it adds support to v4l2 to use the ISP.
Line 339: Line 339:
</syntaxhighlight>
</syntaxhighlight>


=== v4l2src ===
==== v4l2src ====


Starting on L4T R23.2 there is a /dev/video0 node to capture, however, this node will give you frames in bayer which are NOT suitable to encode because it grabs frames directly from the [https://www.ovt.com/sensors/OV5693 ov5693 camera] without using the ISP.
Starting on L4T R23.2 there is a /dev/video0 node to capture, however, this node will give you frames in bayer which are NOT suitable to encode because it grabs frames directly from the [https://www.ovt.com/sensors/OV5693 ov5693 camera] without using the ISP.
Line 350: Line 350:
It works also with the UVC driver.
It works also with the UVC driver.


== Capture and Display ==
=== Capture and Display ===


=== nvcamerasrc ===
==== nvcamerasrc ====


<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
Line 389: Line 389:
</syntaxhighlight>
</syntaxhighlight>


== H264 encoding ==
=== H264 encoding ===


=== videotestsrc ===
==== videotestsrc ====


ARM load: 157% but only videotestsrc consumes 100%. According to the NVIDIA forum when using videotestsrc the system is also doing memory copies to feed the encoder with NVMM memory buffers so that loads more the ARM.
ARM load: 157% but only videotestsrc consumes 100%. According to the NVIDIA forum when using videotestsrc the system is also doing memory copies to feed the encoder with NVMM memory buffers so that loads more the ARM.
Line 401: Line 401:
VLC can play the file correctly at 30fps and reports as codec: H264-MPEG-4 AVC (part 10) (h264). The fan on top of the SoC didn't turn on.
VLC can play the file correctly at 30fps and reports as codec: H264-MPEG-4 AVC (part 10) (h264). The fan on top of the SoC didn't turn on.


=== nvcamerasrc ===
==== nvcamerasrc ====


<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
Line 525: Line 525:
</syntaxhighlight>
</syntaxhighlight>


== Dual H264 encoding ==
=== Dual H264 encoding ===


<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
Line 560: Line 560:
</syntaxhighlight>
</syntaxhighlight>


== H264 UDP Streaming ==
=== H264 UDP Streaming ===


server:
server:
Line 592: Line 592:
vlc -vv --demux h264 --h264-fps 60  udp://@:5000  
vlc -vv --demux h264 --h264-fps 60  udp://@:5000  
</syntaxhighlight>
</syntaxhighlight>
=== h264 parse missing===
==== h264 parse missing====
In case gstreamer complains when running the pipeline for missing the h264parse plugin, run the following command to install it:  
In case gstreamer complains when running the pipeline for missing the h264parse plugin, run the following command to install it:  
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
Line 598: Line 598:
</syntaxhighlight>
</syntaxhighlight>


=== Latency ===
==== Latency ====


*1080p30
*1080p30
Line 605: Line 605:
*Latency=138ms
*Latency=138ms


== VP8 encoding ==
=== VP8 encoding ===


=== videotestsrc ===
==== videotestsrc ====


ARM load: 156% but only videotestsrc consumes 100%. According to the NVIDIA forum when using videotestsrc the system is also doing memory copies to feed the encoder with NVMM memory buffers so that loads more the ARM.
ARM load: 156% but only videotestsrc consumes 100%. According to the NVIDIA forum when using videotestsrc the system is also doing memory copies to feed the encoder with NVMM memory buffers so that loads more the ARM.
Line 617: Line 617:
VLC can play the file correctly at 30fps and reports as codec: Google/On2's VP8 Video (VP80). The fan on top of the SoC didn't turn on.
VLC can play the file correctly at 30fps and reports as codec: Google/On2's VP8 Video (VP80). The fan on top of the SoC didn't turn on.


=== nvcamerasrc ===
==== nvcamerasrc ====


<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
Line 714: Line 714:
</syntaxhighlight>
</syntaxhighlight>


== H265 encoding ==
=== H265 encoding ===


=== VLC with H265 support ===
==== VLC with H265 support ====


In order to support h265 you need VLC 2.2 in your computer to play the videos
In order to support h265 you need VLC 2.2 in your computer to play the videos
Line 726: Line 726:
</syntaxhighlight>
</syntaxhighlight>


=== videotestsrc ===
==== videotestsrc ====


ARM load: 156% but only videotestsrc consumes 100%. According to the NVIDIA forum when using videotestsrc the system is also doing memory copies to feed the encoder with NVMM memory buffers so that loads more the ARM.
ARM load: 156% but only videotestsrc consumes 100%. According to the NVIDIA forum when using videotestsrc the system is also doing memory copies to feed the encoder with NVMM memory buffers so that loads more the ARM.
Line 736: Line 736:
VLC can play the file correctly at 30fps and reports as codec: MPEG-H Part2/HEVC (H.265)(hevc). The fan on top of the SoC didn't turn on.
VLC can play the file correctly at 30fps and reports as codec: MPEG-H Part2/HEVC (H.265)(hevc). The fan on top of the SoC didn't turn on.


=== nvcamerasrc ===
==== nvcamerasrc ====


<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
Line 847: Line 847:
</syntaxhighlight>
</syntaxhighlight>


== Dual H265 encoding ==
=== Dual H265 encoding ===


<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
Line 882: Line 882:
</syntaxhighlight>
</syntaxhighlight>


== H265 UDP Streaming ==
=== H265 UDP Streaming ===


In order to start streaming H265 you need the h265 payloader, to do this you need to compile the latest version of gstreamer in your Jetson TX2 module. Please follow the [http://developer.ridgerun.com/wiki/index.php?title=Compiling_Tegra_X1/X2_source_code instructions to do it]. Same instructions can be run in your PC if you want to update the gstreamer version in your host. (in case of the host I had to recompile the good plugins to get the rtph265pay).
In order to start streaming H265 you need the h265 payloader, to do this you need to compile the latest version of gstreamer in your Jetson TX2 module. Please follow the [http://developer.ridgerun.com/wiki/index.php?title=Compiling_Tegra_X1/X2_source_code instructions to do it]. Same instructions can be run in your PC if you want to update the gstreamer version in your host. (in case of the host I had to recompile the good plugins to get the rtph265pay).
Line 909: Line 909:
</syntaxhighlight>
</syntaxhighlight>


=== Latency ===
==== Latency ====


*1080p30
*1080p30
Line 916: Line 916:
*Latency=251ms
*Latency=251ms


= nvgstcapture-1.0 =
== nvgstcapture-1.0 ==


This is an application based on gstreamer and omx to capture, encode and save video to the filesystem. It has a lot of options. The source code is not released by NVIDIA yet but they are planning to release in future versions of Linux 4 Tegra (L4T), you can read about it at [https://devtalk.nvidia.com/default/topic/898129/jetson-tx1/enabling-camera-on-jetson-tx1-board/ Nvidia Embedded Computing Forum]
This is an application based on gstreamer and omx to capture, encode and save video to the filesystem. It has a lot of options. The source code is not released by NVIDIA yet but they are planning to release in future versions of Linux 4 Tegra (L4T), you can read about it at [https://devtalk.nvidia.com/default/topic/898129/jetson-tx1/enabling-camera-on-jetson-tx1-board/ Nvidia Embedded Computing Forum]
Line 1,265: Line 1,265:
</syntaxhighlight>
</syntaxhighlight>


== Capture snapshots ==
=== Capture snapshots ===


Sometimes when the board has been just flashed you need to run reboot in order to run nvgstcapture-1.0 successfully. To take snapshots:
Sometimes when the board has been just flashed you need to run reboot in order to run nvgstcapture-1.0 successfully. To take snapshots:
Line 1,297: Line 1,297:
In general the application is consuming 15% of each of four cores. It is always displaying video this could affect.
In general the application is consuming 15% of each of four cores. It is always displaying video this could affect.


== Capture and record video ==
=== Capture and record video ===


<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
Line 1,345: Line 1,345:
{{ContactUs}}
{{ContactUs}}


[[Category:Jetson]]
[[Category:Jetson]][[Category:GStreamer]]
Cookies help us deliver our services. By using our services, you agree to our use of cookies.