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:

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

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.