Jetson Nano/Gstreamer/Example Pipelines/Encoding: Difference between revisions
mNo edit summary |
|||
(33 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude> | <noinclude> | ||
{{JetsonNano/Head}} | {{JetsonNano/Head|previous=Gstreamer/Example_Pipelines/Capture_Display|next=Gstreamer/Example_Pipelines/Decoding|metakeywords=gstreamer,gstreamer pipelines,H264 Encoding,Dual H264 Encoding,OMX,V4L2,H265 Encoding,Dual H265 Encoding,VP8 Encoding,JPEG,jetson nano encoding|title=Jetson Nano GStreamer example pipelines for H264 H265 and VP8 Encoding|metadescription=This page has the tested gstreamer example pipelines for H264, H265 and VP8 Encoding on jetson nano platform }} | ||
</noinclude> | </noinclude> | ||
<!-------- | |||
{{DISPLAYTITLE:Jetson Nano- GStreamer Encoding Pipelines |noerror}} | {{DISPLAYTITLE:Jetson Nano- GStreamer Encoding Pipelines |noerror}} | ||
----> | |||
= | <table> | ||
<tr> | |||
<td><div class="clear; float:right">__TOC__</div></td> | |||
<td valign=top> | |||
{{GStreamer debug}} | |||
</td> | |||
</table> | |||
== | ==H.264== | ||
=== H264 Encoding from videotestsrc === | === OMX === | ||
==== H264 Encoding from videotestsrc ==== | |||
<pre style="background:#d6e4f1"> | <pre style="background:#d6e4f1"> | ||
FILE=filename.mp4 | FILE=filename.mp4 | ||
gst-launch-1.0 videotestsrc is-live=true ! | gst-launch-1.0 videotestsrc is-live=true ! video/x-raw, format=I420,width=1920, height=1080 ! omxh264enc ! qtmux ! filesink location=$FILE -e | ||
</pre> | </pre> | ||
=== H264 Encoding from camera === | ==== H264 Encoding from camera ==== | ||
<pre style="background:#d6e4f1"> | <pre style="background:#d6e4f1"> | ||
FILE=filename.mp4 | FILE=filename.mp4 | ||
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080,format=NV12, framerate=30/1' | gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080,format=NV12, framerate=30/1' ! omxh264enc ! qtmux ! filesink location=$FILE -e | ||
</pre> | </pre> | ||
=== Dual H264 Encoding from Camera === | |||
{| class="wikitable" style="color:black; background-color:#f6f6f6; margin: auto;" | |||
|+ align="top" style="caption-side: top" | Table. Performance results | |||
|- | |||
! Resolution | |||
! CPU% | |||
! FPS | |||
|- | |||
| 3280x2464 | |||
| 20% | |||
| 21 | |||
|- | |||
| 3280x1884 | |||
| 20% | |||
| 21 | |||
|- | |||
| 1080p | |||
| 23% | |||
| 30 | |||
|- | |||
| 720p | |||
| 28% | |||
| 58 | |||
|- | |||
| 720p | |||
| 37% | |||
| 116 | |||
|} | |||
==== Dual H264 Encoding from Camera ==== | |||
<pre style="background:#d6e4f1"> | <pre style="background:#d6e4f1"> | ||
FILE_A=filenameA.mp4 | FILE_A=filenameA.mp4 | ||
FILE_B=filenameB.mp4 | FILE_B=filenameB.mp4 | ||
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width= | |||
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! tee name=streams streams. ! queue ! omxh264enc bitrate=8000000 ! qtmux ! filesink location=$FILE_A streams. ! queue ! omxh264enc bitrate=8000000 ! qtmux ! filesink location=$FILE_B | |||
</pre> | </pre> | ||
==V4L2== | {| class="wikitable" style="color:black; background-color:#f6f6f6; margin: auto;" | ||
|+ align="top" style="caption-side: top" | Table. Performance results | |||
|- | |||
! Resolution | |||
! CPU% | |||
! FPS | |||
|- | |||
| 3280x2464 | |||
| 22% | |||
| 21 | |||
|- | |||
| 3280x1884 | |||
| 22% | |||
| 21 | |||
|- | |||
| 1080p | |||
| 24% | |||
| 30 | |||
|- | |||
| 720p | |||
| 30% | |||
| 58 | |||
|- | |||
| 720p | |||
| 37% | |||
| 117 | |||
|} | |||
===V4L2=== | |||
=== H264 Encoding from Camera === | ==== H264 Encoding from Camera ==== | ||
<pre style="background:#d6e4f1"> | <pre style="background:#d6e4f1"> | ||
FILE=filename.mp4 | FILE=filename.mp4 | ||
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width= | gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! nvv4l2h264enc bitrate=8000000 ! h264parse ! qtmux ! filesink location=$FILE | ||
</pre> | </pre> | ||
=== Dual H264 Encoding from Camera === | {| class="wikitable" style="color:black; background-color:#f6f6f6; margin: auto;" | ||
|+ align="top" style="caption-side: top" | Table. Performance results | |||
|- | |||
! Resolution | |||
! CPU% | |||
! FPS | |||
|- | |||
| 3280x2464 | |||
| 21% | |||
| 21 | |||
|- | |||
| 3280x1884 | |||
| 21% | |||
| 21 | |||
|- | |||
| 1080p | |||
| 23% | |||
| 30 | |||
|- | |||
| 720p | |||
| 28% | |||
| 58 | |||
|- | |||
| 720p | |||
| 37% | |||
| 116 | |||
|} | |||
==== Dual H264 Encoding from Camera ==== | |||
<pre style="background:#d6e4f1"> | <pre style="background:#d6e4f1"> | ||
FILE_A=filenameA.mp4 | FILE_A=filenameA.mp4 | ||
FILE_B=filenameB.mp4 | FILE_B=filenameB.mp4 | ||
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width= | gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! tee name=streams streams. ! queue ! nvv4l2h264enc bitrate=8000000 ! h264parse ! queue ! qtmux ! filesink location=$FILE_A streams. ! queue ! nvv4l2h264enc bitrate=8000000 ! h264parse ! queue ! qtmux ! filesink location=$FILE_B | ||
</pre> | </pre> | ||
= | {| class="wikitable" style="color:black; background-color:#f6f6f6; margin: auto;" | ||
|+ align="top" style="caption-side: top" | Table. Performance results | |||
|- | |||
! Resolution | |||
! CPU% | |||
! FPS | |||
|- | |||
| 3280x2464 | |||
| 13% | |||
| 21 | |||
|- | |||
| 3280x1884 | |||
| 12% | |||
| 21 | |||
|- | |||
| 1080p | |||
| 12% | |||
| 30 | |||
|- | |||
| 720p | |||
| 19% | |||
| 58 | |||
|- | |||
| 720p | |||
| 69% | |||
| 116 | |||
|} | |||
== | ==H.265== | ||
=== H265 Encoding from camera === | === OMX === | ||
==== H265 Encoding from camera ==== | |||
<pre style="background:#d6e4f1"> | <pre style="background:#d6e4f1"> | ||
FILE=filename.mp4 | FILE=filename.mp4 | ||
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080,format=NV12, framerate=30/1' | gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080,format=NV12, framerate=30/1' ! omxh265enc ! qtmux ! filesink location=$FILE -e | ||
</pre> | </pre> | ||
=== Dual H265 Encoding from Camera === | {| class="wikitable" style="color:black; background-color:#f6f6f6; margin: auto;" | ||
|+ align="top" style="caption-side: top" | Table. Performance results | |||
|- | |||
! Resolution | |||
! CPU% | |||
! FPS | |||
|- | |||
| 3280x2464 | |||
| 9% | |||
| 21 | |||
|- | |||
| 3280x1884 | |||
| 9% | |||
| 21 | |||
|- | |||
| 1080p | |||
| 10% | |||
| 30 | |||
|- | |||
| 720p | |||
| 17% | |||
| 58 | |||
|- | |||
| 720p | |||
| 33% | |||
| 116 | |||
|} | |||
==== Dual H265 Encoding from Camera ==== | |||
<pre style="background:#d6e4f1"> | <pre style="background:#d6e4f1"> | ||
FILE_A=filenameA.mp4 | FILE_A=filenameA.mp4 | ||
FILE_B=filenameB.mp4 | FILE_B=filenameB.mp4 | ||
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width= | gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! tee name=streams streams. ! queue ! omxh265enc bitrate=8000000 ! qtmux ! filesink location=$FILE_A streams. ! queue ! omxh265enc bitrate=8000000 ! qtmux ! filesink location=$FILE_B | ||
</pre> | </pre> | ||
== | {| class="wikitable" style="color:black; background-color:#f6f6f6; margin: auto;" | ||
|+ align="top" style="caption-side: top" | Table. Performance results | |||
|- | |||
! Resolution | |||
! CPU% | |||
! FPS | |||
|- | |||
| 3280x2464 | |||
| 9% | |||
| 21 | |||
|- | |||
| 3280x1884 | |||
| 9% | |||
| 21 | |||
|- | |||
| 1080p | |||
| 10% | |||
| 30 | |||
|- | |||
| 720p | |||
| 19% | |||
| 58 | |||
|- | |||
| 720p | |||
| 33% | |||
| 116 | |||
|} | |||
=== H265 Encoding from Camera === | ===V4L2=== | ||
==== H265 Encoding from Camera ==== | |||
<pre style="background:#d6e4f1"> | <pre style="background:#d6e4f1"> | ||
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=$FILE -e | |||
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width= | |||
</pre> | </pre> | ||
=== Dual H265 Encoding from Camera === | {| class="wikitable" style="color:black; background-color:#f6f6f6; margin: auto;" | ||
|+ align="top" style="caption-side: top" | Table. Performance results | |||
|- | |||
! Resolution | |||
! CPU% | |||
! FPS | |||
|- | |||
| 3280x2464 | |||
| 9% | |||
| 21 | |||
|- | |||
| 3280x1884 | |||
| 9% | |||
| 21 | |||
|- | |||
| 1080p | |||
| 10% | |||
| 30 | |||
|- | |||
| 720p | |||
| 19% | |||
| 58 | |||
|- | |||
| 720p | |||
| 34% | |||
| 116 | |||
|} | |||
==== Dual H265 Encoding from Camera ==== | |||
<pre style="background:#d6e4f1"> | <pre style="background:#d6e4f1"> | ||
FILE_A=filenameA.mp4 | FILE_A=filenameA.mp4 | ||
FILE_B=filenameB.mp4 | FILE_B=filenameB.mp4 | ||
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width= | gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! tee name=streams streams. ! queue ! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=$FILE_A streams. ! queue ! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=$FILE_B | ||
</pre> | </pre> | ||
= | {| class="wikitable" style="color:black; background-color:#f6f6f6; margin: auto;" | ||
|+ align="top" style="caption-side: top" | Table. Performance results | |||
|- | |||
! Resolution | |||
! CPU% | |||
! FPS | |||
|- | |||
| 3280x2464 | |||
| 11% | |||
| 21 | |||
|- | |||
| 3280x1884 | |||
| 12% | |||
| 21 | |||
|- | |||
| 1080p | |||
| 11% | |||
| 30 | |||
|- | |||
| 720p | |||
| 18% | |||
| 58 | |||
|- | |||
| 720p | |||
| 37% | |||
| 117 | |||
|} | |||
== | ==VP8== | ||
=== VP8 Encoding from Camera === | ===OMX=== | ||
==== VP8 Encoding from Camera ==== | |||
<pre style="background:#d6e4f1"> | <pre style="background:#d6e4f1"> | ||
FILE=filename.mkv | FILE=filename.mkv | ||
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width= | gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! omxvp8enc ! matroskamux ! filesink location=$FILE | ||
</pre> | </pre> | ||
== | {| class="wikitable" style="color:black; background-color:#f6f6f6; margin: auto;" | ||
|+ align="top" style="caption-side: top" | Table. Performance results | |||
|- | |||
! Resolution | |||
! CPU% | |||
! FPS | |||
|- | |||
| 3280x2464 | |||
| 9% | |||
| 21 | |||
|- | |||
| 3280x1884 | |||
| 9% | |||
| 21 | |||
|- | |||
| 1080p | |||
| 9% | |||
| 30 | |||
|- | |||
| 720p | |||
| 16% | |||
| 58 | |||
|- | |||
| 720p | |||
| 33% | |||
| 117 | |||
|} | |||
=== VP8 Encoding from Camera === | ===V4L2=== | ||
==== VP8 Encoding from Camera ==== | |||
<pre style="background:#d6e4f1"> | <pre style="background:#d6e4f1"> | ||
FILE=filename.mkv | FILE=filename.mkv | ||
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width= | gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! nvv4l2vp8enc bitrate=8000000 ! matroskamux ! filesink location=$FILE -e | ||
</pre> | </pre> | ||
{| class="wikitable" style="color:black; background-color:#f6f6f6; margin: auto;" | |||
|+ align="top" style="caption-side: top" | Table. Performance results | |||
|- | |||
! Resolution | |||
! CPU% | |||
! FPS | |||
|- | |||
| 3280x2464 | |||
| 9% | |||
| 21 | |||
|- | |||
| 3280x1884 | |||
| 9% | |||
| 21 | |||
|- | |||
| 1080p | |||
| 9% | |||
| 30 | |||
|- | |||
| 720p | |||
| 16% | |||
| 58 | |||
|- | |||
| 720p | |||
| 31% | |||
| 116 | |||
|} | |||
==JPEG== | |||
<pre style="background:#d6e4f1"> | |||
gst-launch-1.0 nvarguscamerasrc num-buffers=1 ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12' ! nvjpegenc ! filesink location=test.jpg | |||
</pre> | |||
<noinclude> | <noinclude> | ||
{{JetsonNano/Foot| | {{JetsonNano/Foot|Gstreamer/Example_Pipelines/Capture_Display|Gstreamer/Example_Pipelines/Decoding}} | ||
</noinclude> | </noinclude> |
Latest revision as of 11:01, 10 February 2023
NVIDIA®Jetson Nano™ | |||
---|---|---|---|
Introduction | |||
|
|||
Development | |||
|
|||
GStreamer | |||
|
|||
Contact Us |
|
H.264
OMX
H264 Encoding from videotestsrc
FILE=filename.mp4 gst-launch-1.0 videotestsrc is-live=true ! video/x-raw, format=I420,width=1920, height=1080 ! omxh264enc ! qtmux ! filesink location=$FILE -e
H264 Encoding from camera
FILE=filename.mp4 gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080,format=NV12, framerate=30/1' ! omxh264enc ! qtmux ! filesink location=$FILE -e
Resolution | CPU% | FPS |
---|---|---|
3280x2464 | 20% | 21 |
3280x1884 | 20% | 21 |
1080p | 23% | 30 |
720p | 28% | 58 |
720p | 37% | 116 |
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=1920, height=1080, format=NV12, framerate=30/1' ! tee name=streams streams. ! queue ! omxh264enc bitrate=8000000 ! qtmux ! filesink location=$FILE_A streams. ! queue ! omxh264enc bitrate=8000000 ! qtmux ! filesink location=$FILE_B
Resolution | CPU% | FPS |
---|---|---|
3280x2464 | 22% | 21 |
3280x1884 | 22% | 21 |
1080p | 24% | 30 |
720p | 30% | 58 |
720p | 37% | 117 |
V4L2
H264 Encoding from Camera
FILE=filename.mp4 gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! nvv4l2h264enc bitrate=8000000 ! h264parse ! qtmux ! filesink location=$FILE
Resolution | CPU% | FPS |
---|---|---|
3280x2464 | 21% | 21 |
3280x1884 | 21% | 21 |
1080p | 23% | 30 |
720p | 28% | 58 |
720p | 37% | 116 |
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=1920, height=1080, format=NV12, framerate=30/1' ! tee name=streams streams. ! queue ! nvv4l2h264enc bitrate=8000000 ! h264parse ! queue ! qtmux ! filesink location=$FILE_A streams. ! queue ! nvv4l2h264enc bitrate=8000000 ! h264parse ! queue ! qtmux ! filesink location=$FILE_B
Resolution | CPU% | FPS |
---|---|---|
3280x2464 | 13% | 21 |
3280x1884 | 12% | 21 |
1080p | 12% | 30 |
720p | 19% | 58 |
720p | 69% | 116 |
H.265
OMX
H265 Encoding from camera
FILE=filename.mp4 gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080,format=NV12, framerate=30/1' ! omxh265enc ! qtmux ! filesink location=$FILE -e
Resolution | CPU% | FPS |
---|---|---|
3280x2464 | 9% | 21 |
3280x1884 | 9% | 21 |
1080p | 10% | 30 |
720p | 17% | 58 |
720p | 33% | 116 |
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=1920, height=1080, format=NV12, framerate=30/1' ! tee name=streams streams. ! queue ! omxh265enc bitrate=8000000 ! qtmux ! filesink location=$FILE_A streams. ! queue ! omxh265enc bitrate=8000000 ! qtmux ! filesink location=$FILE_B
Resolution | CPU% | FPS |
---|---|---|
3280x2464 | 9% | 21 |
3280x1884 | 9% | 21 |
1080p | 10% | 30 |
720p | 19% | 58 |
720p | 33% | 116 |
V4L2
H265 Encoding from Camera
gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=$FILE -e
Resolution | CPU% | FPS |
---|---|---|
3280x2464 | 9% | 21 |
3280x1884 | 9% | 21 |
1080p | 10% | 30 |
720p | 19% | 58 |
720p | 34% | 116 |
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=1920, height=1080, format=NV12, framerate=30/1' ! tee name=streams streams. ! queue ! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=$FILE_A streams. ! queue ! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=$FILE_B
Resolution | CPU% | FPS |
---|---|---|
3280x2464 | 11% | 21 |
3280x1884 | 12% | 21 |
1080p | 11% | 30 |
720p | 18% | 58 |
720p | 37% | 117 |
VP8
OMX
VP8 Encoding from Camera
FILE=filename.mkv gst-launch-1.0 -e nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! omxvp8enc ! matroskamux ! filesink location=$FILE
Resolution | CPU% | FPS |
---|---|---|
3280x2464 | 9% | 21 |
3280x1884 | 9% | 21 |
1080p | 9% | 30 |
720p | 16% | 58 |
720p | 33% | 117 |
V4L2
VP8 Encoding from Camera
FILE=filename.mkv gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! nvv4l2vp8enc bitrate=8000000 ! matroskamux ! filesink location=$FILE -e
Resolution | CPU% | FPS |
---|---|---|
3280x2464 | 9% | 21 |
3280x1884 | 9% | 21 |
1080p | 9% | 30 |
720p | 16% | 58 |
720p | 31% | 116 |
JPEG
gst-launch-1.0 nvarguscamerasrc num-buffers=1 ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12' ! nvjpegenc ! filesink location=test.jpg