Want to find the silent sections in a podcast or a recording? As a preprocessing step before automatic cutting or chapter splitting, you first need to know exactly where the silence is. FFmpeg’s silencedetect filter reports the start, end, and length of silent sections based on a threshold and duration you specify. This article covers the basics of the command, tuning noise and duration, how to read the output, and how to apply it to automatic cutting.
Tested with: FFmpeg 6.1 (verified against real FFmpeg)
Basic Command
ffmpeg -i input.mp3 -af silencedetect -f null /dev/null
This produces no output file; it prints information about the silent sections to standard error.
How to Read the Output
[silencedetect @ 0x...] silence_start: 5.32
[silencedetect @ 0x...] silence_end: 8.15 | silence_duration: 2.83
[silencedetect @ 0x...] silence_start: 45.7
[silencedetect @ 0x...] silence_end: 47.2 | silence_duration: 1.5
| Field | Description |
|---|---|
silence_start | Start time of the silence (seconds) |
silence_end | End time of the silence (seconds) |
silence_duration | Length of the silence (seconds) |
Tuning the Threshold (noise) and Minimum Duration (duration)
Default Values
| Parameter | Default | Description |
|---|---|---|
noise | -60dB | Anything at or below this volume is treated as “silence” |
duration | 2 | Only report silence lasting at least this many seconds |
Custom Example: Treat -40dB or lower for 0.5s or longer as silence
ffmpeg -i input.mp3 -af "silencedetect=noise=-40dB:duration=0.5" -f null /dev/null
- Raise noise (e.g., -40dB): Detect background noise as silence too
- Shorten duration (e.g., 0.1s): Detect even brief breaths
- Lengthen duration (e.g., 3s): Detect only long pauses
Applying to Video Files
ffmpeg -i input.mp4 -af "silencedetect=noise=-50dB:duration=1" -f null /dev/null
The audio track is analyzed for video files as well.
Narrowing the Output (Combining with grep)
An example of extracting only the lines you need (Linux/macOS):
ffmpeg -i input.mp3 -af silencedetect -f null /dev/null 2>&1 | grep silence_
On the Windows Command Prompt, use findstr silence_ instead.
Application: Automatic Cutting Using Silent Sections
The flow for obtaining silent sections from the silencedetect output and trimming with -ss/-to:
- Get
silence_start/silence_endwith silencedetect - Calculate the time ranges that avoid the silent sections
- Actually cut with an ffmpeg trimming command
By automating this process with a shell script or Python, you can bulk-remove the silent parts of podcasts or lecture videos.
Common Configuration Patterns
| Use Case | noise | duration |
|---|---|---|
| Removing silence from podcasts | -40dB | 0.3 |
| Skipping long silences in recorded footage | -50dB | 3 |
| Detecting track boundaries in music files | -60dB | 1 |
| Detecting only the silent parts of a recording | -30dB | 0.5 |
Measured Example
This example detects silence in a 48 kHz stereo AAC track inside a 2-minute video using noise=-40dB:duration=0.5:
ffmpeg -i input.mp4 \
-af "silencedetect=noise=-40dB:duration=0.5" \
-f null /dev/null
The work is mostly audio decoding and analysis; no video output is written. For a 2-minute source, it often finishes in a few seconds, and the text log is usually only a few KB.
On the same material, noise=-50dB may treat air-conditioner noise as sound and report fewer silent ranges. noise=-30dB may classify quiet room tone as silence and report more ranges. When using this for automatic cuts, keep 100–300 ms of padding around detected speech to avoid clipping the start of words. Results vary by environment.
Related Articles
Tested with: ffmpeg 6.1 / Ubuntu 24.04 (検証スクリプトで実行確認) Primary sources: ffmpeg.org/ffmpeg-filters.html#silencedetect / trac.ffmpeg.org/wiki/AudioVolume
Frequently Asked Questions
What threshold should I use for silence detection?
FFmpeg’s default is noise=0.001, which is about -60dB. In practice, aim for 5–10 dB above the noise floor of your recording environment. Use around -50dB for studio recordings and around -25dB for outdoor recordings, then adjust.
I want to automatically cut out silent sections
Use the silenceremove filter. -af "silenceremove=start_periods=1:start_silence=0.5:start_threshold=-30dB" lets you cut the silence at the beginning and end.
How do I get the silence timestamps?
ffmpeg -i in.mp4 -af silencedetect=noise=-30dB:d=0.5 -f null - 2>&1 | grep silence outputs the start and end times of the silent sections.
How should I set the duration?
d=0.5 (detect silence of 0.5 seconds or longer) is common. If you make it too short, it will detect blinks and breaths. Adjust it by use case — 1 second or more for vlogs, 0.3 seconds for narration, etc.
Can I detect silence even with background music?
No. With background music, there is always sound playing, so detection is not possible. Separate the background music from the audio in advance (e.g., -map 0:a:1) before applying silencedetect.