How to Detect HDCD Audio with FFmpeg

This article explains how to identify High Definition Compatible Digital (HDCD) encoding in audio files using the FFmpeg multimedia framework. By utilizing FFmpeg’s built-in hdcd filter, you can scan your digital audio files—such as WAV or FLAC—to determine if they contain HDCD features like Peak Extend, Low-level Extension, or Transient Filter, without needing to decode and save a new file.

The Detection Command

To analyze an audio file for HDCD encoding, run FFmpeg with the hdcd filter applied and direct the output to a null muxer. This processes the audio and prints the filter analysis to your console without creating an output file.

Run the following command in your terminal:

ffmpeg -i input.flac -af hdcd -f null -

Analyzing the Output

Once the command finishes processing, look at the console output. The hdcd filter will print a summary of its findings at the end of the log.

Look for a section that looks like this:

[Parsed_hdcd_0 @ 0x55bfca9b2b00] Summary:
[Parsed_hdcd_0 @ 0x55bfca9b2b00] HDCD detected: yes
[Parsed_hdcd_0 @ 0x55bfca9b2b00] Peak extend: enabled (hard-coded)
[Parsed_hdcd_0 @ 0x55bfca9b2b00] Transient filter: detected
[Parsed_hdcd_0 @ 0x55bfca9b2b00] Detect source: packet arg

Key Indicators to Look For

To confirm if your file is a true HDCD, evaluate these key lines in the summary: