diff options
author | Daniel Molkentin <daniel@molkentin.de> | 2018-10-09 15:32:53 +0300 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2018-10-10 20:26:33 +0300 |
commit | d95c5b003c04b33f212b43fe62bc1986eb41a11b (patch) | |
tree | 64b92abce1136526006198e9f32f7ff0f516e6f7 /libavfilter/f_ebur128.c | |
parent | f85fa100db7d359527bae2a7a6501fd3575846e5 (diff) |
libavfilter/ebur128: add target level option for EBUR128 visualization filter
Signed-off-by: Daniel Molkentin <daniel@molkentin.de>
Signed-off-by: Conrad Zelck <c.zelck@imail.de>
Diffstat (limited to 'libavfilter/f_ebur128.c')
-rw-r--r-- | libavfilter/f_ebur128.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c index a48d3629ce..dfccbff5ec 100644 --- a/libavfilter/f_ebur128.c +++ b/libavfilter/f_ebur128.c @@ -142,6 +142,7 @@ typedef struct EBUR128Context { int metadata; ///< whether or not to inject loudness results in frames int dual_mono; ///< whether or not to treat single channel input files as dual-mono double pan_law; ///< pan law value used to calculate dual-mono measurements + int target; ///< target level in LUFS used to set relative zero LU in visualization } EBUR128Context; enum { @@ -168,6 +169,7 @@ static const AVOption ebur128_options[] = { { "true", "enable true-peak mode", 0, AV_OPT_TYPE_CONST, {.i64 = PEAK_MODE_TRUE_PEAKS}, INT_MIN, INT_MAX, A|F, "mode" }, { "dualmono", "treat mono input files as dual-mono", OFFSET(dual_mono), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, A|F }, { "panlaw", "set a specific pan law for dual-mono files", OFFSET(pan_law), AV_OPT_TYPE_DOUBLE, {.dbl = -3.01029995663978}, -10.0, 0.0, A|F }, + { "target", "set a specific target level in LUFS (-23 to 0)", OFFSET(target), AV_OPT_TYPE_INT, {.i64 = -23}, -23, 0, V|F }, { NULL }, }; @@ -740,8 +742,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) int x, y, ret; uint8_t *p; - const int y_loudness_lu_graph = lu_to_y(ebur128, loudness_3000 + 23); - const int y_loudness_lu_gauge = lu_to_y(ebur128, loudness_400 + 23); + const int y_loudness_lu_graph = lu_to_y(ebur128, loudness_3000 - ebur128->target); + const int y_loudness_lu_gauge = lu_to_y(ebur128, loudness_400 - ebur128->target); /* draw the graph using the short-term loudness */ p = pic->data[0] + ebur128->graph.y*pic->linesize[0] + ebur128->graph.x*3; |