diff options
author | Paul B Mahol <onemda@gmail.com> | 2023-05-27 20:52:00 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2023-05-28 12:23:11 +0200 |
commit | e53260c1f4ce478943ad0d1ec1ca29a55024ae8a (patch) | |
tree | 9a139282474148fc3d11a7c1d4c474ff3bd08b38 /libavfilter/af_silenceremove.c | |
parent | 163e3a299e1cc06f0f871d8140def974757e4a7d (diff) | |
download | ffmpeg-e53260c1f4ce478943ad0d1ec1ca29a55024ae8a.tar.gz |
avfilter/af_silenceremove: add ptp detector
Diffstat (limited to 'libavfilter/af_silenceremove.c')
-rw-r--r-- | libavfilter/af_silenceremove.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c index 752a362203..46f28b4be7 100644 --- a/libavfilter/af_silenceremove.c +++ b/libavfilter/af_silenceremove.c @@ -37,6 +37,7 @@ enum SilenceDetect { D_RMS, D_PEAK, D_MEDIAN, + D_PTP, D_NB }; @@ -135,6 +136,7 @@ static const AVOption silenceremove_options[] = { { "rms", "use root mean squared values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_RMS}, 0, 0, AF, "detection" }, { "peak", "use max absolute values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_PEAK},0, 0, AF, "detection" }, { "median", "use median of absolute values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_MEDIAN},0, 0, AF, "detection" }, + { "ptp", "use absolute of max peak to min peak difference", 0, AV_OPT_TYPE_CONST, {.i64=D_PTP}, 0, 0, AF, "detection" }, { "window", "set duration of window for silence detection", OFFSET(window_duration_opt), AV_OPT_TYPE_DURATION, {.i64=20000}, 0, 100000000, AF }, { NULL } }; @@ -237,6 +239,10 @@ static int config_output(AVFilterLink *outlink) s->compute_flt = compute_avg_flt; s->compute_dbl = compute_avg_dbl; break; + case D_PTP: + s->compute_flt = compute_ptp_flt; + s->compute_dbl = compute_ptp_dbl; + break; case D_MEDIAN: s->compute_flt = compute_median_flt; s->compute_dbl = compute_median_dbl; |