Configure Parametric Stereo for libfdk_aac in FFmpeg

This article explains how to configure and enable Parametric Stereo (PS) using the libfdk_aac encoder in FFmpeg. You will learn the specific command-line options required to activate High-Efficiency AAC Version 2 (HE-AAC v2), which utilizes Parametric Stereo to deliver quality audio at extremely low bitrates, along with practical command examples and configuration requirements.

Prerequisites

To use Parametric Stereo, your version of FFmpeg must be compiled with the external Fraunhofer FDK AAC library. Because this library is incompatible with the GPL, you must use a self-compiled or custom build of FFmpeg configured with the following flags:

How to Enable Parametric Stereo

Parametric Stereo is the core technology behind the HE-AAC v2 profile. To enable Parametric Stereo in FFmpeg, you must explicitly instruct the libfdk_aac encoder to use the HE-AAC v2 profile.

Run the following command to encode an audio file using Parametric Stereo:

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

Command Parameters Explained

Critical Configuration Constraints

When configuring Parametric Stereo, you must adhere to the following audio constraints:

Here is an example of downmixing a multichannel audio file to stereo while applying the Parametric Stereo profile:

ffmpeg -i input_surround.wav -c:a libfdk_aac -profile:a aac_he_v2 -ac 2 -b:a 32k output.m4a