[FFmpeg-user] deprecated pixel format used, make sure you did set range correctly

Cecil Westerhof Cecil at decebal.nl
Sun Jun 11 15:14:10 EEST 2023


Ferdi Scholten <ferdi at sttc-nlp.nl> writes:

> On 11-06-2023 12:52, Cecil Westerhof via ffmpeg-user wrote:
>> Michael Koch <astroelectronic at t-online.de> writes:
>>
>>> Am 11.06.2023 um 11:33 schrieb Cecil Westerhof via ffmpeg-user:
>>>> Ferdi Scholten <ferdi at sttc-nlp.nl> writes:
>>>>
>>>>> I make a slideshow of my pictures with:
>>>>>>        ffmpeg -y -i %04d.jpg -i
>>>>>> /home/cecil/Audio/YouTube/Symphony_No_5_by_Beethoven.mp3 -pix_fmt
>>>>>> yuv420p -vcodec libx264 -crf 26 -acodec libmp3lame -qscale:a 9 -preset
>>>>>> veryfast -vf
>>>>>> zoompan=d=3:fps=.333:s=1280x960,framerate=25:interp_start=0:interp_end=255:scene=100
>>>>>> huizeDoorn.mp4
>>>>>>
>>>>>> It looks OK, but I get a lot of the following messages:
>>>>>>        deprecated pixel format used, make sure you did set range correctly
>>>>>>
>>>>>> Am I doing something wrong? Should I be worried?
>>>>> No you are not doing anything wrong, the warning is displayed because
>>>>> the pixelformat of your input source (the jpeg file) uses a deprecated
>>>>> pixelformat with a different range for luma and chroma as your output
>>>>> pixelformat, this can lead to differences in color and/or brightness
>>>>>
>>>>> yuvj422p is the deprecated pixelformat used by your jpg files (range
>>>>> 0-255 for luma and chroma) 16 bpp
>>>>> yuv420p is the pixelformat of your output. (range 16-235 for luma and
>>>>> 16-240 for chroma) 12 bpp
>>>>>
>>>>> So three conversions need to be made here:
>>>>> yuv conversion from 4:2:2 to 4:2:0
>>>>> range conversion for y
>>>>> range conversion for uv
>>>>>
>>>>> The warning might disappear (not tested this so not sure about it) if
>>>>> you specify the pixelformat of your jpg file in your command as it is
>>>>> now being autodetected by ffmpeg and the autodetection might be
>>>>> wrong
>>>> How can I determine the pixel format of my jpeg files?
>>> ffprobe yourfile.jpg
>>> or
>>> ffmpeg -i yourfile.jpg
>> I already tried that and got this:
>> ffmpeg version 5.1.git-82278e8 Copyright (c) 2000-2023 the FFmpeg developers
>>    built with gcc 10 (Debian 10.2.1-6)
>>    configuration: --enable-gpl --enable-version3 --enable-libx264
>> --enable-libx265 --enable-libmp3lame --enable-libfontconfig
>> --enable-libfreetype --enable-libfribidi
>>    libavutil      58.  9.100 / 58.  9.100
>>    libavcodec     60. 14.101 / 60. 14.101
>>    libavformat    60.  5.100 / 60.  5.100
>>    libavdevice    60.  2.100 / 60.  2.100
>>    libavfilter     9.  8.101 /  9.  8.101
>>    libswscale      7.  2.100 /  7.  2.100
>>    libswresample   4. 11.100 /  4. 11.100
>>    libpostproc    57.  2.100 / 57.  2.100
>> Input #0, image2, from '0001.jpg':
>>    Duration: 00:00:00.04, start: 0.000000, bitrate: 53673 kb/s
>>    Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc,
>> bt470bg/unknown/unknown), 1280x960 [SAR 180:180 DAR 4:3], 25 fps, 25
>> tbr, 25 tbn
>>
>> But this is I think auto detected and could be wrong. (If I read the
>> reply of Ferdi correctly.)
>>
> Sometimes camera manufacturers diverge from standards, so check with the
> technical documantation of your camera (if available) to make sure! For 
> example the layout of the jpeg might adhere to the standard, but the
> manufacturer could have applied different ranges. This can result in 
> incorrect range conversions.
> But if your output looks okay, the input is likely detected correctly
> and the manufacturer did adhere to the (deprecated) standard.

The files I use are created with Image Magick convert. That changes
    Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 1280x960 [SAR 180:180 DAR 4:3], 25 fps, 25 tbr, 25 tbn

to
    Stream #0:0: Video: mjpeg (Progressive), yuvj420p(pc, bt470bg/unknown/unknown), 1280x960 [SAR 180:180 DAR 4:3], 25 fps, 25 tbr, 25 tbn

But I keep getting the warnings. Is there a way to let convert
generate files that does not let ffmpeg create warnings?

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof


More information about the ffmpeg-user mailing list