[FFmpeg-devel] [PATCH 4/8] lavfi/avf_aphasemeter: set frame durations

Anton Khirnov anton at khirnov.net
Wed Sep 28 12:21:28 EEST 2022


The filter is supposed to produce CFR output.
---
 libavfilter/avf_aphasemeter.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/avf_aphasemeter.c b/libavfilter/avf_aphasemeter.c
index 3501e62825..0f7692982c 100644
--- a/libavfilter/avf_aphasemeter.c
+++ b/libavfilter/avf_aphasemeter.c
@@ -327,6 +327,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
         AVFrame *clone;
 
         s->out->pts = in->pts;
+        s->out->duration = av_rescale_q(1, av_inv_q(outlink->frame_rate), outlink->time_base);
+
         clone = av_frame_clone(s->out);
         if (!clone)
             return AVERROR(ENOMEM);
-- 
2.35.1



More information about the ffmpeg-devel mailing list