Nvvidconv changes color intensities on JP 5.1.2

We have a gstreamer pipeline that consumes RGBA frames (full range) and uses nvvidconv before outputting h264 encoded movies. The movies get significantly darker than the input frames.

A small demo pipeline to generate jpgs from a videotestsrc gradient:

# videoconvert
gst-launch-1.0 videotestsrc pattern=gradient ! 'video/x-raw,width=64,height=256,framerate=5/1,format=RGBA' ! videoconvert ! jpegenc ! multifilesink location=jpg_write/frame_%04d.jpg

# nvvidconv
gst-launch-1.0 -v videotestsrc pattern=gradient ! 'video/x-raw,width=64,height=256,framerate=5/1,format=RGBA' ! videoconvert ! nvvidconv ! 'video/x-raw(memory:NVMM),format=(string)NV12,colorimetry="1:3:0:0"' ! nvvidconv ! jpegenc quality=95 ! multifilesink location=jpg_nvvidconv_write/frame_%04d.jpg

Following this similar issue, we tried patching nvvidconv as suggested. However, with the patched 5.1.2 sources, the demo pipeline fails when setting the colorimetry:

ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason not-negotiated (-4)

We can get the extended range to work when we use the JP 6.1 sources as suggested in the other post. However, we then see a similar nonlineear curve (see image below). Additionally also using the patched libnvvic.so from the other post fixes the issue on the gradient:

However, when we use this setup (nvvidconv from JP6.1 sources + patched nvvic) to create the default videotestsrc, the image is still significantly darker when using nvvidconv (also when using interpolation-method=Nicest).

# videoconvert 
gst-launch-1.0 videotestsrc ! 'video/x-raw,width=1920,height=1080,framerate=5/1,format=RGBA' ! videoconvert ! jpegenc ! multifilesink location=jpg_write/frame_%04d.jpg

# nvvidconv 
gst-launch-1.0 -v videotestsrc ! 'video/x-raw,width=1920,height=1080,framerate=5/1,format=RGBA' ! videoconvert ! nvvidconv ! 'video/x-raw(memory:NVMM),format=(string)NV12,colorimetry="1:3:0:0"' ! nvvidconv ! jpegenc quality=95 ! multifilesink location=jpg_nvvidconv_write/frame_%04d.jpg

videoconvert

nvvidconv

Plotting the absolute intensity difference per pixel for the two images above (white being an absolute value difference of 20 or more, where we see differences that go much higher).



For us it is important to keep the color information across the full range. Are we missing something in our setup? Is thee an issue with nvvidconv or is this expected behavior?

Any help is appreciated!

Thanks a lot!

Nils

Turns out that the solution is simple: the second nvvidconv in the examples needs to specify a format that is full range, eg:

gst-launch-1.0 -v videotestsrc ! 'video/x-raw,width=1920,height=1080,framerate=5/1,format=RGBA' ! videoconvert ! nvvidconv ! 'video/x-raw(memory:NVMM),format=(string)NV12,colorimetry="1:3:0:0", interpolation-method=5' ! nvvidconv ! 'video/x-raw,format=BGRx' ! jpegenc quality=95 ! multifilesink location=jpg_nvvidconv_write/frame_%04d.jpg

works fine!

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