| @@ -38,6 +38,7 @@ enum SilenceDetect { · 37 unmodified lines |
| 38 | D_PEAK, | 38 | D_PEAK, |
| 39 | D_MEDIAN, | 39 | D_MEDIAN, |
| 40 | D_PTP, | 40 | D_PTP, |
| | 41 | D_DEV, |
| 41 | D_NB | 42 | D_NB |
| 42 | }; | 43 | }; |
| 43 | | 44 | |
| @@ -146,6 +147,7 @@ static const AVOption silenceremove_options[] = { · 102 unmodified lines |
| 146 | { "peak", "use max absolute values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_PEAK},0, 0, AF, "detection" }, | 147 | { "peak", "use max absolute values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_PEAK},0, 0, AF, "detection" }, |
| 147 | { "median", "use median of absolute values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_MEDIAN},0, 0, AF, "detection" }, | 148 | { "median", "use median of absolute values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_MEDIAN},0, 0, AF, "detection" }, |
| 148 | { "ptp", "use absolute of max peak to min peak difference", 0, AV_OPT_TYPE_CONST, {.i64=D_PTP}, 0, 0, AF, "detection" }, | 149 | { "ptp", "use absolute of max peak to min peak difference", 0, AV_OPT_TYPE_CONST, {.i64=D_PTP}, 0, 0, AF, "detection" }, |
| | 150 | { "dev", "use standard deviation from values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_DEV}, 0, 0, AF, "detection" }, |
| 149 | { "window", "set duration of window for silence detection", OFFSET(window_duration_opt), AV_OPT_TYPE_DURATION, {.i64=20000}, 0, 100000000, AF }, | 151 | { "window", "set duration of window for silence detection", OFFSET(window_duration_opt), AV_OPT_TYPE_DURATION, {.i64=20000}, 0, 100000000, AF }, |
| 150 | { "timestamp", "set how every output frame timestamp is processed", OFFSET(timestamp_mode), AV_OPT_TYPE_INT, {.i64=TS_WRITE}, 0, TS_NB-1, AF, "timestamp" }, | 152 | { "timestamp", "set how every output frame timestamp is processed", OFFSET(timestamp_mode), AV_OPT_TYPE_INT, {.i64=TS_WRITE}, 0, TS_NB-1, AF, "timestamp" }, |
| 151 | { "write", "full timestamps rewrite, keep only the start time", 0, AV_OPT_TYPE_CONST, {.i64=TS_WRITE}, 0, 0, AF, "timestamp" }, | 153 | { "write", "full timestamps rewrite, keep only the start time", 0, AV_OPT_TYPE_CONST, {.i64=TS_WRITE}, 0, 0, AF, "timestamp" }, |
| @@ -230,6 +232,9 @@ static int config_output(AVFilterLink *outlink) · 78 unmodified lines |
| 230 | case D_RMS: | 232 | case D_RMS: |
| 231 | s->cache_size = 1; | 233 | s->cache_size = 1; |
| 232 | break; | 234 | break; |
| | 235 | case D_DEV: |
| | 236 | s->cache_size = 2; |
| | 237 | break; |
| 233 | case D_MEDIAN: | 238 | case D_MEDIAN: |
| 234 | case D_PEAK: | 239 | case D_PEAK: |
| 235 | case D_PTP: | 240 | case D_PTP: |
| @@ -263,6 +268,10 @@ static int config_output(AVFilterLink *outlink) · 27 unmodified lines |
| 263 | s->compute_flt = compute_avg_flt; | 268 | s->compute_flt = compute_avg_flt; |
| 264 | s->compute_dbl = compute_avg_dbl; | 269 | s->compute_dbl = compute_avg_dbl; |
| 265 | break; | 270 | break; |
| | 271 | case D_DEV: |
| | 272 | s->compute_flt = compute_dev_flt; |
| | 273 | s->compute_dbl = compute_dev_dbl; |
| | 274 | break; |
| 266 | case D_PTP: | 275 | case D_PTP: |
| 267 | s->compute_flt = compute_ptp_flt; | 276 | s->compute_flt = compute_ptp_flt; |
| 268 | s->compute_dbl = compute_ptp_dbl; | 277 | s->compute_dbl = compute_ptp_dbl; |