[FFmpeg-cvslog] avfilter/vf_psnr,vf_ssim: add warning if different timebases are encountered

Paul B Mahol git at videolan.org
Fri Oct 25 23:08:33 EEST 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Oct 25 22:02:41 2019 +0200| [9e283aa24eca9d387e5fbc61230962cb18f3dc30] | committer: Paul B Mahol

avfilter/vf_psnr,vf_ssim: add warning if different timebases are encountered

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9e283aa24eca9d387e5fbc61230962cb18f3dc30
---

 libavfilter/vf_psnr.c | 8 ++++++++
 libavfilter/vf_ssim.c | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c
index 0675a17c5d..706561eacb 100644
--- a/libavfilter/vf_psnr.c
+++ b/libavfilter/vf_psnr.c
@@ -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;
 }
 
diff --git a/libavfilter/vf_ssim.c b/libavfilter/vf_ssim.c
index 4c957f41a3..c08fbcdcc2 100644
--- a/libavfilter/vf_ssim.c
+++ b/libavfilter/vf_ssim.c
@@ -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;
 }
 



More information about the ffmpeg-cvslog mailing list