[FFmpeg-devel] [PATCH 7/8] avfilter/vf_scale: tag output color space

Vittorio Giovara vittorio.giovara at gmail.com
Sat Oct 28 05:04:17 EEST 2023


On Fri, Oct 27, 2023 at 10:06 AM Niklas Haas <ffmpeg at haasn.xyz> wrote:

> From: Niklas Haas <git at haasn.dev>
>
> When using vf_scale to force a specific output color space, also tag
> this on the AVFrame. (Mirroring existing logic for output range)
> ---
>  libavfilter/vf_scale.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
> index 4a2f0bd1f1..d79d67c413 100644
> --- a/libavfilter/vf_scale.c
> +++ b/libavfilter/vf_scale.c
> @@ -821,6 +821,9 @@ scale:
>      out->width  = outlink->w;
>      out->height = outlink->h;
>      out->color_range = out_full ? AVCOL_RANGE_JPEG : AVCOL_RANGE_MPEG;
> +    if (scale->out_color_matrix >= 0 &&
> +        scale->out_color_matrix != AVCOL_SPC_UNSPECIFIED)
> +        out->colorspace = scale->out_color_matrix;
>

what about the other color properties?
-- 
Vittorio


More information about the ffmpeg-devel mailing list