[FFmpeg-devel] [PATCH 4/4] ffmpeg: pass decoded or filtered AVFrame to output stream initialization

Jan Ekström jeebjp at gmail.com
Tue Sep 15 19:21:45 EEST 2020


On Tue, Sep 15, 2020 at 5:28 PM Jan Ekström <jeebjp at gmail.com> wrote:
>
>
> Further looking into this, it seems to come from filtering (?) (diff attached)
>
> decoded AVFrame: 128x128, pix_fmt: rgba, range: pc
> while...
> AVFrame to be encoded: 128x128, pix_fmt: bgra, range: tv
>
> Jan

For the record, the culprit seems to be this piece of logic within
libavfilter/vf_scale.c:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavfilter/vf_scale.c;h=58eee967440657798f84383ec6f79e8a05c3ece0;hb=HEAD#l747

Only input has range defined, out_full never gets set to nonzero.
Thus,
out->color_range = out_full ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG
leads to AVCOL_RANGE_MPEG.

Jan


More information about the ffmpeg-devel mailing list