True Peak After Encoding: How Much AAC, MP3, Ogg Vorbis and Opus Raise a Master’s Peaks, Measured

Contents
- What true peak measures
- Which codecs the streaming services deliver
- How the measurement was made
- Loud masters at −1 dBTP mostly lose up to one decibel
- More dynamic masters at −14 LUFS stay almost unchanged
- At −2 dBTP even a loud master stays well below 0 dBTP
- A master with a 0 dBFS sample peak is above 0 dBTP before encoding
- Cross-check: 16-times oversampling shows up to 0.5 dB more
- Why the peaks rise
- What services and standards recommend
- Assessment
- Sources
A master delivered at −1 dBTP almost never reaches listeners in that form. Streaming services play lossy encoded versions, and encoding and decoding change the waveform. Afterwards the peaks can sit above the master’s value. How far depends on the codec and the bit rate, but above all on the master itself.
For this article, two synthetic mixes were processed into four masters each and encoded with ffmpeg to AAC, MP3, Ogg Vorbis and Opus, 88 encodings including the controls. True peak was measured per ITU-R BS.1770-5 before and after encoding. The main result: heavily limited masters at −9 LUFS and −1 dBTP mostly lose up to one decibel of their headroom, while more dynamic masters at −14 LUFS stay almost unchanged.

What true peak measures
A digital signal consists of samples; the signal after the digital-to-analogue converter is a continuous curve. Between two samples this curve can rise above both values; such peaks are called inter-sample peaks. ITU-R BS.1770-5 estimates the maximum of the curve by oversampling the signal four times and filtering it. The result is called true peak and is given in dBTP. Even this measurement reads slightly low: according to EBU Tech 3343, a four-times oversampling meter at 48 kHz can under-read by about 0.5 dB, which is why 1 dB of headroom below 0 dBFS is enough there.
A limiter that only limits sample values therefore does not necessarily hold its ceiling in true peak. The difference already showed during mastering: to reach −9 LUFS at no more than −1 dBTP, the sample ceiling had to sit at −1.59 dBFS (mix) and −2.22 dBFS (bright mix).
Which codecs the streaming services deliver
The major services stream their standard quality in lossy form and offer lossless tiers in addition:
| Service | Lossy | Lossless |
|---|---|---|
| Spotify | App: levels of about 24, 96, 160 and 320 kbit/s, Ogg Vorbis for most tracks according to the developer documentation; web player AAC 128 kbit/s (Free) and 256 kbit/s (Premium) | FLAC up to 24-bit/44.1 kHz (Premium) |
| Apple Music | AAC, at 256 kbit/s according to Apple Digital Masters | Lossless up to 24-bit/192 kHz |
| YouTube Music | AAC and Opus at up to 48, 128 or 256 kbit/s | – |
| Amazon Music | Opus at 48, 192 or 320 kbit/s (SD) | FLAC (HD and Ultra HD) |
| Deezer | MP3 at 64, 128 or 320 kbit/s | FLAC at 1411 kbit/s |
How the measurement was made
- Material: two synthetic mixes of 32 seconds at 120 BPM, generated in Python. The “mix” consists of kick, snare, hi-hats, bass, pads and a lead; the “bright mix” has louder hi-hats and lead and pads up to 12 kHz. Both went through a bus compressor.
- Masters: four versions per mix with ffmpeg’s alimiter. A: −8 LUFS with a sample ceiling of 0 dBFS. B: −9 LUFS at no more than −1 dBTP. C: −9 LUFS at no more than −2 dBTP. D: −14 LUFS at no more than −1 dBTP. Gain and ceiling were adjusted until loudness and true peak matched.
- Encoding: ffmpeg 7.1.5 with the encoders aac (128 and 256 kbit/s), libmp3lame (128 and 320 kbit/s), libvorbis (96, 160 and 320 kbit/s) and libopus (128 and 256 kbit/s). Decoding went to 32-bit floating point so that values above 0 dBFS survive.
- Controls: lossless FLAC, which must not change anything, and plain resampling to 48 kHz, because Opus works at 48 kHz only.
- Measurement: true peak per Annex 2 of ITU-R BS.1770-5 with the 48-tap filter at four-times oversampling, loudness with ffmpeg’s ebur128 filter.
- Cross-check: all files again with 16-times oversampling by ffmpeg’s soxr resampler.
The measurement has limits. The services use their own encoders and settings, Apple for example its own AAC encoder. The material is synthetic, and there is only one piece per variant. The figures therefore show orders of magnitude and relationships, not a guarantee for any particular service.
Loud masters at −1 dBTP mostly lose up to one decibel
Before encoding, the B masters sat at −1.02 dBTP (mix) and −1.05 dBTP (bright mix). After encoding the picture was this:
| Codec | Mix after | Rise | Bright mix after | Rise |
|---|---|---|---|---|
| FLAC (control) | −1.02 dBTP | ±0.00 dB | −1.05 dBTP | ±0.00 dB |
| Resampling to 48 kHz only | −0.85 dBTP | +0.18 dB | −0.76 dBTP | +0.29 dB |
| AAC 128 kbit/s | −0.21 dBTP | +0.81 dB | −0.07 dBTP | +0.98 dB |
| AAC 256 kbit/s | −0.70 dBTP | +0.32 dB | +1.37 dBTP | +2.42 dB |
| MP3 128 kbit/s | −1.09 dBTP | −0.07 dB | −1.39 dBTP | −0.34 dB |
| MP3 320 kbit/s | −0.89 dBTP | +0.13 dB | −0.74 dBTP | +0.31 dB |
| Ogg Vorbis 96 kbit/s | −0.43 dBTP | +0.59 dB | −1.00 dBTP | +0.05 dB |
| Ogg Vorbis 160 kbit/s | −0.57 dBTP | +0.45 dB | −0.31 dBTP | +0.74 dB |
| Ogg Vorbis 320 kbit/s | −1.07 dBTP | −0.05 dB | −0.98 dBTP | +0.07 dB |
| Opus 128 kbit/s | −0.49 dBTP | +0.53 dB | −0.65 dBTP | +0.40 dB |
| Opus 256 kbit/s | −0.65 dBTP | +0.37 dB | −0.75 dBTP | +0.30 dB |
Only three of the 18 lossy encodings stayed at or below the starting value: MP3 128 in both mixes and Ogg Vorbis 320 in the mix. Apart from a single event, true peak rose most with AAC 128, to −0.21 and −0.07 dBTP. Ogg Vorbis 160 and Opus 128 raised the peaks in both mixes by 0.40 to 0.74 dB. The control with plain resampling to 48 kHz showed a rise of 0.18 and 0.29 dB, which the cross-check further down reveals as a measurement effect.
A single encoding went above 0 dBTP: in the bright mix, AAC 256 lifted one spot at 30.5 seconds to +1.37 dBTP. The per-second peaks of the same file had a median of −1.33 dBTP. A single event like this is enough to clip a player, but it comes from ffmpeg’s AAC encoder and cannot be carried over to Apple’s encoder.
MP3 at 128 kbit/s, on the other hand, lowered the peaks and cost 0.4 to 0.5 LU of loudness at the same time; in all other encodings loudness changed by no more than 0.2 LU. The missing top end alone does not explain this. A spectral analysis of the decoded files shows that MP3 128 and Ogg Vorbis 96 contain practically nothing above 17 kHz and AAC 128 nothing above 19 kHz, and it was AAC 128 that raised the peaks the most.
More dynamic masters at −14 LUFS stay almost unchanged
The D masters at −14 LUFS needed hardly any limiting. Before encoding they sat at −1.51 dBTP (mix) and −1.05 dBTP (bright mix). In the mix, nine of the eleven encodings lowered the true peak; the highest value afterwards was −1.48 dBTP with Ogg Vorbis 320. In the bright mix, Opus 128 and MP3 320 rose the most, by 0.21 and 0.19 dB to −0.84 and −0.86 dBTP; all other encodings stayed at −0.97 dBTP or below.
None of the 18 lossy encodings of these two masters therefore went above −0.84 dBTP. The difference from the B masters lies in the limiting: a limiter that pushes many peaks to the same height creates a waveform in which any change by the codec immediately reaches beyond the ceiling.
At −2 dBTP even a loud master stays well below 0 dBTP
Master C of the mix had −9 LUFS at −2.05 dBTP. After encoding the highest value was −0.89 dBTP with AAC 128; all other encodings stayed at −1.57 dBTP or below. This is exactly the headroom Spotify recommends for masters louder than −14 LUFS. For the bright mix, the target could not be reached with the limiter used: even with 40 dB of gain, loudness stayed at −9.2 LUFS, so this master was left out of the evaluation.
A master with a 0 dBFS sample peak is above 0 dBTP before encoding
The A masters were brought to −8 LUFS with a sample ceiling of 0 dBFS. The true peak of these masters was already +0.37 dBTP (mix) and +1.03 dBTP (bright mix) before encoding. After encoding it rose to as much as +2.29 dBTP (AAC 128, mix) and +2.23 dBTP (AAC 256, bright mix). Depending on the codec, the decoded files contained between 14 and 411 samples above 0 dBFS, most of them after Opus 128 in the bright mix.
In 32-bit floating point such values are preserved. AES TD1008, however, points out that players with fixed-point decoders can clip internally, and that operating systems such as Windows turn such overshoots down with built-in limiters by as much as 3 dB.
Cross-check: 16-times oversampling shows up to 0.5 dB more
Four-times oversampling per BS.1770 is a compromise: between the calculated intermediate values the curve can rise even higher. All files were therefore measured a second time, with 16-times oversampling by ffmpeg’s soxr resampler and the peak value from the astats filter.
| Value | BS.1770, 4 times | Cross-check, 16 times |
|---|---|---|
| Master B, mix, before encoding | −1.02 dBTP | −0.80 dBTP |
| Master B, bright mix, before encoding | −1.05 dBTP | −0.54 dBTP |
| Resampling to 48 kHz only, rise (mix / bright mix) | +0.18 / +0.29 dB | −0.01 / ±0.00 dB |
| Master B, encodings above 0 dBTP | 1 (AAC 256) | 2 (AAC 256, Ogg Vorbis 160) |
| Master C, mix, highest value after encoding | −0.89 dBTP | −0.77 dBTP |
| Master D, highest value after encoding | −0.84 dBTP | −0.84 dBTP |
| Master D, mix, before encoding | −1.51 dBTP | −1.66 dBTP |
In the finer measurement, the masters at −1 dBTP therefore sat at only −0.80 and −0.54 dBTP. That matches the under-read of about 0.5 dB that EBU Tech 3343 gives for four-times oversampling meters. In the bright mix, Ogg Vorbis 160 also went above 0 dBTP after encoding, to +0.21 dBTP, alongside AAC 256. The rise from plain resampling, on the other hand, disappeared: in the cross-check the peaks stayed the same, and the four-times measurement merely caught them more accurately after conversion to 48 kHz. For master D of the mix, the four-times measurement even read 0.15 dB higher than the cross-check.
The order of the codecs stayed essentially the same, but individual rises shifted by up to half a decibel. For the statements about masters D and C the cross-check changes little; for the B masters it sharpens the result.
Why the peaks rise
AES TD1008 names several causes. A codec can deliver higher peaks at the decoder output than were present at the encoder input. According to the document, high bit rates around 256 kbit/s sometimes work with a limiter threshold of −0.5 dBTP, but overshoot usually grows as the bit rate drops, so the threshold has to move below the recommended −1.0 dBTP.
Filters contribute as well, because they remove energy from the signal, and filters that are not linear-phase also shift timing. The document works through an example: if every harmonic is filtered out of a square wave, the fundamental remains, and its peak is 2.1 dB higher than that of the square wave. Sample-rate converters change the sample values as well. If they remove energy when converting down, overshoot results, and according to the document it can add to that of the codec.
The measurement supports the bit-rate rule only in part. Opus 128 raised the peaks more than Opus 256 in both mixes, and AAC 128 more than AAC 256 in the mix. With MP3 it was the other way round, and in the bright mix Ogg Vorbis 160 came out higher than Ogg Vorbis 96. The strongest influence was how densely the master had been limited.
What services and standards recommend
- Spotify recommends −14 LUFS integrated and a true peak below −1 dB for masters. For masters louder than −14 LUFS, the help page recommends a true peak below −2 dB, because louder tracks are more susceptible to extra distortion when encoded. Spotify raises quiet masters only as far as 1 dB of headroom remains for the lossy formats.
- AES TD1008 recommends no more than −1 dBTP at the codec input of lossy encoded streams for all content.
- EBU R 128 sets −1 dBTP for production and notes that lower values may apply to distribution systems with data reduction. EBU Tech 3343 gives −2 dBTP for MPEG-1 Layer 2 and Dolby AC-3.
- Apple recommends at least 1 dB of headroom in Apple Digital Masters and advises checking the encoded file with the afclip tool, because levels that show no overs in the PCM master can still clip once encoded.
Assessment
For masters around −14 LUFS, −1 dBTP is enough: in this measurement no encoding went above −0.84 dBTP, and in the mix nine of eleven even lowered the peaks. For loud, heavily limited masters the measurement supports Spotify’s recommendation. At −1 dBTP five encodings came within half a decibel of 0 dBTP and one went above it, two in the cross-check. At −2 dBTP the highest value was −0.89 dBTP, −0.77 dBTP in the cross-check. Because a meter per BS.1770 can underestimate peaks by up to half a decibel, −2 dBTP gives densely limited masters the margin that −1 dBTP did not provide in this measurement. A sample ceiling of 0 dBFS, by contrast, does not make a safe master, because the true peak is above 0 dBTP before encoding.
The most reliable way to see whether a particular master has enough headroom is an encoded test file, for example an AAC or Opus file created with ffmpeg. The LUFS and True Peak Meter reads such files through the browser’s decoder and measures their true peak directly, without the file leaving the device. Because Spotify turns loud masters down anyway, extra loudness at the expense of headroom brings no advantage there.
Sources
- ITU-R BS.1770: Algorithms to measure audio programme loudness and true-peak audio level
- AES TD1008: Recommendations for Loudness of Internet Audio Streaming and On-Demand Distribution
- EBU R 128: Loudness normalisation and permitted maximum level of audio signals
- EBU Tech 3343: Guidelines for Production of Programmes in accordance with R 128
- Loudness normalization – Spotify for Artists
- Audio quality – Spotify
- Media Delivery – Spotify for Developers
- Apple Digital Masters
- Apple Music
- Audio quality settings – YouTube Music Help
- Audio Formats – Amazon Music Developer
- Deezer Audio Quality
- FFmpeg Codecs Documentation