Don't work nvjpeg* in gstreamer

On the tegra-ubuntu 3.10.40-grinch-21.3.4 don’t work nvjpegdec and nvjpegenc.

When you try to use the gst-inspect these messages appear:

ubuntu@tegra-ubuntu:~$ gst-inspect-0.10 nvjpegdec
Segmentation fault
ubuntu@tegra-ubuntu:~$ gst-inspect-0.10 nvjpegenc
JPEG parameter struct mismatch: library thinks size is 432, caller expects 488
ubuntu@tegra-ubuntu:~$ gst-inspect-1.0 nvjpegdec
Segmentation fault
ubuntu@tegra-ubuntu:~$ gst-inspect-1.0 nvjpegenc
JPEG parameter struct mismatch: library thinks size is 432, caller expects 488

Naturally, the construction pipeline with these components is also not work.
In what may be the cause of these errors?

This works on my machine, which isn’t using the Grinch kernel. Perhaps that or some other modifications to the system may have broken gst-inspect?

I tried to run on a standard kernel, 3.10.40-gc017b03. It does not work
This is not due gst-inspect. For example, gst-inspect jpegenc, works. gst-inspect nvjpegenc not working, gst-launch module also not works nvjpegenc

Maybe the gst-inspect is finding a wrong jpeg library? I think L4T provides one but also distros may provide another one. I don’t have a system here now locally to check.

You should be able to check to which one it links with the “ldd” command, if you find the full path to the nvjpegenc plugin (I think it might be /usr/lib/arm-something/gstreamer-1.0/something.so).

I find libnvgstjpeg.so in folder /usr/lib/arm-linux-gnueabihf/gstreamer-1.0

ldd ./libnvgstjpeg.so
libgstreamer-1.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgstreamer-1.0.so.0 (0xb6ed6000)
libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb6e0e000)
libgobject-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 (0xb6dd1000)
libgstvideo-1.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgstvideo-1.0.so.0 (0xb6d99000)
libjpeg.so => /usr/lib/arm-linux-gnueabihf/libjpeg.so (0xb6d5a000)
libgstbase-1.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgstbase-1.0.so.0 (0xb6d18000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6c30000)
libgmodule-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgmodule-2.0.so.0 (0xb6c25000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6bb9000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6bae000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6b93000)
/lib/ld-linux-armhf.so.3 (0xb6fba000)
libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb6b5a000)
libffi.so.6 => /usr/lib/arm-linux-gnueabihf/libffi.so.6 (0xb6b4c000)
liborc-0.4.so.0 => /usr/lib/arm-linux-gnueabihf/liborc-0.4.so.0 (0xb6af4000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6ad3000)

libjpeg.so indicates libjpeg.so.8.0.2. The size of the library 157720 bytes

also has libgstjpeg.so

ldd ./libgstjpeg.so
libgstbase-1.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgstbase-1.0.so.0 (0xb6ea2000)
libgstreamer-1.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgstreamer-1.0.so.0 (0xb6de9000)
libgobject-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgobject-2.0.so.0 (0xb6dac000)
libglib-2.0.so.0 => /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0xb6ce4000)
libgstvideo-1.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgstvideo-1.0.so.0 (0xb6cac000)
libjpeg.so.8 => /usr/lib/arm-linux-gnueabihf/libjpeg.so.8 (0xb6c6d000)
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6c51000)
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6b6a000)
/lib/ld-linux-armhf.so.3 (0xb6f0a000)
libgmodule-2.0.so.0 => /usr/lib/arm-linux-gnueabihf/libgmodule-2.0.so.0 (0xb6b5f000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6af3000)
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6ae8000)
libffi.so.6 => /usr/lib/arm-linux-gnueabihf/libffi.so.6 (0xb6ad9000)
libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3 (0xb6aa1000)
liborc-0.4.so.0 => /usr/lib/arm-linux-gnueabihf/liborc-0.4.so.0 (0xb6a49000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6a28000)

Problem in the library /usr/lib/arm-linux-gnueabihf/libjpeg.so.8.0.2. Gstreamer hopes that this address will be based on a special version of the library, but some packages are replaced by the library to its. The developers have promised to deal with the problem

As a workaround, you can try replacing this library the library /usr/lib/arm-linux-gnueabihf/tegra/libjpeg.so