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:
iorintensity: This float value sets the expansion intensity.- Default value:
2.0 - Range:
0.0to10.0 - A value of
0.0leaves the audio completely unchanged. Higher values apply stronger dynamic range expansion.
- Default value:
clorclip: This boolean flag enables or disables clipping prevention.- Default value:
1(enabled) - When enabled (
1), it prevents the expanded audio peaks from clipping (distortion caused by exceeding 0 dBFS). When disabled (0), the audio may clip if the expansion pushes the volume past maximum limits.
- Default value:
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.wav2. 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.mp3For a subtle enhancement, lower the intensity:
ffmpeg -i input.mp3 -af "crystalizer=i=1.5" output.mp33. 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.wav4. 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