Nvjpegdec plugin throws exception when using with cv::imwrite

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU): GeForce RTX 3090
• DeepStream Version: 6.1
• TensorRT Version: 8.2
• NVIDIA GPU Driver Version (valid for GPU only): 510
• Issue Type( questions, new requirements, bugs): bug

This program results in Segmentation fault:

#include <stdlib.h>
#include <gst/gst.h> 

#include <opencv2/opencv.hpp>

int main(int argc, char *argv[])
    GstElement *nvjpegdec = NULL;
    /* Standard GStreamer initialization */
    gst_init(&argc, &argv);

    cv::Mat image(200, 200, CV_8UC3, cv::Scalar(255, 0, 0));
    cv::imwrite("some.jpg", image);
    nvjpegdec = gst_element_factory_make("nvjpegdec", "nvjpeg_decoder"); // throw exception

    return EXIT_SUCCESS;

The call stack:


• How to reproduce the issue ?


main.cpp (424 Bytes)

Build and run:

g++ -o main main.cpp `pkg-config --cflags gstreamer-1.0 opencv4` `pkg-config --libs gstreamer-1.0 opencv4`

How to I fix this?

The issue can be reproduced. We are checking this issue, will be back if there is any clue.

1 Like

It may take some time to resolve this issue. Can you try to use nvv4l2decoder to decode JPEG file instead of nvjpegdec.


1 Like