Improve Speech Clarity with FFmpeg Speechnormalizer
This article provides a practical guide on how to use the
speechnormalizer filter in FFmpeg to enhance the clarity
and intelligibility of spoken audio. You will learn what the filter
does, its key parameters, and how to apply it to your audio and video
files using simple command-line examples to achieve consistent,
professional-grade speech levels.
The speechnormalizer filter in FFmpeg is an audio filter
designed specifically to improve speech clarity by dynamically adjusting
volume levels. Unlike standard normalization, which scales the entire
audio file based on a single peak, the speech normalizer analyzes the
audio in small frames and adjusts the gain dynamically. This ensures
that quiet words are boosted and excessively loud words are attenuated,
resulting in a balanced and highly legible voice track.
Basic Usage
To apply the speech normalizer with its default settings, use the following basic command:
ffmpeg -i input.mp4 -af "speechnormalizer" output.mp4This command processes the audio stream of input.mp4
through the speechnormalizer filter and saves the result to
output.mp4 while keeping the default parameters, which are
optimized for general speech.
Key Parameters
You can fine-tune the filter’s behavior by adjusting its parameters. The most important options include:
peak(orp): Sets the target peak amplitude. The default value is0.95(representing 95% of maximum digital volume).rms(orr): Sets the target Root Mean Square (RMS) level, which represents the perceived loudness of the speech. The default is0.25.threshold(ort): Sets the noise gate threshold. Audio below this level is treated as silence/noise and is not boosted. The default is0.01. Raising this value prevents the filter from amplifying background hiss or room noise during pauses in speech.f: Specifies the frame length in milliseconds for analyzing the audio. The default is250ms.
Advanced Examples
To normalize speech while actively suppressing background noise
during pauses, increase the threshold value:
ffmpeg -i input.wav -af "speechnormalizer=peak=0.9:threshold=0.05" output.wavIf you have a highly dynamic voice recording where the speaker goes
from whispering to shouting, you can lower the target rms
to prevent clipping and set a conservative peak level:
ffmpeg -i interview.mp3 -af "speechnormalizer=peak=0.85:rms=0.2" normalized_interview.mp3By adjusting these parameters, you can customize the
speechnormalizer filter to suit podcasts, voiceovers, video
meetings, and any other audio where speech clarity is paramount.