| @@ -38,6 +38,7 @@ enum SilenceDetect { · 37 unmodified lines |
| 38 | 38 | D_PEAK, |
| 39 | 39 | D_MEDIAN, |
| 40 | 40 | D_PTP, |
| 41 | + D_DEV, |
| 41 | 42 | D_NB |
| 42 | 43 | }; |
| 43 | 44 | |
| @@ -146,6 +147,7 @@ static const AVOption silenceremove_options[] = { · 102 unmodified lines |
| 146 | 147 | { "peak", "use max absolute values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_PEAK},0, 0, AF, "detection" }, |
| 147 | 148 | { "median", "use median of absolute values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_MEDIAN},0, 0, AF, "detection" }, |
| 148 | 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 | 151 | { "window", "set duration of window for silence detection", OFFSET(window_duration_opt), AV_OPT_TYPE_DURATION, {.i64=20000}, 0, 100000000, AF }, |
| 150 | 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 | 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 | 232 | case D_RMS: |
| 231 | 233 | s->cache_size = 1; |
| 232 | 234 | break; |
| 235 | + case D_DEV: |
| 236 | + s->cache_size = 2; |
| 237 | + break; |
| 233 | 238 | case D_MEDIAN: |
| 234 | 239 | case D_PEAK: |
| 235 | 240 | case D_PTP: |
| @@ -263,6 +268,10 @@ static int config_output(AVFilterLink *outlink) · 27 unmodified lines |
| 263 | 268 | s->compute_flt = compute_avg_flt; |
| 264 | 269 | s->compute_dbl = compute_avg_dbl; |
| 265 | 270 | break; |
| 271 | + case D_DEV: |
| 272 | + s->compute_flt = compute_dev_flt; |
| 273 | + s->compute_dbl = compute_dev_dbl; |
| 274 | + break; |
| 266 | 275 | case D_PTP: |
| 267 | 276 | s->compute_flt = compute_ptp_flt; |
| 268 | 277 | s->compute_dbl = compute_ptp_dbl; |