Nvarguscamerasrc full range NV12

Is it possible to get full range NV12 from nvarguscamerasrc and nvvidconv? It seems the NV12 format is always limited to 16-235. I’m using R32.5.0 on TX2.

gst-launch-1.0 -v
nvarguscamerasrc num-buffers=1 sensor-id=0 sensor-mode=0
gainrange=“1.000000 1.000000”
aelock=true
exposuretimerange=“5950000 5950000”
awblock=true
wbmode=0
tnr-mode=0
ee-mode=0
aeantibanding=0
! ‘video/x-raw(memory:NVMM),width=1712,height=1080,format=NV12’
! nvvidconv ! ‘video/x-raw,width=1712,height=1080,format=NV12’
! filesink location=frame.nv12

If I shine a light directly at the camera, the Y data within NV12 is limited 16-235 for RS32.5.
If I run the same command on RS32.4.3 with the light directly on the camera, the Y data within NV12 is full range 0-255.

It appears something has changed between RS32.4.3 and RS32.5.0 in either nvarguscamerasrc or nvvidconv that is applying “studio swing” limiting on the YUV data.

I would like a way to disable this and return to full range 0-255.

1 Like

I think the issue is actually with nvvidconv. It seems if I change gst_nvvconv_get_pix_fmt to return NvBufferColorFormat_NV12_ER I get the extended range.

//*pix_fmt = NvBufferColorFormat_NV12;
*pix_fmt = NvBufferColorFormat_NV12_ER;

Has that value changed between RS32.4.3 and RS32.5.0?

1 Like

Could you apply the patch from below link to try.

Hi ShaneCCC, thanks. I tried the libnvtvmr.so from that patch and it did not work. That issue was related to decoder. Does libnvtvmr.so affect nvvidconv as well? It did not have any effect for me.

Can you please answer my question from before about nvvidconv?

Thanks,
Cliff

Hi,
The default implementation is based on NvBufferColorFormat_NV12(bt601, limit range). If your source is in extension range, you would need to do customization. We have nvarguscamerasrc and nvvidconv open source in r32.5. Please download the package:
https://developer.nvidia.com/embedded/l4t/r32_release_v5.1/r32_release_v5.1/sources/t186/public_sources.tbz2