Ch. 12 · Audio Codecs

한국어日本語
8 min

Comparing Lossy Codecs: MP3, AAC (LC/HE), and Opus

Even on top of the same perceptual coding, generations and goals differ. We go through the line from MP3 to AAC to Opus, and HE-AAC's SBR.

Just as video codecs went H.264 → HEVC → AV1, lossy audio codecs have generations too. This lesson compares the three you will meet most often. (AC-3 and FLAC are in the next lesson.)

MP3AACOpus
Formal name / standardMPEG-1 Audio Layer IIIMPEG-2/4 Advanced Audio Coding (ISO/IEC)IETF RFC 6716 (2012)
Aimed atThe universal format for distributing music filesThe successor to MP3. Music and video audio in generalEverything from music to voice calls, with low delay
Frame length (for reference)1152 samples1024 samplesSelectable from 2.5 to 60 ms (default 20 ms)
Internal structureFilter bank + MDCTMDCT-based (improved over MP3)Hybrid of SILK (speech) and CELT (music)
LicensingThe patents are known to have expired (licensing was announced to have ended around 2017)A patent pool exists; licensing depends on the service or productPublished royalty-free

The table summarizes commonly known specifications. This site does not yet have any audio data it measured itself.

AAC: the de facto default for video audio

AAC was designed to deliver better quality than MP3 at the same bitrate, and it is used as the default audio in MP4 files. It has several variants, but there are two you need to know.

  • AAC-LC (Low Complexity): the most common baseline. When someone just says "AAC," this is usually what they mean. Almost every device plays it.
  • HE-AAC (High Efficiency): AAC-LC with SBR (Spectral Band Replication) added. At low bitrates, instead of storing the high-frequency band directly, it sends only a small amount of information saying "build the highs by copying from the lows like this," and the decoder reconstructs them. v2 adds PS (Parametric Stereo), which reduces stereo to mono plus side information.
HE-AAC is for low bitrates

SBR "reconstructs" the highs rather than "restoring" them, so the result is not exactly identical to the original sound. It is known to have an edge over AAC-LC at low bitrates, but the advantage disappears once the bitrate is high enough. Also, the built-in aac encoder in a default ffmpeg build cannot produce HE-AAC; that is only possible in builds that include a separate library such as libfdk_aac.

Opus: the default for the web and real-time audio

Opus is a royalty-free codec standardized by the IETF (RFC 6716). It combines SILK, which is strong on speech, with CELT, which is strong on music, so a single codec covers a wide bitrate range from voice calls to music. Its short frames allow low-delay settings, so it is widely used where delay matters, such as video calls and live streaming. On the video side you meet it as the audio codec paired with WebM (in the VP9/AV1 releases from Chapter 7). Note, though, that Opus processes audio internally at a 48 kHz basis, so a 44.1 kHz source is converted during encoding.

In the field: which one do you pick?

If it has to just play on every device, use AAC-LC. If you are on the web, WebM, calls, or care about royalties, use Opus. There is almost no reason to choose MP3 for new work, but it remains widespread because of compatibility with older devices. As with "a container is not a codec" in Chapter 10, you need to check the codec and the container separately for compatibility problems.

Encoding the same input with three codecs (when your ffmpeg build has the encoder)
# AAC-LC (ffmpeg built-in encoder)
ffmpeg -i in.wav -c:a aac -b:a 128k out.m4a

# Opus (requires libopus)
ffmpeg -i in.wav -c:a libopus -b:a 96k out.opus

# MP3 (requires libmp3lame)
ffmpeg -i in.wav -c:a libmp3lame -b:a 192k out.mp3
AAC-LCAAC-LC (Low Complexity)

AAC's baseline profile. The most widely played form of AAC.

HE-AACHE-AAC (High Efficiency)

An extension that adds SBR (and PS in v2) to AAC-LC to do well at low bitrates.

SBRSpectral Band Replication

A technique where the decoder reconstructs the high-frequency band from the low frequencies.

OpusOpus

A royalty-free IETF-standard codec. Handles speech (SILK) and music (CELT) in one.

MP3MP3

MPEG-1 Audio Layer III. The long-standing standard format for music distribution.

Check yourself

What is the key technique that makes HE-AAC efficient at low bitrates?