HE-AAC v2 is an advanced audio coding format that offers high-quality stereo sound at low bit rates. It is also known as AAC+ or aacPlus v2, and it is a combination of AAC-LC (Low Complexity), SBR (Spectral Band Replication), and PS (Parametric Stereo). HE-AAC v2 is widely used for streaming and broadcasting audio content, such as music, podcasts, radio, and TV.
In this article, we will explain what HE-AAC v2 is, how it works, and how to use it with FFmpeg, a popular open-source tool for encoding and decoding multimedia files.
What is HE-AAC v2
HE-AAC v2 is an extension of HE-AAC, which is itself an extension of AAC. AAC stands for Advanced Audio Coding, and it is a lossy compression format that aims to provide better sound quality than MP3 at similar or lower bit rates. AAC is defined in the MPEG-4 standard, and it supports various profiles and levels for different applications and devices.
HE-AAC stands for High-Efficiency AAC, and it adds SBR to AAC-LC. SBR is a technique that enhances the frequency range of the audio signal by adding high-frequency components that are derived from the low-frequency components. This way, SBR can reduce the bit rate by half without sacrificing audio quality.
HE-AAC v2 adds PS to HE-AAC. PS is a technique that creates a stereo effect from a mono signal by using phase information and spatial cues. This way, PS can further reduce the bit rate by half while preserving stereo sound.
The following diagram illustrates the structure of HE-AAC v2:
Source: Fraunhofer IIS
How does HE-AAC v2 work
HE-AAC v2 works by splitting the audio signal into two parts: a core part and an enhancement part. The core part contains the low-frequency components of the audio signal, encoded with AAC-LC. The enhancement part contains the high-frequency components of the audio signal, encoded with SBR and PS.
The core part can be decoded by any AAC decoder, while the enhancement part requires a HE-AAC or HE-AAC v2 decoder. The decoder then combines the core part and the enhancement part to reconstruct the original audio signal.
The advantage of this approach is that HE-AAC v2 can achieve high-quality stereo sound at very low bit rates, such as 24 kbps or 32 kbps. This makes it ideal for streaming and broadcasting audio content over limited bandwidth networks or devices.
How to use HE-AAC v2 with FFmpeg
FFmpeg is a powerful command-line tool that can encode and decode various multimedia formats, including HE-AAC v2. To use HE-AAC v2 with FFmpeg, you need to compile FFmpeg with libfdk_aac support. libfdk_aac is a library that implements the Fraunhofer FDK AAC codec, which is one of the highest-quality AAC encoders available.
To compile FFmpeg with libfdk_aac support, you need to download the source code of FFmpeg and libfdk_aac from their respective websites. Then, you need to configure FFmpeg with --enable-libfdk-aac and --enable-nonfree options. For more details on how to compile FFmpeg with libfdk_aac support, you can refer to this guide.
Once you have compiled FFmpeg with libfdk_aac support, you can use it to encode or decode HE-AAC v2 files. To encode an audio file to HE-AAC v2 in an M4A container, you can use the following command: ec8f644aee