[FFmpeg-cvslog] avfilter: let single output frame A->V filters set reasonable frame rate

Paul B Mahol git at videolan.org
Sun Apr 10 23:39:32 EEST 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Apr 10 22:39:12 2022 +0200| [6e45acd23b6b5062f548c2551b1a64cc268eb787] | committer: Paul B Mahol

avfilter: let single output frame A->V filters set reasonable frame rate

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

 libavfilter/avf_showspectrum.c | 2 ++
 libavfilter/avf_showwaves.c    | 7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 6b99fc9a8b..c99dabad87 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -1241,6 +1241,8 @@ static int config_output(AVFilterLink *outlink)
         int ret = av_parse_video_rate(&s->frame_rate, s->rate_str);
         if (ret < 0)
             return ret;
+    } else if (s->single_pic) {
+        s->frame_rate = av_make_q(1, 1);
     } else {
         s->frame_rate = s->auto_frame_rate;
     }
diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c
index f491277ce1..76399ab13d 100644
--- a/libavfilter/avf_showwaves.c
+++ b/libavfilter/avf_showwaves.c
@@ -437,8 +437,11 @@ static int config_output(AVFilterLink *outlink)
     outlink->h = showwaves->h;
     outlink->sample_aspect_ratio = (AVRational){1,1};
 
-    outlink->frame_rate = av_div_q((AVRational){inlink->sample_rate,showwaves->n},
-                                   (AVRational){showwaves->w,1});
+    if (showwaves->single_pic)
+        outlink->frame_rate = av_make_q(1, 1);
+    else
+        outlink->frame_rate = av_div_q((AVRational){inlink->sample_rate,showwaves->n},
+                                       (AVRational){showwaves->w,1});
 
     av_log(ctx, AV_LOG_VERBOSE, "s:%dx%d r:%f n:%d\n",
            showwaves->w, showwaves->h, av_q2d(outlink->frame_rate), showwaves->n);



More information about the ffmpeg-cvslog mailing list