Encoder & EGL initialization failure running DeepStream Python RTSP sample on Jetson Orin Nano (7.1 / JetPack 6.2.1)

• Hardware Platform Jetson Orin Nano
• DeepStream Version 7.1
• JetPack Version 6.2.1
• Issue Type bug

When trying to run the deepstream-test1-rtsp-out Python sample inside a DeepStream 7.1 container, the pipeline fails to create the encoder and throws the following errors:

nvbufsurftransform: Could not get EGL display connection
Creating Pipeline 
 
Creating Source 
 
Creating H264Parser 

Creating Decoder 

/bin/bash: line 1: lsmod: command not found
/bin/bash: line 1: modprobe: command not found
Creating H264 Encoder
 Unable to create encoderTraceback (most recent call last):
  File "/opt/nvidia/deepstream/deepstream-7.1/sources/deepstream_python_apps/apps/deepstream-test1-rtsp-out/deepstream_test1_rtsp_out.py", line 343, in <module>
    sys.exit(main(sys.argv))
  File "/opt/nvidia/deepstream/deepstream-7.1/sources/deepstream_python_apps/apps/deepstream-test1-rtsp-out/deepstream_test1_rtsp_out.py", line 201, in main
    encoder.set_property('bitrate', bitrate)
AttributeError: 'NoneType' object has no attribute 'set_property'

How to Reproduce

  1. Run the DeepStream 7.1 Container
docker run -it \ --name saulcont \ --network=host \ --runtime=nvidia \ --privileged \ --device=/dev/video0 \ --device=/dev/video1 \ -e DISPLAY=$DISPLAY \ -w /opt/nvidia/deepstream/deepstream-7.1 \ -v /tmp/.X11-unix/:/tmp/.X11-unix \ nvcr.io/nvidia/deepstream:7.1-triton-multiarch
  1. Inside the docker container, install the Python bindings and sample apps:
/user_deepstream_python_apps_install.sh --version 1.2.0
  1. Run the RTSP out sample:
cd sources/deepstream_python_apps/apps/deepstream-test1-rtsp-out python3 deepstream_test1_rtsp_out.py -i VID.h264 -c H264 -e 0

Behavior

The encoder fails, causing the AttributeError due to encoder being None. The EGL display connection also fails to initialize.

Also is important to comment that Other DeepStream Python samples like deep stream-test1-usbcam work perfectly fine.

Any guidance on resolving the encoder creation failure or EGL initialization issue would be greatly appreciated. Currently I’m working with a display connected to the Jetson, but my objective is for it to work headless. Thanks

There is not hardware encoder in Orin Nano, please instead nvv4l2h264enc/nvv4l2h265enc with software encoder

For this sample, set the value of encoder parameters to 1( -c H264 -e 1)

# Create a caps filter
    caps = Gst.ElementFactory.make("capsfilter", "filter")
    if enc_type == 0:
        caps.set_property("caps", Gst.Caps.from_string("video/x-raw(memory:NVMM), format=I420"))
    else:
        caps.set_property("caps", Gst.Caps.from_string("video/x-raw, format=I420"))
    
    # Make the encoder
    if codec == "H264":
        if enc_type == 0:
            encoder = Gst.ElementFactory.make("nvv4l2h264enc", "encoder")
        else:
            encoder = Gst.ElementFactory.make("x264enc", "encoder")
        print("Creating H264 Encoder")
    elif codec == "H265":
        if enc_type == 0:
            encoder = Gst.ElementFactory.make("nvv4l2h265enc", "encoder")
        else:
            encoder = Gst.ElementFactory.make("x265enc", "encoder")
        print("Creating H265 Encoder")
    if not encoder:
        sys.stderr.write(" Unable to create encoder")

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.