| @@ -6419,15 +6419,16 @@ trimming. Default is 0, which is equal to trimming all samples detected · 6418 unmodified lines |
| 6419 | as silence. | 6419 | as silence. |
| 6420 | | 6420 | |
| 6421 | @item start_mode | 6421 | @item start_mode |
| 6422 | Specify mode of detection of silence end in start of multi-channel audio. | 6422 | Specify mode of detection of silence end at start of multi-channel audio. |
| 6423 | Can be @var{any} or @var{all}. Default is @var{any}. | 6423 | Can be @var{any} or @var{all}. Default is @var{any}. |
| 6424 | With @var{any}, any sample that is detected as non-silence will cause | 6424 | With @var{any}, any sample from any channel that is detected as non-silence |
| 6425 | stopped trimming of silence. | 6425 | will trigger end of silence trimming at start of audio stream. |
| 6426 | With @var{all}, only if all channels are detected as non-silence will cause | 6426 | With @var{all}, only if every sample from every channel is detected as non-silence |
| 6427 | stopped trimming of silence. | 6427 | will trigger end of silence trimming at start of audio stream, limited usage. |
| 6428 | | 6428 | |
| 6429 | @item stop_periods | 6429 | @item stop_periods |
| 6430 | Set the count for trimming silence from the end of audio. | 6430 | Set the count for trimming silence from the end of audio. When specifying a |
| | 6431 | positive value, it trims audio after it finds specified silence period. |
| 6431 | To remove silence from the middle of a file, specify a @var{stop_periods} | 6432 | To remove silence from the middle of a file, specify a @var{stop_periods} |
| 6432 | that is negative. This value is then treated as a positive value and is | 6433 | that is negative. This value is then treated as a positive value and is |
| 6433 | used to indicate the effect should restart processing as specified by | 6434 | used to indicate the effect should restart processing as specified by |
| @@ -6453,20 +6454,34 @@ trimming. Default is 0, which is equal to trimming all samples detected · 19 unmodified lines |
| 6453 | as silence. | 6454 | as silence. |
| 6454 | | 6455 | |
| 6455 | @item stop_mode | 6456 | @item stop_mode |
| 6456 | Specify mode of detection of silence start in end of multi-channel audio. | 6457 | Specify mode of detection of silence start after start of multi-channel audio. |
| 6457 | Can be @var{any} or @var{all}. Default is @var{any}. | 6458 | Can be @var{any} or @var{all}. Default is @var{all}. |
| 6458 | With @var{any}, any sample that is detected as non-silence will cause | 6459 | With @var{any}, any sample from any channel that is detected as silence |
| 6459 | stopped trimming of silence. | 6460 | will trigger start of silence trimming after start of audio stream, limited usage. |
| 6460 | With @var{all}, only if all channels are detected as non-silence will cause | 6461 | With @var{all}, only if every sample from every channel is detected as silence |
| 6461 | stopped trimming of silence. | 6462 | will trigger start of silence trimming after start of audio stream. |
| 6462 | | 6463 | |
| 6463 | @item detection | 6464 | @item detection |
| 6464 | Set how is silence detected. Can be @code{avg}, @code{rms}, @code{median} or @code{peak}. | 6465 | Set how is silence detected. |
| | 6466 | @table @option |
| | 6467 | @item avg |
| | 6468 | Mean of absolute values of samples in moving window. |
| | 6469 | @item rms |
| | 6470 | Root squared mean of absolute values of samples in moving window. |
| | 6471 | @item peak |
| | 6472 | Maximum of absolute values of samples in moving window. |
| | 6473 | @item median |
| | 6474 | Median of absolute values of samples in moving window. |
| | 6475 | @end table |
| 6465 | Default value is @code{rms}. | 6476 | Default value is @code{rms}. |
| 6466 | | 6477 | |
| 6467 | @item window | 6478 | @item window |
| 6468 | Set duration in number of seconds used to calculate size of window in number | 6479 | Set duration in number of seconds used to calculate size of window in number |
| 6469 | of samples for detecting silence. | 6480 | of samples for detecting silence. Using @code{0} will effectively disable |
| | 6481 | any windowing and use only single sample per channel for silence detection. |
| | 6482 | In that case it may be needed to also set @option{start_silence} and/or |
| | 6483 | @option{stop_silence} to nonzero values with also @option{start_duration} and/or |
| | 6484 | @option{stop_duration} to nonzero values. |
| 6470 | Default value is @code{0.02}. Allowed range is from @code{0} to @code{10}. | 6485 | Default value is @code{0.02}. Allowed range is from @code{0} to @code{10}. |
| 6471 | @end table | 6486 | @end table |
| 6472 | | 6487 | |
| @@ -6495,6 +6510,25 @@ silence is detected in all channels at same positions in stream: · 22 unmodified lines |
| 6495 | @example | 6510 | @example |
| 6496 | silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0 | 6511 | silenceremove=window=0:detection=peak:stop_mode=all:start_mode=all:stop_periods=-1:stop_threshold=0 |
| 6497 | @end example | 6512 | @end example |
| | 6513 | |
| | 6514 | @item |
| | 6515 | Trim every 2nd encountered silence period from beginning to end where there is |
| | 6516 | more than 1 second of silence per silence period in audio: |
| | 6517 | @example |
| | 6518 | silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB |
| | 6519 | @end example |
| | 6520 | |
| | 6521 | @item |
| | 6522 | Similar as above, but keep maximum of 0.5 seconds of silence from each trimmed period: |
| | 6523 | @example |
| | 6524 | silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB:stop_silence=0.5 |
| | 6525 | @end example |
| | 6526 | |
| | 6527 | @item |
| | 6528 | Similar as above, but keep maximum of 1.5 seconds of silence from start of audio: |
| | 6529 | @example |
| | 6530 | silenceremove=stop_periods=-2:stop_duration=1:stop_threshold=-90dB:stop_silence=0.5:start_periods=1:start_duration=1:start_silence=1.5:stop_threshold=-90dB |
| | 6531 | @end example |
| 6498 | @end itemize | 6532 | @end itemize |
| 6499 | | 6533 | |
| 6500 | @subsection Commands | 6534 | @subsection Commands |