X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fvf_vidstabdetect.c;h=fd7ff3be24b0e908a3364f3483ee97f088a31eb1;hb=95cb2127adcfc1e8a2c77470523ec72beae5c905;hp=63a178a0c2b5c16e52a7ec6ade8ee3546360d506;hpb=3895fce26ec7f6d2b1642f96ecaddede6521228e;p=ffmpeg diff --git a/libavfilter/vf_vidstabdetect.c b/libavfilter/vf_vidstabdetect.c index 63a178a0c2b..fd7ff3be24b 100644 --- a/libavfilter/vf_vidstabdetect.c +++ b/libavfilter/vf_vidstabdetect.c @@ -107,10 +107,11 @@ static int config_input(AVFilterLink *inlink) VSMotionDetect* md = &(s->md); VSFrameInfo fi; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); + int is_planar = desc->flags & AV_PIX_FMT_FLAG_PLANAR; vsFrameInfoInit(&fi, inlink->w, inlink->h, ff_av2vs_pixfmt(ctx, inlink->format)); - if (fi.bytesPerPixel != av_get_bits_per_pixel(desc)/8) { + if (!is_planar && fi.bytesPerPixel != av_get_bits_per_pixel(desc)/8) { av_log(ctx, AV_LOG_ERROR, "pixel-format error: wrong bits/per/pixel, please report a BUG"); return AVERROR(EINVAL); }