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.wav

Alternatively, 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.wav

Parameter 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 below 1.0 to prevent digital clipping when the phase-shifted signals recombine.
  • delay (default: 3.0): The delay in milliseconds (range: 0.0 to 5.0). This sets the base frequency range of the sweeping sweeps.
  • decay (default: 0.4): The feedback coefficient (range: 0.0 to 0.99). Higher values create a more pronounced, resonant, and dramatic "jet" sound.
  • speed (default: 0.25): The modulation speed in Hz (range: 0.1 to 2.0). This determines how fast the sweep travels back and forth.
  • type (default: triangular): The modulation wave type. Choose triangular (or t) for a linear sweep, or sinusoidal (or s) 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.mp3

2. 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.wav

3. 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