[FFmpeg-cvslog] avfilter/af_silencedetect: document metadata

Limin Wang git at videolan.org
Mon Oct 21 07:58:13 EEST 2019


ffmpeg | branch: master | Limin Wang <lance.lmwang at gmail.com> | Tue Oct  8 23:04:51 2019 +0800| [0afc1fe1470094e84dfa4e25a7f1bb2d52fbb92c] | committer: Gyan Doshi

avfilter/af_silencedetect: document metadata

Reviewed-by: Moritz Barsnick <barsnick at gmx.net>
Signed-off-by: Limin Wang <lance.lmwang at gmail.com>

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

 doc/filters.texi               | 11 ++++++++++-
 libavfilter/af_silencedetect.c |  1 -
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index db4313da37..234d851e8c 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4683,7 +4683,16 @@ This filter logs a message when it detects that the input audio volume is less
 or equal to a noise tolerance value for a duration greater or equal to the
 minimum detected noise duration.
 
-The printed times and duration are expressed in seconds.
+The printed times and duration are expressed in seconds. The
+ at code{lavfi.silence_start} or @code{lavfi.silence_start.X} metadata key
+is set on the first frame whose timestamp equals or exceeds the detection
+duration and it contains the timestamp of the first frame of the silence.
+
+The @code{lavfi.silence_duration} or @code{lavfi.silence_duration.X}
+and @code{lavfi.silence_end} or @code{lavfi.silence_end.X} metadata
+keys are set on the first frame after the silence. If @option{mono} is
+enabled, and each channel is evaluated separately, the @code{.X}
+suffixed keys are used, and @code{X} corresponds to the channel number.
 
 The filter accepts the following options:
 
diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c
index 3a71f3902a..ed16f3dbb5 100644
--- a/libavfilter/af_silencedetect.c
+++ b/libavfilter/af_silencedetect.c
@@ -187,7 +187,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
     s->frame_end = insamples->pts + av_rescale_q(insamples->nb_samples,
             (AVRational){ 1, s->last_sample_rate }, inlink->time_base);
 
-    // TODO: document metadata
     s->silencedetect(s, insamples, nb_samples, nb_samples_notify,
                      inlink->time_base);
 



More information about the ffmpeg-cvslog mailing list