Jetson Xavier NX GStreamer example pipelines for H264 H265 and VP9 Encoding
NVIDIA®Jetson Xavier NX™ | |||
---|---|---|---|
![]() | |||
Introduction | |||
|
|||
Development | |||
|
|||
GStreamer | |||
|
|||
RidgeRun Products | |||
|
|||
Contact Us |
|
![]() | Important Note: It is important to highlight that for all the below pipeline performance measurements the Jetson Xavier NX has the following power mode "NV Power Mode: MODE_15W_6CORE" and jetson_clocks binary was executed to set the board in maximum performance mode. |
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 |
---|---|---|
3264x2464 | 5.45% | 21 |
3264x1848 | 5.65% | 28 |
1080p | 5.7% | 30 |
720p | 9.85% | 58 |
720p | 18.8% | 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
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 |
---|---|---|
3264x2464 | 4.9% | 21 |
3264x1848 | 6% | 28 |
1080p | 5.9% | 30 |
720p | 10.6% | 58 |
720p | 21.4% | 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
H.265
OMX
H265 Encoding from videotestsrc
FILE=filename.mp4 gst-launch-1.0 videotestsrc is-live=true ! video/x-raw, format=I420,width=1920, height=1080 ! omxh265enc ! qtmux ! filesink location=$FILE -e
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 |
---|---|---|
3264x2464 | 4.35% | 21 |
3264x1848 | 6% | 28 |
1080p | 5.9% | 30 |
720p | 10% | 58 |
720p | 19.2% | 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
V4L2
H265 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' ! nvv4l2h265enc bitrate=8000000 ! h265parse ! qtmux ! filesink location=$FILE -e
Resolution | CPU% | FPS |
---|---|---|
3264x2464 | 4.6% | 21 |
3264x1848 | 5.9% | 28 |
1080p | 5.9% | 30 |
720p | 11.1% | 58 |
720p | 20.5% | 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
VP9
OMX
VP9 Encoding from videotestsrc
FILE=filename.mkv gst-launch-1.0 videotestsrc is-live=true ! video/x-raw, format=I420,width=1920, height=1080 ! omxvp9enc ! matroskamux ! filesink location=$FILE -e
VP9 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' ! omxvp9enc ! matroskamux ! filesink location=$FILE
Resolution | CPU% | FPS |
---|---|---|
3264x2464 | 4.3% | 21 |
3264x1848 | 5.5% | 28 |
1080p | 5.7% | 30 |
720p | 10.9% | 58 |
720p | 20% | 116 |
Dual VP9 Encoding from Camera
FILE_A=filenameA.mkv FILE_B=filenameB.mkv 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 ! omxvp9enc ! matroskamux ! filesink location=$FILE_A streams. ! queue ! omxvp9enc ! matroskamux ! filesink location=$FILE_B
V4L2
VP9 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' ! nvv4l2vp9enc bitrate=8000000 ! matroskamux ! filesink location=$FILE -e
Resolution | CPU% | FPS |
---|---|---|
3264x2464 | 4.6% | 21 |
3264x1848 | 6.3% | 28 |
1080p | 5.9% | 30 |
720p | 10.7% | 58 |
720p | 20.2% | 116 |
Dual VP9 Encoding from Camera
FILE_A=filenameA.mkv FILE_B=filenameB.mkv 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 ! nvv4l2vp9enc bitrate=8000000 ! matroskamux ! filesink location=$FILE_A streams. ! queue ! nvv4l2vp9enc bitrate=8000000 ! matroskamux ! filesink location=$FILE_B
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