Hello, I would like to know if someone managed to build a C++ project that uses NvJpegEncoder and NvJpegDecoder classes or other Jetson Multimedia API functions with cmake.
I was trying to do the OpenCV’s Videowriter with nvjpeg and the LD_PRELOAD=/usr/lib/aarch64-linux-gnu/tegra/libnvjpeg.so trick worked for me but it breaks some functions like imdecoder or imwrite. I am still undecided how to implement it. As far as I know there is the gstreamer or the Multimedia API way but I didn’t find any successful story and any insights on this would be welcomed.
Yes, that worked. However, I was wondering if that could be added on Cmake somehow without fiddling with the .bashrc file and potentially breaking something. If not, I was considering learning the Gstreamer API.
I tried using the Gstreamer API and passing the Mat pointer to gst_buffer_new_wrapped_full(). However, it also returns JPEG mismatch error when I use cv::imwrite or cv::videocapture function and GstElement *nvjpeg = gst_element_factory_make ("nvjpegenc", "jpegencoding"); on the same file so I ended doing what you advised me.