How to Use FFmpeg Crystalizer for Dynamic Range Expansion

This article explains how to use the crystalizer audio filter in FFmpeg to apply dynamic range expansion to your audio files. You will learn how the filter works, its key parameters, and practical command-line examples to help you restore life and punchiness to over-compressed audio tracks.

Understanding the Crystalizer Filter

The crystalizer filter in FFmpeg is a dynamic range expander. It works by making the loud parts of an audio signal louder and the quiet parts quieter. This is particularly useful for reversing the effects of heavy audio compression (often referred to as “loudness war” compression) or for adding presence and clarity to flat-sounding audio.

Unlike compressors which flatten audio peaks, the crystalizer accentuates transients and peaks, giving the audio a more “dynamic” and open feel.

Syntax and Parameters

The basic syntax for the filter is:

-af "crystalizer=parameter1=value1:parameter2=value2"

The filter accepts two main parameters:

Practical Command Examples

1. Default Dynamic Range Expansion

To apply the filter with its default settings (intensity of 2.0 and clipping prevention enabled), use the following command:

ffmpeg -i input.wav -af "crystalizer" output.wav

2. Adjusting the Expansion Intensity

If you want a more noticeable expansion effect, you can increase the intensity. This is useful for heavily compressed MP3s or flat podcasts:

ffmpeg -i input.mp3 -af "crystalizer=i=3.5" output.mp3

For a subtle enhancement, lower the intensity:

ffmpeg -i input.mp3 -af "crystalizer=i=1.5" output.mp3

3. Disabling Clipping Prevention

If you plan to manually normalize or limit the audio downstream using other filters, you can disable the built-in clipping prevention:

ffmpeg -i input.wav -af "crystalizer=i=2.5:cl=0" output.wav

4. Combining with Volume Normalization

Because dynamic range expansion increases the peak levels of your audio, it is often a good practice to pair the crystalizer filter with the loudnorm or volume filter to ensure your output file maintains a consistent overall volume:

ffmpeg -i input.wav -af "crystalizer=i=2.0,volume=-3dB" output.wav