[FFmpeg-devel] [PATCH v2 08/11] vaapi_encode_mjpeg: Warn if input is not full range

Mark Thompson sw at jkqxz.net
Sun Feb 10 21:31:29 EET 2019

On 10/02/2019 18:49, Carl Eugen Hoyos wrote:
> 2019-02-10 19:21 GMT+01:00, Mark Thompson <sw at jkqxz.net>:
>> On 05/02/2019 13:27, Carl Eugen Hoyos wrote:
>>> 2019-01-28 0:47 GMT+01:00, Mark Thompson <sw at jkqxz.net>:
>>>> +    if (avctx->color_range == AVCOL_RANGE_MPEG) {
>>>> +        av_log(avctx, AV_LOG_WARNING, "Input video does not appear "
>>>> +               "to use full-range: output colours may be incorrect.\n");
>>> The wording seems not ideal to me:
>>> Are you not sure if the encoder will produce correct output for
>>> mpeg-range jpeg?
>>> That's how it sounds to me...
>> The problem is that, unlike H.264 and other codecs, JPEG has no way to
>> signal that the data are actually limited-range.  The encode will preserve
>> the values, but those values will not have the right interpretation at a
>> remote end which only looks at the JPEG data.  On the other hand, if
>> signalled by some out-of-band method (perhaps the container, or you control
>> both ends) everything is perfectly usable.
>> I agree the message isn't particularly clear; do you have any thoughts about
>> how it should be phrased?
> Can't you add the same COM tag as mjpegenc_common.c does?

Hmm, I had not really thought about that.  Do you know any reference for where this feature comes from and what might support it?

It was added as dd4f8a04 in 2005, but the motivation for the change isn't recorded.  Searching reveals little beyond references to the FFmpeg source code.


- Mark

More information about the ffmpeg-devel mailing list