hi, there!
I’m trying to encode NV12 frame with nvjpeg without success. The closest thing I can get is to encode I420 frame, with code below:
nv_image.channel[0] = (unsigned char*)dptr;
nv_image.channel[1] = nv_image.channel[0] + 3840 * 2160;
nv_image.channel[2] = nv_image.channel[1] + 1920 * 1080;
nv_image.channel[3] = NULL;
nv_image.pitch[0] = 3840;
nv_image.pitch[1] = 1920;
nv_image.pitch[2] = 1920;
nv_image.pitch[3] = 0;
ret = nvjpegEncodeYUV(nv_handle, nv_enc_state, nv_enc_params,
&nv_image, NVJPEG_CSS_420, 3840, 2160, 0);
The result, of course, is a picture with wrong chroma.
Is there a way to encode NV12 directly? How? Or do I have to transform my NV12 frame to I420?
Thanks!