Using gstnv plugins with latest compiled gstreamer

I successfully compiled the latest gstreamer version 1.17.1 using gst-build repo.

What I did then:

  • copied the compiled nvidia plugins to the build folder:
    cp /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnv* /home/jetson/gst-build/build/subprojects/nvidia/gst/

  • exported this folder so the gstreamer would pick them up successfully:
    export GST_PLUGIN_PATH=/home/jetson/gst-build/build/subprojects/nvidia/gst:$GST_PLUGIN_PATH

  • I can see the plugins successfully loaded:

[gst-master] jetson@xavier:~/gst-build$ gst-inspect-1.0 |grep nv
nvarguscamerasrc:  nvarguscamerasrc: NvArgusCameraSrc
nveglstreamsrc:  nveglstreamsrc: nVidia EGL Stream
nvvideocuda:  videocuda: CUDA Post processor
nvvideosink:  nvvideosink: nVidia Video Sink
nvtee:  nvtee: NvTee
nvcompositor:  nvcompositor: NvCompositor
nvvidconv:  nvvidconv: NvVidConv Plugin
nvivafilter:  nvivafilter: NvIVAFilter Plugin
nvvideo4linux2:  nvv4l2decoder: NVIDIA v4l2 video decoder
nvvideo4linux2:  nvv4l2h264enc: V4L2 H.264 Encoder
nvvideo4linux2:  nvv4l2h265enc: V4L2 H.265 Encoder
nvvideo4linux2:  nvv4l2vp8enc: V4L2 VP8 Encoder
nvvideo4linux2:  nvv4l2vp9enc: V4L2 VP9 Encoder
nvdrmvideosink:  nvdrmvideosink: Nvidia Drm Video Sink
nvjpeg:  nvjpegenc: JPEG image encoder
nvjpeg:  nvjpegdec: JPEG image decoder
nveglglessink:  nveglglessink: EGL/GLES vout Sink
nvegltransform:  nvegltransform: NvEGLTransform
nvvideosinks:  nv3dsink: Nvidia 3D sink

but when running my pipeline I see the error described in this issue that was fixed in 1.17 version, and I can see that when not using any nvidia plugin, the error does not appear.

One maintainer of gstreamer mentioned the nvidia plugins might be linking to wrong so files, but I can’t seem to debug this on my own, can you please help or provide fresh compiled plugins for the latest gstreamer version?

More debug lines:

[gst-master] jetson@xavier:~/gst-build$ ldd /home/jetson/gst-build/build/subprojects/nvidia/gst/libgstnvarguscamerasrc.so |grep gst
	libgstbase-1.0.so.0 => /home/jetson/gst-build/build/subprojects/gstreamer/libs/gst/base/libgstbase-1.0.so.0 (0x0000007f9c6a9000)
	libgstreamer-1.0.so.0 => /home/jetson/gst-build/build/subprojects/gstreamer/gst/libgstreamer-1.0.so.0 (0x0000007f9c566000)
	libgstvideo-1.0.so.0 => /home/jetson/gst-build/build/subprojects/gst-plugins-base/gst-libs/gst/video/libgstvideo-1.0.so.0 (0x0000007f9c4b6000)
	liborc-0.4.so.0 => /home/jetson/gst-build/build/subprojects/orc/orc/liborc-0.4.so.0 (0x0000007f9bdb8000)
[gst-master] jetson@xavier:~/gst-build$ ldd /home/jetson/gst-build/build/subprojects/nvidia/gst/libgstnvvideo4linux2.so |grep gst
	libgstallocators-1.0.so.0 => /home/jetson/gst-build/build/subprojects/gst-plugins-base/gst-libs/gst/allocators/libgstallocators-1.0.so.0 (0x0000007f9c518000)
	libgstreamer-1.0.so.0 => /home/jetson/gst-build/build/subprojects/gstreamer/gst/libgstreamer-1.0.so.0 (0x0000007f9c3d5000)
	libgstvideo-1.0.so.0 => /home/jetson/gst-build/build/subprojects/gst-plugins-base/gst-libs/gst/video/libgstvideo-1.0.so.0 (0x0000007f9c325000)
	libgstbase-1.0.so.0 => /home/jetson/gst-build/build/subprojects/gstreamer/libs/gst/base/libgstbase-1.0.so.0 (0x0000007f9be00000)
	liborc-0.4.so.0 => /home/jetson/gst-build/build/subprojects/orc/orc/liborc-0.4.so.0 (0x0000007f9bd87000)
[gst-master] jetson@xavier:~/gst-build$
[gst-master] jetson@xavier:~/gst-build$ ldd /usr/lib/aarch64-linux-gnu/tegra/libnvdsbufferpool.so.1.0.0 |grep gst
	libgstreamer-1.0.so.0 => /home/jetson/gst-build/build/subprojects/gstreamer/gst/libgstreamer-1.0.so.0 (0x0000007f7ec00000)
	libgstvideo-1.0.so.0 => /home/jetson/gst-build/build/subprojects/gst-plugins-base/gst-libs/gst/video/libgstvideo-1.0.so.0 (0x0000007f7e9b1000)
	libgstbase-1.0.so.0 => /home/jetson/gst-build/build/subprojects/gstreamer/libs/gst/base/libgstbase-1.0.so.0 (0x0000007f7e5bb000)
	liborc-0.4.so.0 => /home/jetson/gst-build/build/subprojects/orc/orc/liborc-0.4.so.0 (0x0000007f7e542000)
[gst-master] jetson@xavier:~/gst-build$
[gst-master] jetson@xavier:~$ gst-launch-1.0 --version
gst-launch-1.0 version 1.17.1
GStreamer 1.17.1 (GIT)
Unknown package origin
[gst-master] jetson@xavier:~$
(python3:9099): GStreamer-CRITICAL **: 17:09:48.277: gst_buffer_resize_range: assertion 'bufmax >= bufoffs + offset + size' failed
0:00:11.153302337  9099     0x35533b20 WARN                 v4l2src gstv4l2src.c:1000:gst_v4l2src_create:<v4l2src0> lost frames detected: count = 1 - ts: 0:00:00.543372695

(python3:9099): GStreamer-CRITICAL **: 17:09:48.283: gst_buffer_resize_range: assertion 'bufmax >= bufoffs + offset + size' failed
0:00:11.174094664  9099     0x35534540 WARN          v4l2bufferpool gstv4l2bufferpool.c:1535:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:src> Driver should never set v4l2_buffer.field to ANY
(python3:9099): GStreamer-CRITICAL **: 17:09:48.332: gst_buffer_resize_range: assertion 'bufmax >= bufoffs + offset + size' failed
0:00:11.208306680  9099     0x35533b20 WARN          v4l2bufferpool gstv4l2bufferpool.c:1480:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:sink> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:11.208371257  9099     0x35533b20 WARN          v4l2bufferpool gstv4l2bufferpool.c:1480:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:sink> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0
0:00:11.208417306  9099     0x35533b20 WARN          v4l2bufferpool gstv4l2bufferpool.c:1480:gst_v4l2_buffer_pool_dqbuf:<nvv4l2h264enc0:pool:sink> V4L2 provided buffer has bytesused 0 which is too small to include data_offset 0

Hi,
We would suggest use default gstreamer 1.14.5, since NVIDIA plugins are built with this version and SQA tests are performed. Upgrading to later version may not work since the deviation in header file probably causes unknown issues.

We have build instrunctions in development guide. Please take a look and see if it helps your case.

The latest bug-fix release in the 1.14 series is 1.14.5 and was released on 29 May 2019.

This release is very old and webrtc plugin we need in our project does not work with that version, we’re not doing it just for fun…

So can you please change your strict policy about your product and either offer the plugin sources (which is impossible, I know) or provide compiled binaries for all new versions, since gstreamer is officially supported.

Thank you!