]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_psnr,vf_ssim: add warning if different timebases are encountered
authorPaul B Mahol <onemda@gmail.com>
Fri, 25 Oct 2019 20:02:41 +0000 (22:02 +0200)
committerPaul B Mahol <onemda@gmail.com>
Fri, 25 Oct 2019 20:02:41 +0000 (22:02 +0200)
libavfilter/vf_psnr.c
libavfilter/vf_ssim.c

index 0675a17c5dba8078cfdcb3d65b4c4ce0b23d711b..706561eacb58da64958c5c3414b82dcf87dd5103 100644 (file)
@@ -350,6 +350,14 @@ static int config_output(AVFilterLink *outlink)
     if ((ret = ff_framesync_configure(&s->fs)) < 0)
         return ret;
 
+    outlink->time_base = s->fs.time_base;
+
+    if (av_cmp_q(mainlink->time_base, outlink->time_base) &&
+        av_cmp_q(ctx->inputs[1]->time_base, outlink->time_base))
+        av_log(ctx, AV_LOG_WARNING, "not matching timebases found between first input: %d/%d and second input %d/%d, results may be incorrect!\n",
+               mainlink->time_base.num, mainlink->time_base.den,
+               ctx->inputs[1]->time_base.num, ctx->inputs[1]->time_base.den);
+
     return 0;
 }
 
index 4c957f41a3cb0afe1f160d7f4fbb4643279d4226..c08fbcdcc2323bead6ace2990779f7c17b1e709b 100644 (file)
@@ -443,6 +443,14 @@ static int config_output(AVFilterLink *outlink)
     if ((ret = ff_framesync_configure(&s->fs)) < 0)
         return ret;
 
+    outlink->time_base = s->fs.time_base;
+
+    if (av_cmp_q(mainlink->time_base, outlink->time_base) &&
+        av_cmp_q(ctx->inputs[1]->time_base, outlink->time_base))
+        av_log(ctx, AV_LOG_WARNING, "not matching timebases found between first input: %d/%d and second input %d/%d, results may be incorrect!\n",
+               mainlink->time_base.num, mainlink->time_base.den,
+               ctx->inputs[1]->time_base.num, ctx->inputs[1]->time_base.den);
+
     return 0;
 }