How to Use FFmpeg Crossfeed Filter
This article provides a quick guide on how to use the
crossfeed audio filter in FFmpeg. You will learn what the
crossfeed filter does, its key parameters, and how to apply it to your
audio files using practical command-line examples to improve your
headphone listening experience.
The crossfeed filter in FFmpeg is designed primarily for
headphone users. Traditional stereo tracks are mixed for speakers, where
both ears hear a portion of both channels. When listening through
headphones, the extreme isolation of the left and right channels can
cause ear fatigue and an unnatural soundstage. The
crossfeed filter solves this by blending a small,
frequency-controlled amount of the left and right channels, simulating
the natural acoustic crossover of listening to physical speakers in a
room.
Basic Syntax and Parameters
The basic structure for applying the filter is:
ffmpeg -i input.mp3 -af "crossfeed=parameter1=value1:parameter2=value2" output.mp3The filter accepts several parameters to customize the soundstage:
strength(ors): Controls the amount of crossfeed (how much of the left channel is mixed into the right, and vice versa). The value ranges from0.0(no crossfeed) to1.0(maximum crossfeed). The default is0.2.range(orr): Sets the cut-off frequency range where the crossfeed effect is applied. Lower frequencies cross over more naturally than higher frequencies. The value ranges from0.0to1.0. The default is0.5.level_in(orli): Sets the input volume level. The value ranges from0.0to1.0. The default is0.9.level_out(orlo): Sets the output volume level. The value ranges from0.0to1.0. The default is1.0.
Practical Examples
1. Apply Crossfeed with Default Settings To apply the filter with its default settings (strength of 0.2 and range of 0.5), use the following command:
ffmpeg -i input.wav -af "crossfeed" output.wav2. Adjusting Crossfeed Strength and Range If you want a more noticeable speaker-like simulation, you can increase the strength and adjust the frequency range:
ffmpeg -i input.mp3 -af "crossfeed=strength=0.4:range=0.6" output.mp33. Adjusting Levels to Prevent Clipping Blending channels can sometimes increase the overall volume and cause digital clipping. You can lower the input level to prevent this:
ffmpeg -i input.flac -af "crossfeed=strength=0.3:range=0.5:level_in=0.8" output.flac