Enable SBR in FFmpeg with libfdk_aac

This article provides a quick guide on how to enable Spectral Band Replication (SBR) in FFmpeg using the external libfdk_aac library. By selecting the correct High-Efficiency AAC (HE-AAC) profiles, you can utilize SBR technology to achieve superior audio quality at highly compressed bitrates.

To enable SBR (Spectral Band Replication) in FFmpeg with the libfdk_aac encoder, you must specify a High-Efficiency AAC profile. SBR is not a standalone toggle; instead, it is a core component of the HE-AAC v1 and HE-AAC v2 profiles.

Enabling HE-AAC v1 (AAC-LC + SBR)

HE-AAC v1 combines standard low-complexity AAC with SBR. This profile is ideal for audio bitrates between 48kbps and 64kbps. To enable it, use the -profile:a aac_he flag.

Example command: ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a

Enabling HE-AAC v2 (AAC-LC + SBR + PS)

HE-AAC v2 adds Parametric Stereo (PS) alongside SBR, making it highly efficient for stereo audio at very low bitrates (typically below 48kbps). To enable this, use the -profile:a aac_he_v2 flag.

Example command: ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he_v2 -b:a 32k output.m4a

Important Considerations

  • FFmpeg Build Requirements: The libfdk_aac library is non-free. Your FFmpeg binary must be compiled with the --enable-libfdk-aac and --enable-nonfree configuration flags.
  • Channel Limitations: The HE-AAC v2 profile (aac_he_v2) is strictly for stereo audio. If your input is mono or multi-channel (like 5.1 surround), you must use HE-AAC v1 (aac_he).
  • SBR Signaling: By default, libfdk_aac uses dual-rate SBR with explicit signaling. If you need to change how SBR is signaled to the decoder for compatibility with older players, you can use the -signaling flag with the values default, implicit, or explicit. Standard use cases do not require modifying this setting.