Hello, I am working on a project where I would like to encode a raw RGB888 image to jpeg using GStreamer and Nvidia’s nvjpeg library. While I have gotten this to work with gstreamer’s software jpegenc element by passing in RGB raw video input, nvjpegenc seems to segfault with a “tvmrNvjpgJPEGEncoderRegisterYUVSurface 44: Surface type is not supported” when I attempt the same pipeline. For reference, the pipeline below is what I am attempting to use.
you would see it only supports YUV formats for color as input, so RGB wouldn’t be a good candidate. There may be a weakness here in gstreamer negociating caps between videoparse and nvjpegenc, I’m surprized if the pipeline started.
So you just need to convert into NV12 or I420:
# CPU conversion
gst-launch-1.0 filesrc location=test.rgb ! videoparse format=rgb height=1080 width=1920 ! videoconvert ! video/x-raw,format=I420 ! nvjpegenc ! filesink location=out.jpg
# CPU for RGB->RGBA then VIC for RGBA->I420 into NVMM memory
gst-launch-1.0 filesrc location=test.rgb ! videoparse format=rgb height=1080 width=1920 ! videoconvert ! video/x-raw,format=RGBA ! nvvidconv ! 'video/x-raw(memory:NVMM),format=I420' ! nvjpegenc ! filesink location=out.jpg