Jetson TX2 Jetpack4.2+ GStreamer encoding pipelines
|
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 |