AGX Xavier: Gstreamer V4L2 nvhost-nvdec

Hi

I am having troubles with Gstreamer and the h264/5 encoding/decoding capabilities on the Jetson AGX Xavier platform.

Using following command to test if everything works

GST_DEBUG=3 gst-launch-1.0 -v videotestsrc pattern=smpte ! video/x-raw,width=1280,height=720 ! nvvidconv ! “video/x-raw(memory:NVMM),format=NV12” ! nvv4l2h264enc ! h264parse config-interval=1 ! nvv4l2decoder ! nvvidconv ! “video/x-raw(memory:NVMM)” ! nvdrmvideosink

Gives me an error:

Setting pipeline to PAUSED ...
0:00:00.107190048   504 0xaaaac1286870 WARN                    v4l2 v4l2_calls.c:651:gst_v4l2_open:<nvv4l2decoder0> error: Could not open device '/dev/nvhost-nvdec' for reading and writing.
0:00:00.107248672   504 0xaaaac1286870 WARN                    v4l2 v4l2_calls.c:651:gst_v4l2_open:<nvv4l2decoder0> error: system error: Cannot allocate memory
ERROR: from element /GstPipeline:pipeline0/nvv4l2decoder:nvv4l2decoder0: Could not open device '/dev/nvhost-nvdec' for reading and writing.
Additional debug info:
v4l2_calls.c(651): gst_v4l2_open (): /GstPipeline:pipeline0/nvv4l2decoder:nvv4l2decoder0:
system error: Cannot allocate memory
ERROR: pipeline doesn't want to preroll.
0:00:00.107509440   504 0xaaaac1286870 WARN            videodecoder gstvideodecoder.c:2910:gst_video_decoder_change_state:<nvv4l2decoder0> error: Failed to open decoder
ERROR: from element /GstPipeline:pipeline0/nvv4l2decoder:nvv4l2decoder0: Could not initialize supporting library.
Additional debug info:
../gst-libs/gst/video/gstvideodecoder.c(2910): gst_video_decoder_change_state (): /GstPipeline:pipeline0/nvv4l2decoder:nvv4l2decoder0:
Failed to open decoder
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...

I am using a custom filesystem with following setup:

  • a generic Gstreamer, version 1.20.4
  • a generic v4l2
  • the tegra and tegra-egl folder from the sample rootfilesystem (R35.1)
  • build my own gst-egl, gst-nvvidconv, nvdrmvideosink, nvvideosinks, libv4l2 and libv4lconvert, gst-nvvideo4linux2

Anything I am missing?
I use CUDA_VER 12.1

Thanks

Hi,
Please break down the pipeline and check if it works:

gst-launch-1.0 -v videotestsrc pattern=smpte is-live=1 ! video/x-raw,width=1280,height=720 ! nvvidconv ! "video/x-raw(memory:NVMM),format=NV12" ! nvv4l2h264enc ! fakesink

And please try the gstreamer command to use nvv4l2decoder only.

There is discussion in the topic and we would suggest use the default package. It is tested and shall be stable.

Hi

Got the same error using the Gstreamer pipeline.
Only it is now for the encoder and the /dev/nvhost-msenc file.

Also, I see another warning

venc gstnvenc.c:878:gst_nvenc_load_library: Could not open library libnvidia-encode.so.1, libnvidia-encode.so.1: cannot open shared object file: No such file or directory

But I can not find that library even in the sample rootfilesystem

Hi,
It looks like you are building the plugin for x86 PC. Please download the source code from L4T release page and follow README in each package to build the Jetson-platform plugin, such as nvv4l2h264enc

Hi

I got the sources links from the source_sync.sh script in the Sample rootfilesystem:
like: nv-tegra.nvidia.com/tegra/gst-src/gst-nvvideo4linux2.git
I use tag jetson_35.1
Or could this have something to do with the cuda toolkit?

I have the same error, and i cannot solve it

Hi,
Please flash latest Jetpack 5.1.2 and try again. It should work fine if you use default release. And for building the plugins from public source code, please build with gstreamer 1.16.3

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