Issue with OBS NVENC Encoder on Jetson Orin NX (r36)

Hi everyone,

I’ve installed the NVENC plugin for OBS, but I’m encountering an error in the logs when I use the NVENC in OBS.

After searching the forums, I came across this thread:

The response there states that the Jetson platform does not support the libnvidia-encode.so library and that jetson_multimedia_api must be used instead. Is this truly the only way to resolve this issue?

Additionally, I would like to confirm: to invoke the jetson_multimedia_api on r36, do I need to use the /dev/v4l2-nvenc device node?

Thanks in advance!

*** Please note that this reply is generated by LLM automatically ***

The issue you’re encountering with the NVENC plugin in OBS on your Jetson Orin NX is due to the lack of support for the libnvidia-encode.so library on the Jetson platform. This library is typically used for hardware-accelerated video encoding on NVIDIA GPUs, but it’s not compatible with the Jetson series.

As mentioned in the thread you came across, the recommended solution is to use the jetsonmultimediaapi instead. This API is specifically designed for the Jetson platform and provides a set of tools and libraries for multimedia processing, including video encoding and decoding.

To use the jetsonmultimediaapi on your Jetson Orin NX, you’ll need to follow these steps:

  1. Install the Jetson Multimedia API: You can install the Jetson Multimedia API by running the following command:
sudo apt-get update
sudo apt-get install nvidia-l4t-jetson-multimedia-api

This will install the necessary packages for the Jetson Multimedia API. Samples are installed to /usr/src/jetson_multimedia_api

  1. Use the dev/v4l2-nvenc device node: To invoke the jetsonmultimediaapi on your Jetson Orin NX, you’ll need to use the dev/v4l2-nvenc device node. This device node is specifically designed for hardware-accelerated video encoding on the Jetson platform. Can refer to encoder_unit_sample

Here’s an example of how you can use the gst-launch-1.0 command to encode a video using the jetsonmultimediaapi:

gst-launch-1.0 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=<filename_h265.mp4> -e

This command uses the nvarguscamerasrc plugin to capture video from the camera, and then pipes it to the nvv4l2h265enc plugin for hardware-accelerated H.265 encoding. The encoded video is then saved to a file using the qtmux and filesink plugins.

In comparison to the libnvidia-encode.so library, the jetsonmultimediaapi provides a more comprehensive set of tools and libraries for multimedia processing on the Jetson platform. While the libnvidia-encode.so library is limited to hardware-accelerated video encoding, the jetsonmultimediaapi provides support for a wide range of multimedia processing tasks, including video encoding and decoding, image processing, and audio processing.

In summary, the jetsonmultimediaapi is the recommended solution for hardware-accelerated video encoding on the Jetson Orin NX, and it provides a more comprehensive set of tools and libraries for multimedia processing compared to the libnvidia-encode.so library.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Hi,
As suggested in previous comment, please use jetson_multimedia_api or gstreamer, to use hardware code on Orin NX.