Problems with JPEG decoder Xavier Jetpack Version: 5.1.1-b56

in the multi-media sample NvJPegDecoder::decodeToBuffer() or NvJPegDecoder::decodeToFd(), am getting a pixelformat V4L2_PIX_FMT_YUV422RM. I cannot find a definition of this anywhere or how to decode it. Looking a the Nppi primitives for color-space conversion and I cannot find a corresponding function.

Also, if I use decodeToFd(), the resulting fd == -1.

Hi,
The supported formats of hardware JPEG decoder are listed in
Log in | NVIDIA Developer

Not sure which format your JPEG file is. Please attach it and we can check whether it is supported or not.

here are some jpegs I have been using for my tests.
256x256_color


200_200_32
64x64_color

Hi,
We can decode the images successfully by running 06_jpeg_decode sample. Decoded YUVs are in YUV420 and you can check it by running:

$ gst-launch-1.0 filesrc location= ~/a.yuv ! videoparse format=2 width=1920 height=1080 ! imagefreeze ! xvimagesink

Resolution of the images is different so please change width and height to fit the image.

hi,
how is g-streamer related to the nvidia 06-jpeg-decode sample?
thank you.

I find if I use the program jetson_multimedia_api/samples/06_jpeg_decode, that decodeToFd() does work, but decodeToBuffer() does not work. For example, this works:

./jpeg_decode num_files 1 /media/samsung/TimeLapseImager/src/tli/3rdParty/MImage/test/resources/jpeg/256x256_color.jpg /media/samsung/TimeLapseImager/src/tli/3rdParty/MImage/test/resources/jpeg/256x256_color.yuv

If I open the yuv file using YUVView, I see this:

But if I use decodeToBuffer(), as follows:
./jpeg_decode num_files 1 /media/samsung/TimeLapseImager/src/tli/3rdParty/MImage/test/resources/jpeg/256x256_color.jpg /media/samsung/TimeLapseImager/src/tli/3rdParty/MImage/test/resources/jpeg/256x256_color.yuv --decode-buffer

I see this in YUVView:

I found a case that does not work with both decodeToBuffer() and decodeToFd(), using the samples/06 program.

./jpeg_decode num_files 1 img_000000000_10x_brightlight_266.jpg img_000000000_10x_brightlight_266.yuv

Then the resulting yuv file looks like this in YUV:

as you can see, the scale is off.
image

Hi,
Certain files may fail to be decoded in calling decodeToFd and please call decodeToBuffer() in the case.

If you use nvjpegdec plugin in gstreamer, the gst-jpeg package is open source and you can take a look to check further.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.