Hardware Encoder Unavailability on Nvidia Jetson Orin Nano
Issue Overview
Users attempting to set up a GStreamer RTSP server to stream H265 video captured from a USB camera on the Nvidia Jetson Orin Nano are encountering difficulties. The issue specifically arises when trying to use hardware-accelerated encoding (nvv4l2h265enc) in the GStreamer pipeline. While the setup works well on Jetson Xavier NX or Jetson AGX Orin, it fails on the Orin Nano or when using the AGX Orin to emulate Orin Nano.
The problem manifests as a "Service Unavailable (503)" error on the client side when attempting to connect to the RTSP stream. This issue occurs with Jetpack 5.1.1 installed on the Orin Nano.
Possible Causes
-
Hardware Limitation: The primary cause of this issue is a hardware constraint of the Orin Nano. Unlike other Jetson platforms, the Orin Nano does not have a hardware encoder.
-
Incorrect GStreamer Pipeline: The use of hardware-accelerated encoding elements (like nvv4l2h265enc) in the GStreamer pipeline is incompatible with the Orin Nano’s capabilities.
-
Software Configuration: While less likely, there could be issues with the software configuration or compatibility between the installed Jetpack version and the GStreamer elements being used.
Troubleshooting Steps, Solutions & Fixes
-
Use Software Encoder:
The primary solution is to switch from hardware-accelerated encoding to software encoding. Replace thenvv4l2h265enc
element in your GStreamer pipeline with a software encoder such asx265enc
. Here’s an example of a working pipeline:./test-launch "(v4l2src ! video/x-raw, width=(int)1280, height=(int)720 ! nvvidconv ! video/x-raw, format=I420 ! x265enc ! video/x-h265, stream-format=(string)byte-stream ! h265parse ! rtph265pay name=pay0 pt=96 )"
-
Verify GStreamer Installation:
Ensure that all necessary GStreamer plugins are correctly installed on your Orin Nano. You can check this by running:gst-inspect-1.0 x265enc
This command should display information about the x265enc plugin if it’s properly installed.
-
Check System Resources:
Software encoding is more CPU-intensive than hardware encoding. Monitor your system resources while running the RTSP server to ensure you’re not exceeding the Orin Nano’s capabilities:top
or
htop
-
Optimize Encoding Parameters:
If you experience performance issues with software encoding, try adjusting the encoding parameters to reduce CPU load. For example:./test-launch "(v4l2src ! video/x-raw, width=(int)1280, height=(int)720 ! nvvidconv ! video/x-raw, format=I420 ! x265enc speed-preset=ultrafast tune=zerolatency ! video/x-h265, stream-format=(string)byte-stream ! h265parse ! rtph265pay name=pay0 pt=96 )"
-
Consider Alternative Platforms:
If hardware-accelerated H265 encoding is crucial for your use case, consider using other Jetson platforms that support hardware encoding, such as the Jetson Xavier NX or Jetson AGX Orin. -
Stay Updated:
Keep your Jetpack and GStreamer installations up to date. While there are no immediate plans to add hardware encoding support to the Orin Nano, future software updates might improve software encoding performance or introduce new features. -
Explore Alternative Streaming Methods:
If RTSP streaming with H265 encoding is not performing adequately on the Orin Nano, consider exploring alternative streaming methods or codecs that might be less resource-intensive.
Remember that the Orin Nano’s lack of hardware encoding is a hardware constraint, and there are currently no plans to add this feature. Always consider your specific use case requirements when choosing a Jetson platform for your projects.