How to Use FFmpeg apulsator Filter for Auto-Pan
This article explains how to use the apulsator filter in
FFmpeg to apply dynamic auto-pan effects to your audio files. You will
learn the core parameters of the filter—such as frequency, amount, and
modulation mode—and how to implement them using practical command-line
examples to shift audio seamlessly between the left and right stereo
channels.
Understanding the apulsator Filter
The apulsator filter is an audio channel modulator that
alters the volume of the left and right channels over time. This creates
a psychoacoustic “panning” effect, making the sound feel as though it is
physically moving back and forth between the left and right speakers or
headphones.
Key Parameters of apulsator
To customize the auto-pan effect, you can configure several parameters:
hz: Defines the frequency of the panning modulation in Hertz (cycles per second). The default is2Hz. Higher values create faster panning, while lower values make the pan slower and more gradual.amount: Controls the modulation depth (range0.0to1.0). A value of1.0(default) means full panning (completely left to completely right), while lower values keep the sound closer to the center.mode: Sets the waveform shape of the modulation. Options includesine(smooth transition),triangle(linear transition),square(instant switching),sawup, andsawdown. The default issine.offset_landoffset_r: Sets the left and right channel phase offsets (range0.0to1.0). By default,offset_lis0.0andoffset_ris0.5, which creates the alternating left-to-right effect.width: Sets the stereo width (range0.0to2.0). The default is1.0.
Practical FFmpeg Command Examples
1. Basic Auto-Pan Effect
To apply a standard, smooth sine-wave pan at a rate of 1 Hz (one full cycle per second):
ffmpeg -i input.mp3 -af "apulsator=hz=1" output.mp32. Fast, Intense Panning with Triangle Wave
If you want a sharper, faster transition back and forth, you can increase the frequency to 5 Hz and change the modulation mode to a triangle wave:
ffmpeg -i input.mp3 -af "apulsator=hz=5:mode=triangle:amount=0.8" output.mp33. Subtle Ambient Panning
For a subtle spatial effect where the sound gently drifts without fully silencing either channel, lower the modulation amount and frequency:
ffmpeg -i input.mp3 -af "apulsator=hz=0.3:amount=0.4" output.mp3