[FFmpeg-devel,v3,1/3] avfilter/af_silencedetect: document metadata

Submitted by lance.lmwang@gmail.com on Oct. 8, 2019, 3:04 p.m.

Details

Message ID 20191008150453.30222-1-lance.lmwang@gmail.com
State Accepted
Commit 0afc1fe1470094e84dfa4e25a7f1bb2d52fbb92c
Headers show

Commit Message

lance.lmwang@gmail.com Oct. 8, 2019, 3:04 p.m.
From: Limin Wang <lance.lmwang@gmail.com>

Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 doc/filters.texi               | 11 ++++++++++-
 libavfilter/af_silencedetect.c |  1 -
 2 files changed, 10 insertions(+), 2 deletions(-)

Comments

lance.lmwang@gmail.com Oct. 21, 2019, 12:47 a.m.
ping

On Tue, Oct 08, 2019 at 11:04:51PM +0800, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  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 c975777..9bd63de 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -4629,7 +4629,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
> +@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 3a71f39..ed16f3d 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);
>  
> -- 
> 2.9.5
>
Gyan Oct. 21, 2019, 5:01 a.m.
On 21-10-2019 06:17 AM, Limin Wang wrote:
>
> ping
Pushed as 0afc1fe1470094e84dfa4e25a7f1bb2d52fbb92c
>
> On Tue, Oct 08, 2019 at 11:04:51PM +0800, lance.lmwang@gmail.com wrote:
>> From: Limin Wang <lance.lmwang@gmail.com>
>>
>> Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
>> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
>> ---
>>   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 c975777..9bd63de 100644
>> --- a/doc/filters.texi
>> +++ b/doc/filters.texi
>> @@ -4629,7 +4629,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
>> +@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 3a71f39..ed16f3d 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);
>>   
>> -- 
>> 2.9.5
>>

Thanks,
Gyan
lance.lmwang@gmail.com Oct. 21, 2019, 7:58 a.m.
On Mon, Oct 21, 2019 at 10:31:06AM +0530, Gyan wrote:
> 
> 
> On 21-10-2019 06:17 AM, Limin Wang wrote:
> >
> >ping
> Pushed as 0afc1fe1470094e84dfa4e25a7f1bb2d52fbb92c

Gyan, thanks for the push, it's patchset, please help to check
whether the other 2 patchset can be merge also. thanks you.

> >
> >On Tue, Oct 08, 2019 at 11:04:51PM +0800, lance.lmwang@gmail.com wrote:
> >>From: Limin Wang <lance.lmwang@gmail.com>
> >>
> >>Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
> >>Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> >>---
> >>  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 c975777..9bd63de 100644
> >>--- a/doc/filters.texi
> >>+++ b/doc/filters.texi
> >>@@ -4629,7 +4629,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
> >>+@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 3a71f39..ed16f3d 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);
> >>-- 
> >>2.9.5
> >>
> 
> Thanks,
> Gyan
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Gyan Oct. 21, 2019, 10:16 a.m.
On 21-10-2019 01:28 PM, Limin Wang wrote:
> On Mon, Oct 21, 2019 at 10:31:06AM +0530, Gyan wrote:
>>
>> On 21-10-2019 06:17 AM, Limin Wang wrote:
>>> ping
>> Pushed as 0afc1fe1470094e84dfa4e25a7f1bb2d52fbb92c
> Gyan, thanks for the push, it's patchset, please help to check
> whether the other 2 patchset can be merge also. thanks you.

Pushed as

190f52ba3b16fd746886cb288a418db6afe9917e

and

9c3178808ddf95b33589cd3d6210cff0ed2e3c5e


Thanks,
Gyan

Patch hide | download patch | download mbox

diff --git a/doc/filters.texi b/doc/filters.texi
index c975777..9bd63de 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4629,7 +4629,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
+@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 3a71f39..ed16f3d 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);