[FFmpeg-devel] [PATCH] avfilter/vf_pad: respect frame colorspace tag in RGB to YUV conversion

Leo Izen leo.izen at gmail.com
Mon Sep 4 14:21:45 EEST 2023


On 8/27/23 15:51, Leo Izen wrote:
> vf_pad calls ff_draw_init, which assumes BT.709 and TV range for its
> YUV matricies. Since the filter only accepts RGB inputs for the color
> argument, it needs to convert them to YUV for YUV input video, and it
> should respect the tagged colormatrix when doing such a conversion, but
> it does not. It can do this by calling ff_draw_init2, and this patch
> causes the filter to re-init when the first frame is received, as that
> is when that colormatrix tag becomes available.
> 
> If the filter is not initialized before the first frame, then an
> assertion will fail in avfilter.c when it does sanity checks on
> input/output dimensions, so the original initialization cannot be
> skipped.
> 
> Signed-off-by: Leo Izen <leo.izen at gmail.com>
> ---
>   libavfilter/vf_pad.c | 21 ++++++++++++++++-----
>   1 file changed, 16 insertions(+), 5 deletions(-)
> 

Bumping, thanks.

- Leo Izen (Traneptora)



More information about the ffmpeg-devel mailing list