fei.xu
August 18, 2022, 9:52am
1
Hi,
In Xavier, I can use gstreamer’s nvjpegenc
as below without any problem.
gst_parse_launch(" some thing .... ! nvjpegenc ! ..."
I can use use VPI interface without any problem, like
vpiSubmitConvertImageFormat(stream, backend, imageBGRA, imageBGR, NULL);
But I can’t use them at the same time, I mean in the same application, compiled, linked together, the error message is:
JPEG parameter struct mismatch: library thinks size is 584, caller expects 728
then the application exits.
to avoid this error, I have to disable either one of them.
It’s similar to this issue, but that one is nvjpegenc & opencv (opencv is not suppored by nvidia), my issue is nvjpegenc and VPI, both are from nvidia.
I link my C++ software with opencv4.1.1 and g-streamer, when the c++ instruction
_jpegEncoder = gst_element_factory_make ("nvjpegenc", "jpegEncoder_0");
is executed, I got following error:
JPEG parameter struct mismatch: library thinks size is 584, caller expects 728.
I think the problem is located on the library libjpeg that now I use libjpeg.so.8 with new opencv. Before I was using libjpeg.so.6 with an older opencv. But I can’t find how I can make it works.
I tried something I’ve seen in …
You may try using LD_PRELOAD so that libnvjpeg is found before libjpeg:
LD_PRELOAD=/usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so ./your_app
If not working, a workaround would be to split the application into 2 processes, one using nvjpeg lib for encoding with nvjpegenc, and another one reading for using opencv or VPI such as:
Sender
gst-launch-1.0 videotestsrc ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! nvjpegenc ! image/jpeg,format=MJPG ! shmsink socket-path=jpg.sock
Receiver
gst-launch-1.0 shmsrc socket-path=jpg.sock ! jpegdec ! xvimagesink
system
Closed
September 7, 2022, 4:50am
5
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.