How to Use the Crystalizer Filter in FFmpeg
This guide provides a straightforward explanation of how to use the
crystalizer filter in FFmpeg to enhance the dynamic range
and clarity of your audio files. You will learn what the filter does,
its key parameters, and practical command-line examples to help you
apply this effect to your own media projects.
What is the Crystalizer Filter?
The crystalizer is an audio filter in FFmpeg designed to
expand the dynamic range of audio. It works by making quiet sounds
quieter and loud sounds louder, which can add a sense of sharpness,
brightness, and “closeness” to compressed or dull audio tracks. It is
particularly useful for restoring perceived detail in low-bitrate MP3s
or flat-sounding voice recordings.
Syntax and Parameters
To use the filter, you apply the -af (audio filter) flag
followed by crystalizer. The filter accepts two main
parameters:
intensity(ori): Sets the strength of the crystallization effect.- Range:
-10.0to10.0 - Default:
2.0 - Note: Positive values increase the dynamic range (making
the sound brighter), while negative values decrease it. A value of
0.0has no effect.
- Range:
clip(orc): Determines whether the output audio should be clipped if it exceeds maximum volume boundaries.- Values:
0(disabled) or1(enabled) - Default:
1(enabled)
- Values:
Practical Examples
1. Basic Usage (Default Settings)
To apply the filter using its default intensity of 2.0,
run the following command:
ffmpeg -i input.mp3 -af "crystalizer" output.mp32. Increasing the Intensity
If you want a more noticeable, brighter effect, increase the
intensity parameter. Here, we set the intensity to 3.5:
ffmpeg -i input.mp3 -af "crystalizer=intensity=3.5" output.mp3Alternatively, you can use the short-hand version of the parameter name:
ffmpeg -i input.mp3 -af "crystalizer=i=3.5" output.mp33. Softening the Audio (Negative Intensity)
To achieve the opposite effect—making the audio sound slightly more compressed and softer—use a negative intensity value:
ffmpeg -i input.mp3 -af "crystalizer=i=-1.5" output.mp34. Disabling Clipping
By default, clipping is enabled to prevent digital distortion. If you
prefer to disable clipping and handle potential distortion manually
downstream, set the clip parameter to 0:
ffmpeg -i input.mp3 -af "crystalizer=i=2.5:c=0" output.mp3