How to Use FFmpeg Phaser Filter for Sweeping Effects
This article provides a quick guide on how to use the
phaser audio filter in FFmpeg to create a sweeping
phase-shift effect. You will learn the syntax of the filter, understand
its key parameters—such as speed, delay, decay, and modulation type—and
see practical command-line examples ranging from subtle sweeps to
intense, space-like modulation.
The phaser filter in FFmpeg splits the input audio
signal, passes one part through a modulating all-pass filter to shift
its phase, and then recombines it with the original signal. This creates
a series of peaks and troughs in the frequency spectrum that sweep up
and down, producing the classic “whooshing” or “jet-plane” effect.
The Phaser Filter Syntax
The basic syntax for applying the phaser filter in FFmpeg is:
ffmpeg -i input.wav -af "phaser=in_gain:out_gain:delay:decay:speed:type" output.wavAlternatively, you can use named parameters for better readability:
ffmpeg -i input.wav -af "phaser=in_gain=0.8:out_gain=0.74:delay=3.0:decay=0.4:speed=0.5:type=triangular" output.wavParameter Breakdown
To customize the sweeping effect, you can adjust the following parameters:
in_gain(default:0.8): Sets the input gain.out_gain(default:0.74): Sets the output gain. Keep this below1.0to prevent digital clipping when the phase-shifted signals recombine.delay(default:3.0): The delay in milliseconds (range:0.0to5.0). This sets the base frequency range of the sweeping sweeps.decay(default:0.4): The feedback coefficient (range:0.0to0.99). Higher values create a more pronounced, resonant, and dramatic “jet” sound.speed(default:0.25): The modulation speed in Hz (range:0.1to2.0). This determines how fast the sweep travels back and forth.type(default:triangular): The modulation wave type. Choosetriangular(ort) for a linear sweep, orsinusoidal(ors) for a smoother, wave-like sweep.
Practical Examples
1. Default Phaser Effect
If you want a standard, moderate phase-shift effect, you can run the filter with its default settings:
ffmpeg -i input.mp3 -af "phaser" output.mp32. Slow, Deep Sweeping Effect
For a dramatic, slow-moving sweep often used on synthesizer pads or
guitars, increase the decay and lower the
speed while using a sinusoidal modulation
type:
ffmpeg -i input.wav -af "phaser=delay=4.0:decay=0.8:speed=0.15:type=sinusoidal" output.wav3. Fast, Metallic Jet Sweep
To achieve a fast, metallic, sci-fi swoosh, increase both the speed
and the decay, and use a triangular wave:
ffmpeg -i input.wav -af "phaser=delay=2.5:decay=0.9:speed=1.2:type=triangular" output.wav