From patchwork Mon Sep 30 13:36:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 15414 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 59BC5447DB9 for ; Mon, 30 Sep 2019 16:37:02 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4711A6897C0; Mon, 30 Sep 2019 16:37:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 126C668925F for ; Mon, 30 Sep 2019 16:36:56 +0300 (EEST) Received: by mail-pf1-f193.google.com with SMTP id v4so5636069pff.6 for ; Mon, 30 Sep 2019 06:36:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GdyJ01dew4E4rxir9JdC0lD9DCfwG34c7efNfnne5vU=; b=eMLV9zV2aSTGMgt6SSdAwNvCky16XL8X40E1rXG+gGLTFXp6Xh9Smc09s3LzTcbbii Sz4Lc8LXOxLi7jLWthTdhh4zQ1cQB6tYa1HtsWtnhLV0VfQ1/e57RD3/WKO23nCeLN7i YiuldYfp4rpvAPr7D89X2RwxynRhSzVxIs9L+nCj7cAGoJYSWpe/LtrAvFfBO+y7Bmoq DjMOcMdXiZGweI5u0NUT2L5hlgdUvGS6LAkKcikMQDmeROv4WcoNOBSDSfNe4X5vyT/v hV8NahUAyBfO2GsE4k5NnOXh8EAB6QT7EkRklEuqmjVhGD1PZbjnPFj3VZNK6hKC+KQc ZftQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GdyJ01dew4E4rxir9JdC0lD9DCfwG34c7efNfnne5vU=; b=ARhI0T0TlAjA/6bP52C053PRYIn5vGGQTrOcpF1VHhju0HL9BR9Lc66fwzsJ5tYmMe 4zgRizhzopU5YPZqhHrPY2NKDC5W6GGvui7b1ZKm/xsySd23krsXeHI0/Y07N3f345jj jilwZdgy1q4I0fuckupPyMCDlF0uyxLPGu68O6Ab17GhDoUZhh/tYkBK0MlPnAmY/Rz5 A0Fjl+KdbghuuMhkNHfneyp/t3cKe1PRNnmDrher2puWG12QNUnBx0Qk9OqXvmrD/oYI ETrFGBoy3ep5l3nK8Nyqs5c3pkq0FybxMin08A8rpC+9Mk5WvGDavAUXyNCs1JvszeAn 4bJQ== X-Gm-Message-State: APjAAAU+nuWpBsArNb+ScFrcaDTSqKbuYz+8jKlI0o3gUDIxzcI9oVb1 HQM2rrXgd+iVHYdM9r5jx5D+L+ys X-Google-Smtp-Source: APXvYqz4MTDhxu8gT29d11lzxjOfeoJScu92Rt+EJaGSpfnaZ+S42rxKOLobTBp2GVUUqF77VKvsgA== X-Received: by 2002:a17:90a:1090:: with SMTP id c16mr27211663pja.132.1569850614422; Mon, 30 Sep 2019 06:36:54 -0700 (PDT) Received: from vpn.localdomain ([47.90.99.151]) by smtp.gmail.com with ESMTPSA id x6sm20188809pfd.53.2019.09.30.06.36.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Sep 2019 06:36:53 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 30 Sep 2019 21:36:43 +0800 Message-Id: <20190930133647.6290-2-lance.lmwang@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190930133647.6290-1-lance.lmwang@gmail.com> References: <20190930133647.6290-1-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v1 2/6] avfilter/af_silencedetect: document metadata X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- doc/filters.texi | 10 +++++++++- libavfilter/af_silencedetect.c | 1 - 2 files changed, 9 insertions(+), 2 deletions(-) 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);