FFmpeg Crystalizer Filter: Expand Audio Dynamic Range
This guide covers how to use FFmpeg's crystalizer audio
filter to restore punch and expand the dynamic range of over-compressed,
squashed audio tracks. You will learn how the filter operates,
understand its primary parameters, and see practical command-line
examples to decompress dynamic range without introducing unwanted
digital distortion.
Understanding the Crystalizer Filter
The crystalizer filter works by accentuating the
differences between successive audio samples. When audio is heavily
limited or compressed, transients are flattened, reducing dynamic
contrast. By applying a positive intensity value with
crystalizer, small variations in volume are magnified,
effectively sharpening peaks, expanding the perceived dynamic range, and
restoring transient attack.
Syntax and Key Parameters
The filter takes two main parameters:
intensity(ori): Sets the magnitude of dynamic alteration. The acceptable range is from-10.0to10.0, with a default of2.0. Positive values (e.g.,1.0to10.0) expand the dynamic range and sharpen attacks. Negative values reduce dynamic range and soften audio.clipping(orc): Enables or disables internal clipping detection. Accepting a boolean (1for enabled,0for disabled), this parameter defaults to1(enabled) to help prevent hard-clipping distortion when peaks exceed full scale.
Basic Usage Example
To apply the default expansion effect to an audio file, run:
ffmpeg -i input.mp3 -af "crystalizer=i=2.0" output.wavRecommended Practice: Preventing Clipping and Distortion
Because dynamic expansion raises the level of peaks, it frequently
pushes audio beyond 0 dBFS (decibels relative to full scale), creating
harsh digital clipping. While the internal clipping=1 flag
handles hard edge boundaries, it can cause truncation artifacts if
driven too hard.
To achieve clean results, pair the crystalizer filter
with pre-attenuation or a downstream peak limiter:
Method 1: Using a Pre-Attenuation Gain Drop
Lower the volume slightly before crystallization to give your audio headroom:
ffmpeg -i input.mp3 -af "volume=-2dB,crystalizer=i=2.5" output.wavMethod 2: Combining Crystalizer with the Alimiter Filter
Using the alimiter filter directly after
crystalizer ensures that restored transients do not clip
the master output:
ffmpeg -i input.mp3 -af "crystalizer=i=2.0,alimiter=limit=0.98" output.flacRecommended Settings for Different Audio Sources
- Subtle Transient Recovery (Podcasts / Light Music):
Use
i=1.2toi=1.5. This adds clarity to muffled speech and lightly expands snare hits without coloring the mix. - Moderate Expansion (Heavily Mastered Pop/Rock): Use
i=1.8toi=2.5. This counters the "loudness war" effect by driving peaks further apart from sustained sustained tones. - Extreme Expansion: Values above
i=3.0generally introduce audible grain, hiss, and severe harmonic distortion, and should be used cautiously.