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

Michael Niedermayer michaelni at gmx.at
Mon Feb 11 20:18:09 EET 2019

On Sun, Feb 10, 2019 at 06:21:42PM +0000, Mark Thompson wrote:
> 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?

It might be worse than that.
assuming this code is used for mjpeg not just jpeg images then
IIRC some mjpeg variants in avi use the mpeg style not full range. But i might
misremember this is very long ago


Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190211/6d8eb1c1/attachment.sig>

More information about the ffmpeg-devel mailing list