Encode image from NvBufSurface to jpeg using nvJpeg

• Hardware Platform (Jetson / GPU) TX2
• DeepStream Version 5.0
• JetPack Version (valid for Jetson only) 4.4.1

I have a DS pipeline (deestream-test2 for example). I call osd_sink_pad_buffer_probe after nvdsosd plugin and get NvBufSurface in it. How can I encode NvBufSurface in jpeg using nvJpeg like cv::imencode(".jpeg", image, m_image, { cv::IMWRITE_JPEG_QUALITY, 100 }); and save it. Or are there any faster and more usable ways?

nvJpeg is not supported on Jetson platforms. Forencoding whole frame, we suggest use cv::imencode(). For encoding objects, you can use APIs in