Encoder Compatibility Issue: Orin NX vs Orin Nano
Issue Overview
Users are experiencing compatibility issues when attempting to run a GStreamer pipeline for video recording and display on the Nvidia Jetson Orin Nano Dev board. The pipeline, which functions correctly on the Orin NX, fails to work on the Orin Nano. This issue specifically relates to video encoding capabilities, affecting users who are trying to record encoded video while simultaneously displaying it on screen.
The problem occurs during the execution of a GStreamer pipeline that includes hardware-accelerated H.264 encoding (nvv4l2h264enc). While this pipeline operates successfully on the Orin NX platform, it fails to function on the Orin Nano, indicating a potential hardware or software discrepancy between the two platforms.
Possible Causes
-
Hardware Differences: The primary cause of this issue is the fundamental hardware difference between the Orin NX and Orin Nano. The Orin Nano lacks dedicated hardware encoders for H.264, H.265, and AV1 codecs, which are present in the Orin NX.
-
Incompatible GStreamer Elements: The use of the
nvv4l2h264enc
element in the pipeline is not compatible with the Orin Nano’s hardware capabilities, leading to pipeline failure. -
Software Configuration: There might be differences in the software setup or driver configurations between the Orin NX and Orin Nano, although this is less likely given the identified hardware limitation.
Troubleshooting Steps, Solutions & Fixes
To resolve the encoder compatibility issue on the Orin Nano, follow these steps:
-
Use Software Encoding: Replace the hardware-accelerated H.264 encoder (nvv4l2h264enc) with a software-based encoder. The recommended solution is to use the
x264enc
element. -
Modify the GStreamer Pipeline: Adjust your GStreamer pipeline to accommodate the Orin Nano’s capabilities. Here’s the modified pipeline:
gst-launch-1.0 pylonsrc ! "video/x-raw(memory:NVMM), width=1920, height=1080" ! nvvidconv ! "video/x-raw(memory:NVMM), width=1920, height=1200" ! tee name=t t. ! queue ! nvegltransform ! nveglglessink sync=0 t. ! queue ! nvvidconv ! "video/x-raw, format=(string)I420" ! x264enc ! h264parse ! filesink location=video2.mp4 -e
Key changes in this pipeline:
- Replaced
nvv4l2h264enc
withx264enc
- Changed the video format from
NV24
toI420
- Removed the
profile=High444
parameter as it’s not applicable tox264enc
- Replaced
-
Verify GStreamer Installation: Ensure that you have the necessary GStreamer packages installed, including the x264 encoder plugin. You may need to install additional packages if they’re not already present:
sudo apt-get update sudo apt-get install gstreamer1.0-plugins-ugly
-
Check System Resources: Be aware that software encoding is more CPU-intensive than hardware encoding. Monitor your system’s CPU usage and temperature while running the pipeline to ensure stable operation.
-
Optimize Encoding Parameters: If you experience performance issues with software encoding, you can adjust the
x264enc
parameters to balance between quality and performance. For example:x264enc speed-preset=ultrafast tune=zerolatency
-
Consider Alternative Pipelines: If the performance of software encoding is insufficient for your needs, you may need to explore alternative solutions, such as:
- Using a different video format that doesn’t require encoding
- Implementing a custom encoding solution using CUDA or other GPU-accelerated libraries
- Exploring the use of other hardware-accelerated elements available on the Orin Nano
By implementing these changes, you should be able to successfully run the video recording and display pipeline on your Nvidia Jetson Orin Nano Dev board. Remember to test the modified pipeline thoroughly to ensure it meets your performance and quality requirements.