forensics.media Subscribe
Verification

What is double-encoding detection in audio?

By The forensics.media team
5 min read
Contents

A file that was saved to a lossy format, decoded, edited and saved again carries traces of both compressions, and double-encoding detection is the attempt to read that second pass. It matters because a spliced-in segment often carries a different compression history from the audio around it, and because a file’s tags record only its last save. The read is real but narrow: strongest when the second pass is at a higher quality than the first, near chance when the file is recompressed lower, only one layer deep, and wiped by a final re-encode. Whether a file was ever lossily compressed at all is detectable at about 98.6 percent independent of the codec (Hennequin, Royo-Letelier and Moussallam, 2017). This is the audio counterpart to double-JPEG compression analysis in images.

What double-encoding actually is

When audio is saved to a lossy format such as MP3 or AAC, the encoder discards detail it judges inaudible and leaves a quantization structure in what remains. Decode that file, edit it, and encode it again, and the second pass lays its own structure over the first. Double-encoding detection is the effort to see that second layer. Nothing in the bitstream announces it, because there is no double-compressed flag to read, so detection is a statistical inference drawn from the decoded signal, looking for the interference between two quantization grids that a single clean encode would never produce.

Why the read is asymmetric

The single most important fact about the method is that it is not symmetric. Detection is strong when the second compression is at a higher quality or bitrate than the first, and weak when the file is recompressed lower. Across the published detectors, a higher-quality second pass is caught around 99 to 100 percent of the time (Liu, Sung and Qiao, 2010; Bianchi and colleagues, 2014), while a lower-quality recompression falls to roughly 50 to 81 percent, little better than a guess at the bottom of that range. Bianchi and colleagues (2014) localized a tampered region inside a double-compressed MP3 at about 99.9 percent when the second pass used a higher bitrate, and far less reliably when it did not. A spliced-in segment carrying a different compression history from its surroundings is exactly what this asymmetry is used to expose.

How deep can it see

The read is also shallow. Every published detector is a depth-two method: it can tell one compression from two, but nobody reliably counts three or more passes. Recovering the order of a codec chain from a single file is essentially unsolved, dependable only in the narrow case of the same codec at an increasing bitrate across two links, where the first bitrate can be recovered at about 99.9 percent (Bianchi and colleagues, 2014). Cross-family chains, and chains of three or more links, have no trustworthy detector at all.

What a final re-encode does to the trail

This is the method’s hard ceiling. A final same-family re-encode overwrites the earlier evidence, so the chain collapses to a single-compression signature, and only a cross-family or lossless last step preserves the upstream history. The practical consequence for an investigator is that a redistributed or re-saved file reveals far less than an original ever did. What survives best is the coarsest question of all, whether a file was ever lossily compressed, detectable at about 98.6 percent independent of the codec (Hennequin, Royo-Letelier and Moussallam, 2017); the AAC encoder and its bitrate can be estimated at 94.65 percent from only 116 milliseconds of audio, rising to 97.9 percent at two seconds (Seichter, Cuccovillo and Aichroth, 2016).

Can the tags just tell you

It is tempting to skip the signal and read the container tags instead. Those fields do name the encoder: LAME and Xing frames in MP3, the encoder atom and a distinctive atom ordering in MP4, vendor strings in Ogg and FLAC, and when present they name the exact encoder and preset. But they are trivially strippable and forgeable, and any re-encode or even a metadata-only remux destroys them, so they corroborate an untouched file and prove nothing about a processed one. This is why the signal outlives the metadata, a point explored in can audio metadata be faked.

How reliable is it, and what does it prove

Reliability outside the lab is uneven, and the detectors break easily. Frame-aligned statistical detectors are fragile to frame misalignment, dropping to between 47 and 58 percent when the frames no longer line up (Tao and colleagues, 2020), and cross-corpus transfer is brutal: a ResNet-18 codec detector that scored about 99 percent on its own data fell to near zero on a different corpus, while a hand-crafted-feature route fell from about 88 to 63 percent (Moussa, Bergmann and Riess, 2024). Deployed forensic suites such as Cellebrite, Magnet AXIOM and Oxygen report a container-derived format name, not a chain history, and the court-admissibility floor is same-scheme double-encoding only. Read the result as one signal among several, since like every audio trace it weighs a proposition rather than settling it, and there is “no catch-all means of declaring a recording authentic” (SWGDE). For the fuller picture, see what forensics can learn from a recording.

Sources

  • Hennequin, Royo-Letelier, Moussallam (2017). Codec Independent Lossy Audio Compression Detection. IEEE ICASSP 2017.
  • Seichter, Cuccovillo, Aichroth (2016). AAC Encoding Detection and Bitrate Estimation Using a Convolutional Neural Network. IEEE ICASSP 2016.
  • Liu, Sung, Qiao (2010). Detection of Double MP3 Compression. Cognitive Computation 2(4).
  • Bianchi, De Rosa, Fontani, Rocciolo, Piva (2014). Detection and Classification of Double Compressed MP3 Audio Tracks. EURASIP Journal on Information Security 2014:10.
  • Tao, Wang, Yan, Jin (2020). Anti-Forensics of Double Compressed MP3 Audio. International Journal of Digital Crime and Forensics 12(3). DOI: 10.4018/IJDCF.2020070104
  • Moussa, Bergmann, Riess (2024). Unmasking Neural Codecs: Forensic Identification of AI-compressed Speech. Interspeech 2024. DOI: 10.21437/Interspeech.2024-1652
  • Kim, Rafii (2018). Blind Estimation of the Lossy Compression Format of a Signal. European Signal Processing Conference (EUSIPCO) 2018.
  • Scientific Working Group on Digital Evidence (2022). SWGDE Best Practices for Forensic Audio, Version 2.5.
#double-encoding#codec#audio#reliability