Most FFmpeg tutorials treat audio as an afterthought. They show you how to extract it, copy it, or maybe change the volume. But professional audio processing—the kind that makes podcasts sound broadcast‑ready, music mixes punchy, and voiceovers crystal clear—is almost completely undocumented.
Yet FFmpeg has a powerful suite of audio filters that rivals dedicated DAW software. From EBU R128 loudness normalization to FFT‑based noise reduction, sidechain compression, and creative effects, FFmpeg can handle the entire audio signal chain.
This guide changes that. You'll learn the professional audio filters that most tutorials ignore, how to chain them together, and how to get broadcast‑quality results from the command line.
Key takeaways
loudnormimplements EBU R128 loudness normalization—the broadcast standard for consistent perceived volume.afftdnuses FFT‑based frequency‑domain noise reduction to remove steady background noise.sidechaincompressenables audio ducking—automatically lowering music when speech is detected.silenceremovecuts out silent sections, saving space and improving transcription accuracy.compandis a dynamic range compressor that evens out volume fluctuations.- Chain filters together for a complete mastering pipeline: noise reduction → compression → EQ → normalization.
The Gap: Audio Is Treated as an Afterthought
The FFmpeg documentation for audio filters is extensive but scattered. The loudnorm filter's documentation runs for pages, but most users don't know it exists. The afftdn filter was added in 2018 but still lacks practical examples. The sidechaincompress filter is almost completely misunderstood—most users think it does ducking out of the box, but it requires careful filtergraph construction.
As one user put it: "FFmpeg's sidechaincompress filter is often misunderstood—it doesn't directly 'duck' but compresses one audio based on another's signal"[reference:0].
The gap is practical knowledge—knowing which filters exist, how they work together, and what parameters to tune for different content types. This guide fills that gap.
The Symptom: "Why Does My Audio Sound Terrible?"
You've recorded a podcast or voiceover. The levels are all over the place—some parts are too quiet, others clip. There's a constant background hum. The music you added drowns out the speech. And the whole thing sounds amateurish.
You need professional audio processing. FFmpeg can do it—but you need to know which filters to use and in what order.
Core Concepts: The Audio Signal Chain
Professional audio processing follows a signal chain. Here's the typical order:
- Noise reduction — Remove background noise (
afftdn,anlmdn) - EQ / filtering — Cut unwanted frequencies (
highpass,lowpass,aequalizer) - Compression — Even out dynamics (
compand,acompressor) - Effects — Creative processing (
aecho,aphaser,chorus) - Loudness normalization — Set final perceived volume (
loudnorm) - Limiting — Prevent clipping (
alimiter)
Not every project needs all steps. A podcast might need noise reduction, compression, and loudness normalization. A music track might need EQ, compression, and creative effects. The key is knowing which tools to use and when.
Loudness Normalization with loudnorm
The loudnorm filter implements the EBU R128 loudness normalization standard[reference:1]. This is the broadcast standard used by Netflix, YouTube, and Spotify to ensure consistent perceived volume across different content.
Why use it? Peak normalization (adjusting the loudest sample) doesn't account for perceived loudness. A quiet whisper and a loud explosion might have the same peak level. EBU R128 measures integrated loudness (LUFS), which correlates with human perception.
Basic usage:
# Basic loudness normalization (single pass) ffmpeg -i input.wav -af "loudnorm" output.wav
The Two‑Pass Method (Recommended): For best results, run loudnorm twice—first to measure, second to apply[reference:2].
# Two-pass loudness normalization # Pass 1: Measure ffmpeg -i input.wav -af "loudnorm=I=-16:LRA=11:TP=-1.5:print_format=json" -f null - # Pass 2: Apply (using measured values) ffmpeg -i input.wav -af "loudnorm=I=-16:LRA=11:TP=-1.5:measured_I=-23.5:measured_LRA=7.0:measured_TP=-2.1:measured_thresh=-31.2:offset=0.8" output.wav
Key parameters:
I— Target integrated loudness in LUFS (default: -24). For podcasts, -16 is common. For music, -14 to -16.LRA— Target loudness range (default: 7). Lower values mean more consistent loudness.TP— True peak limit in dB (default: -2). Prevents clipping.
As the FFmpeg wiki notes: "It is recommended to run the normalization with two passes, extracting the measured values from the first run, then using the values in a second run with linear normalization enabled"[reference:3].
Noise Reduction with afftdn
The afftdn filter uses FFT‑based frequency‑domain noise reduction to remove steady background noise like fan hum, air conditioning, or microphone hiss[reference:4].
Basic usage:
# Basic noise reduction (10dB reduction, -40dB noise floor) ffmpeg -i input.wav -af "afftdn=nr=10:nf=-40" output.wav
As documented in the FFmpeg source: "Reduce white noise by 10dB, and use previously measured noise floor of -40dB"[reference:5].
With automatic noise floor tracking:
# Noise reduction with automatic floor tracking ffmpeg -i input.wav -af "afftdn=nr=10:nf=-80:tn=1" output.wav
"Enable automatic tracking of noise floor so noise floor will gradually change during processing"[reference:6]. This is useful for content where the noise floor varies over time.
Using commands to sample a noise profile:
# Sample noise profile from first 0.4 seconds, then apply reduction ffmpeg -i input.wav -af "asendcmd=0.0 afftdn sn start,asendcmd=0.4 afftdn sn stop,afftdn=nr=20:nf=-40" output.wav
This samples the noise profile from the first 0.4 seconds of audio (assuming that's silence or noise-only) and applies 20dB of noise reduction[reference:7].
Key parameters:
nr— Noise reduction in dB (0.01 to 97, default 12)[reference:8]nf— Noise floor threshold in dB (lower = more aggressive)[reference:9]tn— Enable noise floor tracking (0=off, 1=on)
Practical tip: As one user found, combining highpass with afftdn yields better results: "highpass=f=80, afftdn=nf=-25"[reference:10]. The high‑pass filter removes low‑frequency rumble before noise reduction, preventing the noise reducer from wasting energy on frequencies that don't matter.
Sidechain Compression & Audio Ducking
Sidechain compression is a technique where one audio signal controls the compression of another[reference:11]. The most common use case is audio ducking—automatically lowering background music when speech is detected[reference:12].
The misunderstanding: The sidechaincompress filter doesn't automatically duck. It compresses the first input based on the level of the second input. To achieve ducking, you need to combine it with other filters[reference:13].
Basic sidechain compression:
# Basic sidechain compression (music ducked by voice) ffmpeg -i music.mp3 -i voice.wav -filter_complex "[1:a]asplit=2[sc][mix];[0:a][sc]sidechaincompress=threshold=0.003:ratio=20[compressed];[compressed][mix]amix=inputs=2" output.mp3
This command splits the voice into two paths: one for the sidechain input, one for mixing. The music is compressed based on the voice level, then mixed with the original voice.
For more precise ducking, use the compand filter to create a control track:
# Ducking with compand control track
ffmpeg -i music.mp3 -i speech.wav -filter_complex \
"[1:a]compand=attacks=0:decays=0.5:points=-80/-80|-25/-15|0/-12|20/-8[ctrl]; \
[0:a]volume=enable='between(t,0,${duration})':volume='if(gt(ldb(r),-25),0.4,1)'[music]; \
[music][ctrl]amerge=inputs=2" -ac 2 output.mp3
This creates a control track from the speech using compand, then uses the volume filter with a conditional expression to duck the music when the control signal exceeds -25 dB[reference:14].
Silence Removal with silenceremove
The silenceremove filter removes silent sections from audio—useful for podcasts, interviews, and transcription preprocessing[reference:15].
# Remove silence (threshold -50dB, min duration 0.1s) ffmpeg -i input.wav -af "silenceremove=stop_periods=-1:stop_duration=0.1:stop_threshold=-50dB" output.wav
Key parameters:
stop_periods=-1— Remove all silent periods[reference:16]stop_duration— Minimum silence duration in seconds[reference:17]stop_threshold— Volume threshold below which audio is considered silence[reference:18]
For best results with speech, use detection=peak which is more accurate for voice detection[reference:19].
Dynamic Range Compression with compand
The compand filter is a powerful dynamic range compressor that evens out volume fluctuations[reference:20]. It's more flexible than acompressor and allows custom transfer curves.
# Soft compression for voice (smooth, natural) ffmpeg -i input.wav -af "compand=attacks=0.01:decays=1.0:points=-80/-80|-30/-20|0/0" output.wav
Key parameters:
points— Transfer curve points: input/output pairs in dB[reference:21]attacks— Attack time in secondsdecays— Decay time in seconds
The points define a curve: below -80 dB, output is -80 dB (silence). At -30 dB input, output is -20 dB (gain reduction). At 0 dB input, output is 0 dB (no change). This creates gentle compression that evens out voice levels.
Creative Effects: Echo, Chorus, and More
FFmpeg includes a range of creative audio effects for music production and sound design.
Echo with aecho
# Echo effect (delay: 60ms, decay: 0.4) ffmpeg -i input.wav -af "aecho=0.8:0.88:60:0.4" output.wav
As noted in the FFmpeg docs, a very short delay (< 60ms) sounds like a robot or metallic effect[reference:22]. Longer delays create a clear echo.
Chorus with aphaser or chorus
# Chorus/phaser effect ffmpeg -i input.wav -af "aphaser=type=rectangular" output.wav
Equalization with aequalizer
# Parametric EQ: boost 2kHz for voice clarity ffmpeg -i input.wav -af "aequalizer=2k:width=200:gain=4" output.wav
Practical Example: Podcast Mastering Chain
Let's put it all together with a complete podcast mastering chain:
- Remove low‑frequency rumble (
highpass) - Reduce background noise (
afftdn) - Even out dynamics (
compand) - Normalize loudness (
loudnorm) - Boost volume (
volume)
# Complete podcast mastering chain ffmpeg -i raw_podcast.wav \ -af "highpass=f=80,afftdn=nr=10:nf=-40,compand=attacks=0.01:decays=1.0:points=-80/-80|-30/-20|0/0,loudnorm=I=-16:LRA=11:TP=-1.5,volume=1.5" \ -c:a libmp3lame -b:a 192k mastered_podcast.mp3
This single command transforms raw audio into broadcast‑ready podcast audio. As one user noted, this approach is "fast, compatible, and effective" for preprocessing audio before transcription[reference:23].
Debugging Common Audio Issues
Here are the most common audio processing issues and how to fix them.
| Problem | Likely Cause | Fix |
|---|---|---|
| Noise reduction sounds "watery" or metallic | nr or nf too aggressive |
Reduce nr (try 5-10) or raise nf (try -30 instead of -40)[reference:24] |
| Loudness normalization doesn't change volume | Target loudness already matches input | Check measured values with first pass; adjust I target |
| Ducking doesn't work | sidechaincompress misconfigured |
Use compand to create a control track[reference:25] |
| Silence removal cuts too much | Threshold too high | Lower stop_threshold (e.g., -60dB instead of -50dB) |
| Compression sounds "pumping" | Attack or decay too fast | Increase attacks or decays values[reference:26] |
| Audio is distorted after processing | Volume boost causes clipping | Add alimiter at the end of the chain |
Visualize Audio with the FFmpegLab IDE
Advanced audio processing is much easier to debug with visual feedback. The FFmpegLab IDE lets you:
- View waveforms before and after processing—see exactly what each filter does
- Adjust parameters with sliders for
loudnorm,afftdn,compand, and more - Visualize frequency content to see what noise reduction is removing
- Monitor loudness in real time with LUFS metering
- Compare different filter chains side by side
Here's how advanced audio processing looks in the FFmpegLab IDE.
# Visual audio processing chain # Adjust parameters with sliders → hear and see results in real time
The IDE shows you exactly what's happening—waveforms before and after, noise floor measurements, and loudness metrics. You can adjust parameters with sliders and see the results in real time.
Frequently Asked Questions (FAQ)
What's the difference between loudnorm and volume normalization?
volume normalization adjusts based on peak or RMS levels—it doesn't account for perceived loudness. loudnorm implements EBU R128, which measures perceived loudness (LUFS) and is the broadcast standard[reference:27]. For professional results, always use loudnorm.
What noise reduction filter should I use?
afftdn (FFT‑based) is best for steady background noise like fan hum or hiss[reference:28]. anlmdn (non‑local means) is better for preserving music and complex signals[reference:29]. For most voice content, afftdn with highpass is the best combination[reference:30].
How do I duck audio with FFmpeg?
Use the sidechaincompress filter in a filtergraph with two inputs, or use compand to create a control track[reference:31]. The key is that sidechaincompress doesn't automatically duck—you need to construct the right filtergraph[reference:32].
Why is my audio distorted after loudnorm?
The TP (true peak) parameter might be too high. Try TP=-2 or -3. Also ensure you're using the two‑pass method—single‑pass loudnorm can occasionally cause clipping[reference:33].
Can I process audio without re-encoding video?
Yes. Use -c:v copy to pass through the video stream unchanged, and apply audio filters with -af. Example: ffmpeg -i input.mp4 -c:v copy -af "loudnorm" output.mp4.
Final Word
Advanced audio processing is one of FFmpeg's most powerful—and most underutilized—features. With filters like loudnorm for broadcast‑standard loudness, afftdn for noise reduction, sidechaincompress for ducking, and compand for dynamic control, FFmpeg can handle the entire professional audio signal chain.
The key is understanding which filters to use and in what order. Start with noise reduction and EQ, then compression, then loudness normalization. Chain them together for a complete mastering pipeline.
With the FFmpegLab IDE's visual feedback, you can experiment, debug, and perfect your audio processing without the guesswork. Adjust parameters with sliders, see waveforms update in real time, and hear the results instantly.
Next time you're facing noisy recordings or inconsistent levels, reach for FFmpeg's advanced audio filters. Your listeners will thank you.