From patchwork Tue Oct 8 15:04:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 15578 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 BA7E344AA62 for ; Tue, 8 Oct 2019 18:05:08 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 97EDA687FD4; Tue, 8 Oct 2019 18:05:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ACE9468098D for ; Tue, 8 Oct 2019 18:05:01 +0300 (EEST) Received: by mail-pg1-f196.google.com with SMTP id p30so8310002pgl.2 for ; Tue, 08 Oct 2019 08:05:01 -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=xv65xVm7bx011V+DpebTiGv7QISNe5q79ZZCEfipbG4=; b=SOLibKFtXXldJ/WTMmg/fXQk/DAiAZUR5vTZI7roqLVkQB8KmF39Sow76FjQVY/dM8 CquxBiphKVEJ18rILPDlei00SPDok7kJsGiEr7okmf4d2dDqCTal93SPLsUeafNWhTZR jgKUkIYbieF7abh8zjxF76cea+ke+E+F3WIxFhFvHulLZoHxJhvjVvPYi6DfbyLuusZi 82Bw/+51Iq9LFXCQzXRbPCYkURG9npIaVWB+XyN14WUwPwsFhgvDf8H/4swLeAfsshHX PwllVtTs8mWN0G440IVjjsbTVkY5Vh2SKcR4FXCIBjVQeak7JG6zMEY3gQWXorql8k0x uMeQ== 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=xv65xVm7bx011V+DpebTiGv7QISNe5q79ZZCEfipbG4=; b=Cb8pvgsSJMb0j0tl8nNxEnEFIl2NdrB/zGv5wrahsCuLqDa28bAtz84CItjgtufEvC vZcZjYN/OPnxGwHgIKKrZ5hpNI7XHMeO9ez7TmFeGodvgSwbNi7uEEbodm5p9/64Rr5K jsDzgZf5nGPrmJdmDktWmZ5YBu61n27/WivCl+HjIfonYF+961UCUKnfZmdXA+qOtSsc 3EO4Vu+OPrzJLa1LewBSLV5/gBz5jgETMK4RLy17XNQDmAqJPrWyslFCaaJwtj6qU8BC 9Sb2WWTXCGiDwP2hqweEzBxe9GBTO9VpLs/Ez8DlcUtQsPRAq46oJ7NUrIvM0S9QxuA5 fHBw== X-Gm-Message-State: APjAAAXc0IxP9l0WIOzTU1aJ7CM2+T0+Y4K7kdWSn/IRt9A0IEm27M8T tqSoyFwGNxfwohq8pAS4ioyYLsHY X-Google-Smtp-Source: APXvYqzJnSfNy5jV8uEe9sqi/u/YZJiG1P4E1Xx+ZvXLu2ZQCYFoN49JZOkuOgctmYQHC0GHi8CjfA== X-Received: by 2002:a17:90a:246c:: with SMTP id h99mr6030294pje.127.1570547099461; Tue, 08 Oct 2019 08:04:59 -0700 (PDT) Received: from vpn.localdomain ([47.90.99.151]) by smtp.gmail.com with ESMTPSA id 127sm23533880pfy.56.2019.10.08.08.04.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Oct 2019 08:04:58 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 8 Oct 2019 23:04:51 +0800 Message-Id: <20191008150453.30222-1-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 v3 1/3] 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 Reviewed-by: Moritz Barsnick Signed-off-by: Limin Wang --- 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);