JetsonTX2/GStreamer/Jetpack4.2+/Encoding: Difference between revisions

mNo edit summary
mNo edit summary
 
(8 intermediate revisions by the same user not shown)
Line 3: Line 3:
</noinclude>
</noinclude>


{{DISPLAYTITLE:Jetson TX2 Jetpack4.2+ GStreamer encoding pipelines|noerror}}


=H.264=
<table>
<tr>
<td><div class="clear; float:right">__TOC__</div></td>
<td valign=top>
{{GStreamer debug}}
</td>
</table>


== OMX ==
==H.264==


=== H264 Encoding from camera ===
=== OMX ===
 
==== H264 Encoding from camera ====


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
Line 17: Line 26:
</syntaxhighlight>
</syntaxhighlight>


=== Dual H264 Encoding from Camera ===
==== Dual H264 Encoding from Camera ====


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
Line 36: Line 45:
|}
|}


==V4L2==
===V4L2===


=== H264 Encoding from Camera ===
==== H264 Encoding from Camera ====


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
Line 66: Line 75:
|}
|}


=== Dual H264 Encoding from Camera ===
==== Dual H264 Encoding from Camera ====


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
Line 84: Line 93:
|}
|}


=H.265=
==H.265==


== OMX ==
=== OMX ===


=== H265 Encoding from camera ===
==== H265 Encoding from camera ====
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
FILE=filename.mp4
FILE=filename.mp4
Line 104: Line 113:




=== Dual H265 Encoding from Camera ===
==== Dual H265 Encoding from Camera ====


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
Line 124: Line 133:




==V4L2==
===V4L2===


=== H265 Encoding from Camera ===
==== H265 Encoding from Camera ====


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
Line 143: Line 152:




=== Dual H265 Encoding from Camera ===
==== Dual H265 Encoding from Camera ====


<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
Line 161: Line 170:
|}
|}


=VP9=
==VP9==


==OMX==
===OMX===


=== VP9 Encoding from Camera ===
==== VP9 Encoding from Camera ====
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
FILE=filename.mkv
FILE=filename.mkv
Line 181: Line 190:




==V4L2==
===V4L2===


=== VP9 Encoding from Camera ===
==== VP9 Encoding from Camera ====
<syntaxhighlight lang=bash>
<syntaxhighlight lang=bash>
FILE=filename.mkv
FILE=filename.mkv

Latest revision as of 19:36, 15 May 2020



  Index  






Problems running the pipelines shown on this page? Please see our GStreamer Debugging guide for help.

H.264

OMX

H264 Encoding from camera

FILE=filename.mp4
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' \
! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420' ! omxh264enc bitrate=8000000 ! 'video/x-h264, stream-format=(string)byte-stream' \
! h264parse ! qtmux ! filesink location=$FILE -e

Dual H264 Encoding from Camera

FILE_A=filenameA.mp4
FILE_B=filenameB.mp4
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' \
! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420' ! tee name=streams \
streams. ! omxh264enc bitrate=8000000 ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! qtmux ! filesink location=$FILE_A \
streams. ! omxh264enc bitrate=8000000 ! 'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! qtmux ! filesink location=$FILE_B

Performance:

CPU 0 CPU 1 CPU 2 CPU 3 Average CPU GPU
15.44 11 15.22 11.5 13.28 2.8

V4L2

H264 Encoding from Camera

FILE=test.h264
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! nvv4l2h264enc bitrate=8000000 ! h264parse ! qtmux ! filesink  location=$FILE -e

The nvv4l2h264enc plugin has a property to enable a maximum performance mode, though as expected, power consumption increases. The following performance results present both operation modes:

Performance:

Operation Mode CPU% GPU% FPS
0 (Default mode) 15.47 3.09 30
1 (Maximum performance) 10.93 2.23 30

Dual H264 Encoding from Camera

FILE_A=filenameA.mp4
FILE_B=filenameB.mp4
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! tee name=streams \
streams. ! nvv4l2h264enc bitrate=8000000 ! h264parse ! qtmux ! filesink location=$FILE_A \
streams. ! nvv4l2h264enc bitrate=8000000 ! h264parse ! qtmux ! filesink location=$FILE_B

Performance:

CPU 0 CPU 1 CPU 2 CPU 3 Average CPU GPU
14.27 12 15.36 12.18 13.45 2.14

H.265

OMX

H265 Encoding from camera

FILE=filename.mp4
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' \
! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420' ! omxh265enc bitrate=8000000 ! 'video/x-h265, stream-format=(string)byte-stream' ! h265parse ! qtmux ! filesink location=$FILE -e

Performance:

CPU 0 CPU 1 CPU 2 CPU 3 Average CPU GPU
15.22 11.5 13 14.38 13.5 1.6


Dual H265 Encoding from Camera

FILE_A=filenameA.mp4
FILE_B=filenameB.mp4
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' \
! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420' ! tee name=streams \
streams. ! omxh265enc bitrate=8000000 ! 'video/x-h265, stream-format=(string)byte-stream' ! h265parse ! qtmux ! filesink location=$FILE_A \
streams. ! omxh265enc bitrate=8000000 ! 'video/x-h265, stream-format=(string)byte-stream' ! h265parse ! qtmux ! filesink location=$FILE_B

Performance:

CPU 0 CPU 1 CPU 2 CPU 3 Average CPU GPU
16.62 14.47 15.33 15.28 15.4 1.66


V4L2

H265 Encoding from Camera

FILE=filename.mp4
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' \
! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=$FILE -e

Performance:

CPU 0 CPU 1 CPU 2 CPU 3 Average CPU GPU
13.77 12.68 9.97 9.3 11.43 1.28


Dual H265 Encoding from Camera

FILE_A=filenameA.mp4
FILE_B=filenameB.mp4
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! tee name=streams \
streams. ! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=$FILE_A \
streams. ! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=$FILE_B

Performance:

CPU 0 CPU 1 CPU 2 CPU 3 Average CPU GPU
19.2 16.55 15.9 17.45 17.27 2

VP9

OMX

VP9 Encoding from Camera

FILE=filename.mkv
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' \
! nvvidconv ! 'video/x-raw(memory:NVMM), format=(string)I420' ! omxvp9enc ! matroskamux ! filesink location=$FILE -e

Performance:

CPU 0 CPU 1 CPU 2 CPU 3 Average CPU GPU
15 13 11.93 13.43 13.34 3.12


V4L2

VP9 Encoding from Camera

FILE=filename.mkv
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' \
! nvv4l2vp9enc bitrate=8000000 ! matroskamux ! filesink location=$FILE -e

Performance:

CPU 0 CPU 1 CPU 2 CPU 3 Average CPU GPU
16.37 13.27 11.86 14.86 14.09 1.31


  Index