Nvjpegdec issues

Hi all,

I’m currently working on a custom gstreamer pipeline and port it over to python using pygobject. I have been testing different pipeline to get nvjpegdec working and it seems to only work in this particular way.

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! ‘image/jpeg,width=2560,height=720,framerate=60/1 ! videorate ! ‘image/jpeg,framerate=12/1’ ! nvjpegdec ! video/x-raw ! nvvidconv ! video/x-raw(memory:NVMM),format=BGRx ! nvvidconv ! video/x-raw ! appsink

Looking at gst-inspect-1.0 nvjpegdec, it should be able to output ‘video/x-raw,format=BGRx’ without having me to use nvvidconv, however it kept giving me Internal data stream error.

Any help would be appreciated.

You may try I420 format in NVMM memory:

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! image/jpeg,width=2560,height=720,framerate=60/1 ! videorate ! image/jpeg,framerate=12/1 ! nvjpegdec ! 'video/x-raw(memory:NVMM),format=I420' ! nvvidconv ! video/x-raw, format=BGRx ! videoconvert ! video/x-raw, format=BGR ! appsink

@Honey_Patouceul thanks!

But my current pipeline is kinda doing the same thing. I was hoping to skip the nvvidconv element all together and go from nvjpegdec to appsink to reduce the CPU usage as much as I possibly can.

nvvidconv doesn’t make much CPU usage, as it is using dedicated HW for conversion.
Your pipeline is making copies between NVMM and CPU memories which is not optimal.
Some CPU usage might be from videorate.

@Honey_Patouceul

I’m getting (nvbuf_utils: nvbuffer Payload Type not supported gst_nvvconv_transform: NvBufferGetParams Failed ) errors by setting memory:NVMM caps for nvjpegdec.

I’m using jetpack 4.4 atm.

If I do ! nvjpegdec ! video/x-raw ! videoconvert ! video/x-raw,format=BGR ’ the pipeline works but I’m getting just a black image. But looking at the sink and src for both the videoconvert and nvjpegdec element it should work/

Hi,
Please check if you see correct input in running the pipeline:

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! ‘image/jpeg,width=2560,height=720,framerate=60/1 ! videorate ! ‘image/jpeg,framerate=12/1’ ! nvv4l2decoder mjpeg=1 ! nvoverlaysink

If above pipeline runs well, please try

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! ‘image/jpeg,width=2560,height=720,framerate=60/1 ! videorate ! ‘image/jpeg,framerate=12/1’ ! nvv4l2decoder mjpeg=1 ! nvvidconv ! video/x-raw,format=BGRx ! appsink

I tried it and everything seems to be running but nvoverlaysink doesn’t pop up.

This is the output:
Setting pipeline to PAUSED …
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL …
Setting pipeline to PLAYING …
New clock: GstSystemClock
NvMMLiteOpen : Block : BlockType = 277
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 277

Hi,

Looks like it is appsink in this pipeline. Could you try the pipeline with nvoverlaysink?

Tried it with nvoverlaysink and it didn’t work as well

You would remove the quotes:

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! image/jpeg,width=2560,height=720,framerate=60/1 ! videorate ! image/jpeg,framerate=12/1 ! nvv4l2decoder mjpeg=1 ! nvvidconv ! video/x-raw,format=BGRx ! appsink

Hi,
Please also refer to


You should be able to launch with nvoverlaysink if width/height/format/framerate is configured correctly.

The device capture resolution and format is correct, my current pipeline as shown as the quote below works.

The pipeline you suggested using nvv4l2decoder didn’t work for me, there was no output from nvoverlaysink or xvimagesink after converting using nvvidconv. I’ve tried to get nvjpegdec sink to output video/x-raw(memory:NVMM) but I get an error saying Internal data stream error.

This seems like an element issue/ memory leak issue to me?

Hi,
The TV should not support the resolution 2560x720. Please try

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! ‘image/jpeg,width=2560,height=720,framerate=60/1 ! videorate ! ‘image/jpeg,framerate=12/1’ ! nvv4l2decoder mjpeg=1 ! nvvidconv ! 'video/x-raw(memory:NVMM),width=1280,height=360' ! nvoverlaysink