summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-08-18 13:49:47 +0200
committerNicolas George <nicolas.george@normalesup.org>2012-08-19 11:37:05 +0200
commit5980e57cf9a08ca284bc1b5ffba2363f9eff8ca8 (patch)
treecea3e69adbf22603e660a5bb96dd6136fe2864e1 /doc
parent13b965ead48e7c82ac2cda08513a3be7fc97f33d (diff)
lavfi: add volumedetect filter.
Diffstat (limited to 'doc')
-rw-r--r--doc/filters.texi40
1 files changed, 40 insertions, 0 deletions
diff --git a/doc/filters.texi b/doc/filters.texi
index 5793100682..8847990eea 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -690,6 +690,46 @@ volume=-12dB
@end example
@end itemize
+@section volumedetect
+
+Detect the volume of the input video.
+
+The filter has no parameters. The input is not modified. Statistics about
+the volume will be printed in the log when the input stream end is reached.
+
+In particular it will show the mean volume (root mean square), maximum
+volume (on a per-sample basis), and the beginning of an histogram of the
+registered volume values (from the maximum value to a cumulated 1/1000 of
+the samples).
+
+All volumes are in decibels relative to the maximum PCM value.
+
+Here is an excerpt of the output:
+@example
+[Parsed_volumedetect_0 @ 0xa23120] mean_volume: -27 dB
+[Parsed_volumedetect_0 @ 0xa23120] max_volume: -4 dB
+[Parsed_volumedetect_0 @ 0xa23120] histogram_4db: 6
+[Parsed_volumedetect_0 @ 0xa23120] histogram_5db: 62
+[Parsed_volumedetect_0 @ 0xa23120] histogram_6db: 286
+[Parsed_volumedetect_0 @ 0xa23120] histogram_7db: 1042
+[Parsed_volumedetect_0 @ 0xa23120] histogram_8db: 2551
+[Parsed_volumedetect_0 @ 0xa23120] histogram_9db: 4609
+[Parsed_volumedetect_0 @ 0xa23120] histogram_10db: 8409
+@end example
+
+It means that:
+@itemize
+@item
+The mean square energy is approximately -27 dB, or 10^-2.7.
+@item
+The largest sample is at -4 dB, or more precisely between -4 dB and -5 dB.
+@item
+There are 6 samples at -4 dB, 62 at -5 dB, 286 at -6 dB, etc.
+@end itemize
+
+In other words, raising the volume by +4 dB does not cause any clipping,
+raising it by +5 dB causes clipping for 6 samples, etc.
+
@section asyncts
Synchronize audio data with timestamps by squeezing/stretching it and/or
dropping samples/adding silence when needed.