diff mbox

[FFmpeg-devel,v2,2/4] avfilter/af_silencedetect: document metadata

Message ID 20190930152009.6804-2-lance.lmwang@gmail.com
State New
Headers show

Commit Message

Lance Wang Sept. 30, 2019, 3:20 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 doc/filters.texi               | 10 +++++++++-
 libavfilter/af_silencedetect.c |  1 -
 2 files changed, 9 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/doc/filters.texi b/doc/filters.texi
index 333f502..697ec21 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4563,7 +4563,15 @@  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 @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. Where @code{X} is the channel number and .X is used
+if @option{mono} is enabled.
 
 The filter accepts the following options:
 
diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c
index c31109f..193d0fe 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);