How to Use the bs2b Filter in FFmpeg
This guide explains how to use the Bauer Stereophonic-to-Binaural
(bs2b) DSP filter in FFmpeg to improve headphone listening
experiences. You will learn what the filter does, how to verify that
your FFmpeg build supports it, and how to apply built-in crossfeed
presets or custom parameters to your audio and video files.
What is the bs2b Filter?
Standard stereo tracks are typically mixed for playback on loudspeakers, where the listener's left ear naturally hears sound from the right speaker and vice versa. When listening through headphones, total channel isolation can cause listening fatigue and an unnatural "super-stereo" effect inside the head.
The bs2b filter blends low-frequency information between
the left and right channels with subtle delay and attenuation,
simulating speaker playback in a physical room for a much more
comfortable headphone experience.
Prerequisites
To use this filter, your FFmpeg build must be compiled with the
--enable-libbs2b flag. Verify that your installation
supports it by running:
ffmpeg -filters | grep bs2bIf bs2b appears in the output, your installation is
ready.
Basic Syntax and Presets
The bs2b filter can be applied directly using the audio
filter flag (-af). The simplest implementation uses the
default settings:
ffmpeg -i input.wav -af "bs2b" output.mp3FFmpeg supports built-in profiles designed around popular hardware crossfeed designs:
- default: Standard Bauer setting (700 Hz cutoff, 4.5 dB crossfeed).
- cmoy: Chu Moy crossfeed design (700 Hz cutoff, 6.0 dB crossfeed).
- jmeier: Jan Meier crossfeed design (650 Hz cutoff, 9.5 dB crossfeed).
To use the Chu Moy preset:
ffmpeg -i input.flac -af "bs2b=profile=cmoy" output.flacTo use the Jan Meier preset:
ffmpeg -i input.mp3 -af "bs2b=profile=jmeier" output.mp3Custom Crossfeed Settings
If you prefer to tailor the crossfeed balance manually, omit the
profile parameter and define custom values for
fcut and feed:
- fcut: Sets the low-pass filter cutoff frequency in
Hertz. Valid range is
300to2000Hz. - feed: Sets the crossfeed level in tenths of a
decibel. Valid range is
10to150(representing 1.0 dB to 15.0 dB).
Example with a 750 Hz cutoff and 5.0 dB (value 50) of
crossfeed:
ffmpeg -i input.wav -af "bs2b=fcut=750:feed=50" output.wavProcessing Audio Within a Video File
To apply the bs2b filter to the audio track of a video
without re-encoding the video stream, copy the video codec and re-encode
only the audio:
ffmpeg -i input.mp4 -c:v copy -af "bs2b=profile=cmoy" -c:a aac -b:a 256k output.mp4