|
|
|
@ -38,6 +38,7 @@ enum SilenceDetect { |
|
|
|
|
D_PEAK, |
|
|
|
|
D_MEDIAN, |
|
|
|
|
D_PTP, |
|
|
|
|
D_DEV, |
|
|
|
|
D_NB |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -146,6 +147,7 @@ static const AVOption silenceremove_options[] = { |
|
|
|
|
{ "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" }, |
|
|
|
|
{ "dev", "use standard deviation from values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_DEV}, 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 }, |
|
|
|
|
{ "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" }, |
|
|
|
|
{ "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) |
|
|
|
|
case D_RMS: |
|
|
|
|
s->cache_size = 1; |
|
|
|
|
break; |
|
|
|
|
case D_DEV: |
|
|
|
|
s->cache_size = 2; |
|
|
|
|
break; |
|
|
|
|
case D_MEDIAN: |
|
|
|
|
case D_PEAK: |
|
|
|
|
case D_PTP: |
|
|
|
@ -263,6 +268,10 @@ static int config_output(AVFilterLink *outlink) |
|
|
|
|
s->compute_flt = compute_avg_flt; |
|
|
|
|
s->compute_dbl = compute_avg_dbl; |
|
|
|
|
break; |
|
|
|
|
case D_DEV: |
|
|
|
|
s->compute_flt = compute_dev_flt; |
|
|
|
|
s->compute_dbl = compute_dev_dbl; |
|
|
|
|
break; |
|
|
|
|
case D_PTP: |
|
|
|
|
s->compute_flt = compute_ptp_flt; |
|
|
|
|
s->compute_dbl = compute_ptp_dbl; |
|
|
|
|