Correcting Video Levels

Marianna Smidth Buschle msb at qtec.com
Mon May 16 08:21:03 UTC 2022


I guess the main problem is that YUV generally defines the range as 16-235.
And so most of the available colorspaces have limited range quantization.

As far as I can see only the JPEG colorspace defines full range 
quantization:
https://www.kernel.org/doc/html/v4.10/media/uapi/v4l/pixfmt-007.html#colorspace-jpeg-v4l2-colorspace-jpeg

Perhaps you can see if it could be used.


Though is not the same issue I have previously run into a related 
problem with videoconvert:
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/868

Which might give some clues.


Otherwise you could make a simple contrast/intensity stretch filter to 
put the range back to 0-255 (and possibly fix the colorimetry CAPS as well).


On 14.05.2022 14.00, gstreamer-devel-request at lists.freedesktop.org wrote:
>> GStreamer team,
>>
>> I am capturing video using a BlackMagic Video device, sending out using a VP9
>> encoder, and then using a payloader for use with webRTC. When I view the
>> stream, my blacks and whites are mapped 16-235 instead of 0-255. Is there a
>> way to correct this? WIth ffmpeg, I can use a filter graph and and set the
>> input and output scale ?scale=in_range=limited:out_range=limited?.
> I don't think our converters current handle this, but the range is part of the
> colorimetry= filed in caps. Would be nice to fix this of course, range
> conversion seems pretty handy.
>
>> Thanks,
>>
>> Patrick

-- 
Best regards / Med venlig hilsen
“Marianna Smidth Buschle”
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20220516/7ec021db/attachment.htm>


More information about the gstreamer-devel mailing list