[FFmpeg-cvslog] doc/filters: clarify metadata and logging for blackdetect

Gyan Doshi git at videolan.org
Mon Apr 13 08:54:59 EEST 2020

ffmpeg | branch: master | Gyan Doshi <ffmpeg at gyani.pro> | Mon Apr 13 11:41:24 2020 +0530| [2e2fa2d6e64e0f87277c507ec9c0fee8eab98533] | committer: Gyan Doshi

doc/filters: clarify metadata and logging for blackdetect

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e2fa2d6e64e0f87277c507ec9c0fee8eab98533

 doc/filters.texi             | 19 ++++++++++++++-----
 libavfilter/vf_blackdetect.c |  1 -
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 3931d8d79e..a4f99ef376 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -6532,11 +6532,20 @@ Default is disabled.
 Detect video intervals that are (almost) completely black. Can be
 useful to detect chapter transitions, commercials, or invalid
-recordings. Output lines contains the time for the start, end and
-duration of the detected black interval expressed in seconds.
-In order to display the output lines, you need to set the loglevel at
-least to the AV_LOG_INFO value.
+The filter outputs its detection analysis to both the log as well as
+frame metadata. If a black segment of at least the specified minimum
+duration is found, a line with the start and end timestamps as well
+as duration is printed to the log with level @code{info}. In addition,
+a log line with level @code{debug} is printed per frame showing the
+black amount detected for that frame.
+The filter also attaches metadata to the first frame of a black
+segment with key @code{lavfi.black_start} and to the first frame
+after the black segment ends with key @code{lavfi.black_end}. The
+value is the frame's timestamp. This metadata is added regardless
+of the minimum duration specified.
 The filter accepts the following options:
diff --git a/libavfilter/vf_blackdetect.c b/libavfilter/vf_blackdetect.c
index 06ef9988d1..4b5d8ff561 100644
--- a/libavfilter/vf_blackdetect.c
+++ b/libavfilter/vf_blackdetect.c
@@ -136,7 +136,6 @@ static int request_frame(AVFilterLink *outlink)
     return ret;
-// TODO: document metadata
 static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
     AVFilterContext *ctx = inlink->dst;

More information about the ffmpeg-cvslog mailing list