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 (or i): Sets the magnitude of dynamic alteration. The acceptable range is from -10.0 to 10.0, with a default of 2.0. Positive values (e.g., 1.0 to 10.0) expand the dynamic range and sharpen attacks. Negative values reduce dynamic range and soften audio.
  • clipping (or c): Enables or disables internal clipping detection. Accepting a boolean (1 for enabled, 0 for disabled), this parameter defaults to 1 (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.wav

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.wav

Method 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.flac
  • Subtle Transient Recovery (Podcasts / Light Music): Use i=1.2 to i=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.8 to i=2.5. This counters the "loudness war" effect by driving peaks further apart from sustained sustained tones.
  • Extreme Expansion: Values above i=3.0 generally introduce audible grain, hiss, and severe harmonic distortion, and should be used cautiously.