NVIDIA-ISAAC-ROS / isaac_ros_compression

NVIDIA-accelerated data compression
https://developer.nvidia.com/isaac-ros-gems
Apache License 2.0
53 stars 7 forks source link

Failed to create encoder, missing /dev/nvhost-msenc #5

Closed dakejahl closed 11 months ago

dakejahl commented 12 months ago

I am trying to encode h264 using an imx219 on Jetson Orin Nano running 35.3.1 and Jetpack 5.1.1. I am starting the argus_camera node to interface with the camera.

ros2 launch isaac_ros_argus_camera isaac_ros_argus_camera_mono.launch.py

I then open another shell and try to launch the encoder and encounter this error

ros2 launch isaac_ros_h264_encoder isaac_ros_h264_encoder.launch.py input_width:=1920 input_height:=1080
...
[component_container-1] [ERROR] (/usr/src/jetson_multimedia_api/samples/common/classes/NvV4l2Element.cpp:63) <enc0> Could not open device '/dev/nvhost-msenc': No such file or directory
[component_container-1] [ERROR] (/usr/src/jetson_multimedia_api/samples/common/classes/NvV4l2ElementPlane.cpp:510) <enc0> Output Plane:Error in VIDIOC_REQBUFS at output plane: Bad file descriptor
[component_container-1] [ERROR] (/usr/src/jetson_multimedia_api/samples/common/classes/NvV4l2ElementPlane.cpp:510) <enc0> Capture Plane:Error in VIDIOC_REQBUFS at output plane: Bad file descriptor
[component_container-1] 2023-09-16 22:02:06.431 ERROR /workspaces/isaac_ros-dev/src/isaac_ros_compression/isaac_ros_h264_encoder/gxf/codec/components/encoder_request.cpp@535: Failed to create encoder
[component_container-1] 2023-09-16 22:02:06.431 WARN  gxf/std/multi_thread_scheduler.cpp@235: Error while executing entity E24 named 'OEBWZUABKE_encoder': GXF_FAILURE

As the error states I have no such file /dev/nvhost-msenc. Is it supposed to be there?

I noticed the note

The input image should be in rgb8 or bgr8 format, and it will be converted to nv12 format before being sent to the encoder.

However I am unsure if the isaac_ros_argus_camera node converts it already before publishing to /left/image_raw. The imx219 outputs in RG10 format. I even tried remapping the topic name since the encoder expects /image_raw but I still get the crash at Failed to create encoder

dakejahl commented 12 months ago

Ahhh I see this is because the Orin Nano does not have a hardware video encoder. Should I just use the gst-ros-bridge gstreamer plugin and create a gstreamer pipeline off of the ros2 topic /image_raw from argus_camera? What is the recommended way to integrate h264 compression and video streaming nicely with isaac_ros?

swapnesh-wani-nvidia commented 12 months ago

Hello, could you expand on your use case of using gstreamer with Isaac ROS? Orin Nano doesn't have a hardware encoder, hence isaac_ros_h264_encoder/decoder won't help here.

dakejahl commented 12 months ago

Hi thanks for the quick response. I am using a Jetson Orin Nano to test out vision applications on a drone such as vslam and vio. Additionally I want to stream one or more of the cameras over the network, ideally with an overlay of key points or object detection boxes. After more reading I ended up with this pipeline that uses the /image_raw topic to encode h264 and stream to the client:

gst-launch-1.0 --gst-plugin-path=install/gst_bridge/lib/gst_bridge/ rosimagesrc ros-topic="/image_raw" ! queue max-size-buffers=1 ! videoconvert ! "video/x-raw,format=I420" ! x264enc bitrate=2000 tune=zerolatency speed-preset=ultrafast ! "video/x-h264,stream-format=byte-stream" ! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.0.16 port=5600 sync=false

The original question boils down to is x264enc the best selection for performance. Without a hardware encoder my understanding is yes since this is just a software encoder element.