Viewers forgive a lot in a documentary: a grainy archive photograph, a shaky map pan. They forgive bad audio much less. A narration with a low rumble under it, a hiss between sentences, or a volume that jumps against the music is tiring to listen to, and people leave. The good news is that a few well-chosen ffmpeg filters deal with the most common problems, and you can check the result with numbers instead of by ear alone.
This post walks through a three-step chain for a voice-over, explains what each step is doing and where it can go wrong, and shows a script and tests that run on a synthetic recording. I'll be honest about the limit up front: my test file isn't a real voice, so treat the numbers as a demonstration that the method works, not as settings to copy blindly.
Fix the recording first
No filter chain rescues a bad recording as well as a better one. These are habits that do more than any software, and they cost nothing:
- Record in the quietest room you have. Soft furnishings help; bare walls and windows make a room echo.
- Keep the microphone at a steady, short distance, and keep the same distance for every session so that clips match.
- Switch off fans, fridges and anything with a hum while recording, not afterwards.
- Record a few seconds of "room tone" (silence) at the start of each session. Noise-reduction tools and your own ears both use it to know what to remove.
- Leave headroom. A recording that clips (hits the maximum and flattens) can't be properly repaired.
The chain
I'd apply three steps in this order.
High-pass filter: remove rumble
highpass=f=80removes content below 80 Hz, where traffic, handling noise and mains rumble live and where a speaking voice has little of interest. The cutoff is a judgement. A deep voice has energy lower than a light one, so I'd start near 80 Hz and raise it only if rumble remains, listening for a voice that starts to sound thin.Noise reduction: reduce steady hiss
afftdn=nr=12:nf=-40is ffmpeg's FFT-based denoiser.nrsets how many decibels of noise reduction to apply andnfsets the assumed noise floor. A modestnris the safe choice. Push it too far and a voice takes on a watery, "underwater" quality, because the filter starts removing parts of the speech. It works best on steady noise such as hiss or a fan, and badly on sudden noise such as a door.Loudness normalisation: make the level consistent
loudnormapplies the EBU R 128 loudness method. It measures integrated loudness in LUFS, loudness range, and the true peak, and adjusts the audio to a target. Used on its own in a single pass it can change the dynamics; a better approach is two passes: measure first, then feed the measured values back in withlinear=trueso the filter applies a plain gain change instead of dynamic processing, where the input allows.
On targets: the EBU's R 128 recommendation is an average programme loudness of -23 LUFS, which is a broadcast standard. Online platforms often process uploaded audio their own way, and I haven't found a platform document that I can cite for a required figure, so I don't give one. I used -16 LUFS in the example because I had to pick a number, and I'd suggest you check the current guidance of wherever you publish before choosing yours. What matters more than the exact figure is consistency: every episode at the same level.
The script
The Python below wraps those steps. measure() reads loudness with loudnorm's analysis output, segment_rms_db() measures the level of a slice of the file (use a slice with no speech to find the noise floor), and clean() runs the chain and the two-pass normalisation, then measures the result.
audio_clean.py
"""Clean up a narration recording with ffmpeg: remove rumble and hiss, then normalise loudness (two-pass loudnorm).
python audio_clean.py raw.wav clean.wav --lufs -16 --tp -1.5
"""
import json
import re
import subprocess
import sys
def run(cmd):
return subprocess.run(cmd, capture_output=True, text=True, check=True)
def measure(path):
"""EBU R128 measurement via ffmpeg's loudnorm filter (first pass, no output file)."""
r = run(["ffmpeg", "-hide_banner", "-nostats", "-i", str(path), "-af", "loudnorm=print_format=json", "-f", "null", "-"])
blob = r.stderr[r.stderr.rindex("{"):]
d = json.loads(blob[:blob.index("}") + 1])
return {k: float(d[k]) for k in ("input_i", "input_tp", "input_lra", "input_thresh", "target_offset")}
def segment_rms_db(path, start, dur):
"""RMS level in dBFS of a slice of the file (use a slice with no speech to measure the noise floor)."""
r = run(["ffmpeg", "-hide_banner", "-nostats", "-ss", str(start), "-t", str(dur), "-i", str(path),
"-af", "astats=metadata=0:reset=0", "-f", "null", "-"])
m = re.findall(r"RMS level dB:\s*(-?[\d.]+|-inf)", r.stderr)
return float(m[-1]) # the last match is the 'Overall' value
CLEAN_CHAIN = "highpass=f=80,afftdn=nr=12:nf=-40" # cut rumble below 80 Hz, then reduce steady broadband noise
def clean(src, dst, lufs=-16.0, tp=-1.5, lra=11.0):
"""Two passes: measure the cleaned audio, then feed those numbers to loudnorm for an accurate linear gain."""
first = run(["ffmpeg", "-hide_banner", "-nostats", "-i", str(src), "-af",
f"{CLEAN_CHAIN},loudnorm=I={lufs}:TP={tp}:LRA={lra}:print_format=json", "-f", "null", "-"])
blob = first.stderr[first.stderr.rindex("{"):]
m = json.loads(blob[:blob.index("}") + 1])
ln = (f"loudnorm=I={lufs}:TP={tp}:LRA={lra}:measured_I={m['input_i']}:measured_TP={m['input_tp']}:"
f"measured_LRA={m['input_lra']}:measured_thresh={m['input_thresh']}:offset={m['target_offset']}:linear=true")
run(["ffmpeg", "-y", "-hide_banner", "-loglevel", "error", "-i", str(src), "-af", f"{CLEAN_CHAIN},{ln}",
"-ar", "48000", "-ac", "1", str(dst)])
return measure(dst)
if __name__ == "__main__":
import argparse
ap = argparse.ArgumentParser()
ap.add_argument("src")
ap.add_argument("dst")
ap.add_argument("--lufs", type=float, default=-16.0)
ap.add_argument("--tp", type=float, default=-1.5)
a = ap.parse_args()
print(json.dumps(clean(a.src, a.dst, a.lufs, a.tp), indent=2))
One detail worth explaining: in the first pass, the script runs the cleaning filters and then loudnorm in analysis mode, so the measured values describe the already-cleaned audio. If you measured the raw file instead, the gain would be calculated for a signal that no longer exists once the high-pass and denoiser have changed the level.
The test, and what it measures
The test builds an 8-second file with ffmpeg: two seconds of noise only, then six seconds of tone bursts with a slow amplitude wobble standing in for speech, mixed with white noise and a 40 Hz sine, then turned down so it is far too quiet. Then it runs the chain and checks four things:
- Loudness lands on target, within 1 LU of -16. The raw file measured -29.11 LUFS; the output measured -16.0.
- The true peak stays under the ceiling, here -1.0 dBTP. The output measured -6.08 dBTP, so there was room. This check matters more with real speech, which has sharper peaks.
- The noise floor improves relative to the speech, by at least 6 dB. I compare the level of the speech section with the level of the noise-only section. That gap went from 19.1 dB to 33.9 dB. This measures the chain's effect on a steady-noise test signal, which is the easy case.
- The output format is 48,000 Hz mono, which is what I set for a single narrator.
test_audio_clean.py
import shutil
import subprocess
import tempfile
import unittest
from pathlib import Path
from audio_clean import measure, segment_rms_db, clean
RAW_CMD = [
"ffmpeg", "-y", "-loglevel", "error",
# 'speech-like' tone bursts: 2 s of silence first (noise only), then 6 s of a voiced signal with a 3 Hz envelope
"-f", "lavfi", "-i", "aevalsrc='if(gte(t,2), 0.30*sin(2*PI*180*t)*(0.6+0.4*sin(2*PI*3*t)) + 0.15*sin(2*PI*540*t)*(0.6+0.4*sin(2*PI*3*t)), 0)':s=48000:d=8",
"-f", "lavfi", "-i", "anoisesrc=color=white:amplitude=0.02:sample_rate=48000:duration=8", # hiss
"-f", "lavfi", "-i", "sine=frequency=40:sample_rate=48000:duration=8", # rumble
"-filter_complex", "[2:a]volume=0.15[r];[0:a][1:a][r]amix=inputs=3:normalize=0,volume=0.25",
]
@unittest.skipUnless(shutil.which("ffmpeg"), "ffmpeg not installed")
class Tests(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.tmp = Path(tempfile.mkdtemp())
cls.raw = cls.tmp / "raw.wav"
subprocess.run(RAW_CMD + [str(cls.raw)], check=True)
cls.out = cls.tmp / "clean.wav"
cls.m_out = clean(cls.raw, cls.out, lufs=-16.0, tp=-1.5)
@classmethod
def tearDownClass(cls):
shutil.rmtree(cls.tmp, ignore_errors=True)
def test_loudness_lands_on_target(self):
print(f"raw: {measure(self.raw)}")
print(f"clean: {self.m_out}")
self.assertAlmostEqual(self.m_out["input_i"], -16.0, delta=1.0) # integrated loudness within 1 LU
def test_true_peak_stays_under_ceiling(self):
self.assertLessEqual(self.m_out["input_tp"], -1.0)
def test_noise_floor_improves_relative_to_speech(self):
# SNR proxy: level of the voiced part minus level of the noise-only part (first 2 s)
def snr(p):
return segment_rms_db(p, 3, 4) - segment_rms_db(p, 0.2, 1.5)
before, after = snr(self.raw), snr(self.out)
print(f"speech-to-noise-floor: {before:.1f} dB before, {after:.1f} dB after")
self.assertGreater(after, before + 6)
def test_output_format(self):
r = subprocess.run(["ffprobe", "-v", "error", "-show_entries", "stream=sample_rate,channels", "-of", "csv=p=0", str(self.out)],
capture_output=True, text=True, check=True).stdout.strip()
self.assertEqual(r, "48000,1")
if __name__ == "__main__":
unittest.main()
All four pass. I want to be precise about what that means. They show the commands are wired correctly, that the two-pass approach reaches its target, and that the denoiser does its job on white noise. They do not show that the output sounds good, and that is a question for your ears.
Check by listening
- Listen with headphones to the quietest part: hiss gone, but no watery edge on the ends of words?
- Listen to the "s" and "t" sounds. Over-aggressive processing dulls them first.
- Compare against the raw file by switching between the two at matched volume. Louder always sounds better at first, so match the levels before judging.
- Play it after the music. If you're mixing a music bed, get the narration right first, then set the music under it.
When to stop
Noise reduction is easy to overdo because every extra decibel of reduction makes the silences cleaner while the voice quietly suffers. If the recording needs heavy processing, I'd rather re-record the worst lines. And a small amount of room tone under the voice sounds more natural than total silence, because audiences notice the sudden dead quiet.
What I haven't verified
- Behaviour on real speech, other microphones or noisy rooms.
- The best
highpass,nrandnfvalues for your voice. These are starting points. - Any platform's loudness processing or targets.
- That a different ffmpeg version gives identical numbers. I ran 7.1.5.
What I ran this against
- Run on 17 November 2026 with ffmpeg 7.1.5, Python 3.13.5 and unittest. 4 tests pass in about one second.
- The test recording is synthetic: tone bursts standing in for a voice, plus white noise (hiss) and a 40 Hz sine (rumble). I did not test on a real voice recording. Real rooms, microphones and voices behave differently, and noise reduction that works on steady white noise can damage a real voice if set too hard.
- Measured on that synthetic file: integrated loudness went from -29.11 LUFS to -16.0 LUFS; the true peak went from -20.67 dBTP to -6.08 dBTP; and the gap between the speech section and the noise-only section grew from 19.1 dB to 33.9 dB. Those numbers describe this test file and nothing else.
- I have not tested any of this against a platform's loudness handling, and I make no claim about a platform's target level. The -16 LUFS figure is a value I chose for the example, not a requirement.
Sources checked
- FFmpeg Filters Documentation, filters used here (
highpass,afftdn,loudnorm,astats): ffmpeg.org/ffmpeg-filters.html, read 17 November 2026; the commands were run with ffmpeg 7.1.5. - EBU, "R 128: Loudness normalisation and permitted maximum level of audio signals", version 5.0, November 2023 (recommends an average programme loudness of -23 LUFS and the Loudness Range and Maximum True Peak Level descriptors; this is a broadcast recommendation): tech.ebu.ch, read 17 November 2026.