ffmpeg | branch: master | Paul B Mahol <one...@gmail.com> | Wed Nov 25 12:44:07 2015 +0100| [5b106215babec37dfb0b38efdff6d2c844adfe41] | committer: Paul B Mahol
avfilter/af_sidechaincompress: add forgotten option Signed-off-by: Paul B Mahol <one...@gmail.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b106215babec37dfb0b38efdff6d2c844adfe41 --- doc/filters.texi | 4 ++++ libavfilter/af_sidechaincompress.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/filters.texi b/doc/filters.texi index 25134fd..daa1b38 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -2383,6 +2383,10 @@ reduction. Default is @code{average}. @item detection Should the exact signal be taken in case of @code{peak} or an RMS one in case of @code{rms}. Default is @code{rms} which is mainly smoother. + +@item mix +How much to use compressed signal in output. Default is 1. +Range is between 0 and 1. @end table @subsection Examples diff --git a/libavfilter/af_sidechaincompress.c b/libavfilter/af_sidechaincompress.c index 29b3753..25f3fd1 100644 --- a/libavfilter/af_sidechaincompress.c +++ b/libavfilter/af_sidechaincompress.c @@ -44,6 +44,7 @@ typedef struct SidechainCompressContext { double ratio; double threshold; double makeup; + double mix; double thres; double knee; double knee_start; @@ -73,6 +74,7 @@ static const AVOption sidechaincompress_options[] = { { "detection", "set detection", OFFSET(detection), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, A|F, "detection" }, { "peak", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, A|F, "detection" }, { "rms", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, A|F, "detection" }, + { "mix", "set mix", OFFSET(mix), AV_OPT_TYPE_DOUBLE, {.dbl=1}, 0, 1, A|F }, { NULL } }; @@ -131,6 +133,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) AVFilterLink *sclink = ctx->inputs[1]; AVFilterLink *outlink = ctx->outputs[0]; const double makeup = s->makeup; + const double mix = s->mix; const double *scsrc; double *sample; int nb_samples; @@ -177,7 +180,7 @@ static int filter_frame(AVFilterLink *link, AVFrame *frame) s->compressed_knee_stop, s->detection); for (c = 0; c < outlink->channels; c++) - sample[c] *= gain * makeup; + sample[c] *= (gain * makeup * mix + (1. - mix)); sample += outlink->channels; scsrc += sclink->channels; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog