How to Use the FFmpeg Tremolo Filter to Adjust Audio
The FFmpeg tremolo filter is a powerful tool for adding
a rhythmic amplitude modulation effect to your audio files. This article
provides a quick guide on how the filter works, its key
parameters—frequency and depth—and practical command-line examples to
help you easily apply and customize the tremolo effect in your audio
processing workflows.
Understanding the Tremolo Parameters
The tremolo filter in FFmpeg works by modulating the
volume of an audio stream using a sinusoidal wave. To control this
effect, you use two primary parameters:
- Frequency (
f): This defines the speed of the modulation in Hertz (Hz). The default value is5.0Hz. A lower frequency creates a slow, pulsing volume swell, while a higher frequency creates a rapid, fluttering ring-modulation effect. - Depth (
d): This defines the intensity of the volume variation, ranging from0.0to1.0. The default value is0.5. A depth of0.1produces a very subtle variation, while a depth of1.0results in complete silence at the lowest points of the modulation wave.
Basic Command Syntax
To apply the filter, use the -af (audio filter) flag
followed by the filter name and your desired parameters:
ffmpeg -i input.mp3 -af "tremolo=f=5:d=0.5" output.mp3In this command: * -i input.mp3 specifies your input
file. * -af "tremolo=f=5:d=0.5" applies the tremolo filter
with a frequency of 5 Hz and a depth of 50%. * output.mp3
is the resulting output file.
Practical Examples
1. Subtle, Warm Tremolo
For a gentle, vintage guitar-amp style tremolo, use a lower frequency and a moderate depth:
ffmpeg -i input.wav -af "tremolo=f=3.5:d=0.4" output.wav2. Intense, Choppy Tremolo
For a dramatic, stuttering effect where the volume drops almost completely to zero at a rapid pace, increase both parameters:
ffmpeg -i input.wav -af "tremolo=f=12:d=0.9" output.wav3. Rapid Ring-Modulation style
To achieve a metallic or electronic tone, push the frequency into higher ranges:
ffmpeg -i input.wav -af "tremolo=f=50:d=0.8" output.wav