Use FFmpeg Silencedetect to Find Silent Intervals

This article explains how to use FFmpeg's silencedetect audio filter to identify periods of silence in audio and video files. You will learn the basic command syntax, how to adjust key parameters like noise thresholds and duration, and how to interpret the output metadata to locate silent intervals for editing, splitting, or automated processing.

The Basic Command Syntax

The silencedetect filter analyzes the audio stream of an input file and outputs the timestamps of detected silences to the terminal (stderr). Because you only need to analyze the file and do not want to create a new media file, you can direct the output to a null muxer (-f null -).

Here is the standard command:

ffmpeg -i input.mp4 -af silencedetect=noise=-50dB:d=2 -f null -

Parameter Definitions

You can customize the detection sensitivity by adjusting the filter parameters:

  • noise (or n): Sets the maximum volume level to be considered "silence." This can be specified in decibels (e.g., -50dB or -30dB) or as a decimal amplitude value between 0 and 1. The default is -30dB. Lower values (like -60dB) require the audio to be much quieter to trigger detection.
  • duration (or d): Sets the minimum duration of quiet time (in seconds) required to trigger a silence event. The default is 2 seconds. For example, d=0.5 will detect pauses as short as half a second.
  • mono (or m): When set to 1, silence is detected on individual channels separately. By default (0), it analyzes all channels combined.

Example with Custom Parameters:

To find silences quieter than -40dB that last at least 1.5 seconds:

ffmpeg -i input.wav -af silencedetect=n=-40dB:d=1.5 -f null -

Understanding the Output

When you run the command, FFmpeg will print the results in the terminal logs. Look for lines containing [silencedetect near the end of the process.

The output will look similar to this:

[silencedetect @ 0x7f88bc008f00] silence_start: 14.253
[silencedetect @ 0x7f88bc008f00] silence_end: 18.112 | silence_duration: 3.859
  • silence_start: The timestamp (in seconds) where the volume dropped below your threshold.
  • silence_end: The timestamp (in seconds) where the volume rose back above your threshold.
  • silence_duration: The total length of that specific silent interval.

Filtering the Output

Because FFmpeg outputs a large amount of system information, you can use command-line filters to isolate only the silence timestamps.

On Linux/macOS (using grep):

ffmpeg -i input.mp4 -af silencedetect=noise=-40dB:d=2 -f null - 2>&1 | grep silencedetect

On Windows (using PowerShell):

ffmpeg -i input.mp4 -af silencedetect=noise=-40dB:d=2 -f null - 2>&1 | Select-String "silencedetect"

This will display only the lines containing the start, end, and duration of the silent intervals, making the data easy to read or pipe into another script.