From patchwork Mon Sep 30 15:20:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 15420 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 B1B4C44A38F for ; Mon, 30 Sep 2019 18:20:27 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9DAEB6897C0; Mon, 30 Sep 2019 18:20:27 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 68E9A6881D4 for ; Mon, 30 Sep 2019 18:20:20 +0300 (EEST) Received: by mail-pf1-f172.google.com with SMTP id q5so5783014pfg.13 for ; Mon, 30 Sep 2019 08:20:20 -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=ob93M8QD7lHMVT4umlUsAua4YuAHMVCOfM6iTU89BRllSnOJpTGULyrceeViNdweqM 6K0d3Tjs+hSxuMKTBVMS2MqXpOlogNf6CKV2VIpiUxBKWy7bR7C4youc41xIOgdNWI4h fwTrjQVUTvSTMMQzyZrSV1PYkEUNONfCsAuNMlV1/z0H0xYPYHZ2YvczCfVupDnbUliB mgB7opXyqKr6VyI1WEmMhdgo6vP9YSruf0qQ12JC1SyMXVgzbcJHnB+pb0M24UsEgktB kUF8kMN21eGUqWdJx6r1JH2wyzgzZWidIzX85jfPvGyNtAE79Ug5T1YXVhDOCCpsMokG Yb0w== 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=GiIFSdkvMfkdRlhvSYbL4wuRvn2WgpiPdiTeL0wko6XbSg+c64b4fcuo+CnCZs9XkM pDgp7VXgFENjMCuqT3PNYsX0D5h0jh5g2R3osR51AClO5M50rJI8Fi7ZnXkNL4mfM7bI GUg8YwEaik46fBZv3yyWlp3d9UguJO9WCyIa6W+lrqc5+KUGPBEJBYXq32e64DQ9yPVv Tu60u9KEf3pUTFbWBdswUzElYFPSMoZurrg4qXnQ2iXWGXbUDSlZsBY0bSOeP70Evv06 w+OyX+BzZi9FU/HGS1KK260ZOQLQbcamrizLvkOrNdKsUtBOqf5otOjdBw0LCOIkFbD9 +wpQ== X-Gm-Message-State: APjAAAUrcUvXgn54X4NeaXmnH9Kw0S16LvKP9HEDhle/x5Y2KnTbgMG4 0Np0neD3tY0l5g+PyzK/14xoMEjA X-Google-Smtp-Source: APXvYqxQIKuOdKaoLXHKT4eSx1uORbGydV0CArijtB26dSjVzn9GIYXLDh870knU4AoBW5GuS546gA== X-Received: by 2002:a17:90a:e28a:: with SMTP id d10mr25936363pjz.102.1569856818349; Mon, 30 Sep 2019 08:20:18 -0700 (PDT) Received: from vpn.localdomain ([47.90.99.151]) by smtp.gmail.com with ESMTPSA id o60sm14818344pje.21.2019.09.30.08.20.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Sep 2019 08:20:17 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 30 Sep 2019 23:20:07 +0800 Message-Id: <20190930152009.6804-2-lance.lmwang@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190930152009.6804-1-lance.lmwang@gmail.com> References: <20190930133647.6290-1-lance.lmwang@gmail.com> <20190930152009.6804-1-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v2 2/4] 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);