Configure FFmpeg speechnormalizer Ratio and Threshold

This article provides a straightforward guide on how to configure the compression behavior and noise gate threshold of the speechnormalizer filter in FFmpeg. You will learn the specific parameters required to control speech volume envelope adjustments, prevent background noise amplification, and apply these settings using practical command-line examples.

The speechnormalizer filter in FFmpeg is an audio filter designed to automatically adjust the volume of speech to a consistent level. Unlike standard compressors, it uses a speech-profile-based approach. To control its compression strength and noise gating, you must configure its key parameters: threshold, max_gain, and peak.

1. Configuring the Gate Threshold

The noise gate threshold prevents the filter from amplifying quiet background noise during silent intervals. In the speechnormalizer filter, this is controlled by the threshold (or t) option.

2. Configuring the Compression Ratio (Intensity)

The speechnormalizer does not use a traditional static compression ratio (like 4:1). Instead, it acts as an Automatic Gain Control (AGC). You control the compression range and output level using the max_gain and peak parameters.

3. Practical FFmpeg Command Example

To apply these configurations, chain the parameters within the -af (audio filter) flag using the parameter=value syntax separated by colons.

Here is a command that sets a moderate compression maximum gain of 10 dB, a target peak of 0.95, and a strict noise gate threshold of 0.30 to block background hiss:

ffmpeg -i input.mp3 -af "speechnormalizer=peak=0.95:max_gain=10:threshold=0.30" output.mp3

Parameter Breakdown: