[FFmpeg-devel] [PATCH 3/3] lavfi/vf_libvmaf: add warning when color ranges differ
Chema Gonzalez
chema at berkeley.edu
Tue Apr 18 00:14:03 EEST 2023
Hi Kyle,
Thanks for your answer.
I couldn't find how to access the color range from the filter_frame
function. I checked other filters that access `AVFrame.color_range`,
and all of them do it in the filter_frame function, not in the
config_props one. This includes vf_blackdetect.c, vf_iccgen.c,
vf_libplacebo.c, vf_premultiply.c, vf_scale.c, and vf_scale_vaapi.c.
Thanks again,
-Chema
On Mon, Apr 17, 2023 at 12:09 PM Kyle Swanson <k at ylo.ph> wrote:
>
> Hi,
>
> I think the warning is probably OK, but maybe better to put it into config_input_ref along with the other input checks.
>
> On Sat, Apr 1, 2023 at 10:48 AM Chema Gonzalez <chemag at gmail.com> wrote:
>>
>> ---
>> libavfilter/vf_libvmaf.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c
>> index 2586f37d99..67f0d6a22f 100644
>> --- a/libavfilter/vf_libvmaf.c
>> +++ b/libavfilter/vf_libvmaf.c
>> @@ -141,6 +141,13 @@ static int do_vmaf(FFFrameSync *fs)
>> if (ctx->is_disabled || !ref)
>> return ff_filter_frame(ctx->outputs[0], dist);
>>
>> + if (dist->color_range != ref->color_range) {
>> + av_log(ctx, AV_LOG_WARNING, "distorted and reference "
>> + "frames use different color ranges (%s != %s)\n",
>> + av_color_range_name(dist->color_range),
>> + av_color_range_name(ref->color_range));
>> + }
>> +
>> err = copy_picture_data(ref, &pic_ref, s->bpc);
>> if (err) {
>> av_log(s, AV_LOG_ERROR, "problem during vmaf_picture_alloc.\n");
>> --
>> 2.39.2
>
>
> Thanks,
> Kyle
More information about the ffmpeg-devel
mailing list