NvJpegEncoder color error

Hello. I was using NvJpegEncoder::EncodeFromBuffer to encode yuv to jpeg, and I found the result of jpeg is not right, here is the sample yuv and encode result from NvJpegEncoder.

my L4t info:
R35 (release), REVISION: 1.0, GCID: 31250864, BOARD: t186ref, EABI: aarch64, DATE: Thu Aug 11 03:40:29 UTC 2022

yuv file:(format: 420p,

size 1920x1080)
420.yuv (3.0 MB)

encode from NvJpegEncoder

encode from ffmpeg(command line: ffmpeg -pix_fmt yuv420p -s 1920x1080 -i ./420.yuv 420.jpeg)

1 Like

I found that the yuv pixel range that get from camera is [16,235].
Can NvJpegEncoder encode this type of image? Or i need to adjust the pixel range to [0. 255] by myself?

Hi,
Please try 05_jpeg_encode with default –encode-fd

        --encode-fd          Uses FD as input to encoder [DEFAULT]

It should support YUV420 in limited range [16,235] by default.

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