LinuxCommandLibrary

chdman

Create and verify CHD files

TLDR

Create a CHD from a BIN/CUE pair (CD-ROM image)

$ chdman createcd [[-i|--input]] [path/to/file.cue] [[-o|--output]] [path/to/file.chd]
copy

Create a CHD from a raw hard drive image
$ chdman createhd [[-i|--input]] [path/to/disk.img] [[-o|--output]] [path/to/disk.chd]
copy

Extract (decompress) a CHD back to BIN/CUE
$ chdman extractcd [[-i|--input]] [path/to/file.chd] [[-o|--output]] [path/to/file.cue]
copy

Verify integrity of CHD file
$ chdman verify [[-i|--input]] [path/to/file.chd]
copy

View CHD metadata information
$ chdman info [[-i|--input]] [path/to/file.chd]
copy

Update a CHD file to the latest format version
$ chdman copy [[-i|--input]] [path/to/old_file.chd] [[-o|--output]] [path/to/new_file.chd]
copy

Convert a compressed hard drive image to uncompressed (for editing)
$ chdman extracthd [[-i|--input]] [path/to/disk.chd] [[-o|--output]] [path/to/disk.img]
copy

SYNOPSIS

chdman [options] command [command-options] [arguments]

PARAMETERS

-help or -?
    Display help and exit

-version
    Display version info and exit

-verbose
    Increase verbosity

-quiet
    Suppress non-error output

-createlog <name>
    Create log file

-input or -i <file>
    Input file(s), comma or space separated

-output or -o <file>
    Output CHD file

-compression or -c <codec1[,codec2...]>
    Compression codec(s): zlib, lzma, huffman, flac, etc.

-hunkbytes or -h <bytes>
    Hunk size (4096 default)

-info
    Display CHD metadata

-identify
    Identify disc type

-f or -force
    Overwrite output file

-m or -max
    Set maximum samples per hunk

-swab
    Byte-swap input data

-pc1
    Apply CD P-channel correction

-j <workers>
    Parallel compression workers (v5+)

DESCRIPTION

CHD (Compressed Hunks of Data) is a lossless compression format developed for MAME to store CD-ROM, DVD, and hard disk images efficiently. chdman is the official command-line utility for creating, verifying, extracting, compacting, and inspecting CHD files (versions 1-5). It supports multiple compression algorithms like zlib, lzma, huffman, and lossless audio/video codecs (AV1, FLAC).

Key uses include converting ISO/CUE images to CHD for reduced storage (often 20-50% smaller), verifying file integrity against CRC32/MD5/SHA1 hashes, extracting raw data, updating metadata, and compacting older CHDs to v5 format. Essential for arcade/console emulation ROM preparation. Processes large files sequentially, with progress reporting. Supports raw, session, and multi-track CD handling.

CAVEATS

Processing large discs (e.g., DVDs) is CPU/disk intensive and slow without multi-threading. CHD v5 requires substantial RAM for lzma. Input files must be seekable. No GUI; errors on corrupt input can halt without partial output.

MAIN COMMANDS

createcd -i iso -o chd
createdvd -i img -o chd
createhd -i raw -o chd
verify chd
info chd
extractcd chd -o iso
compact old.chd new.chd

EXAMPLE

chdman createcd -i game.iso -o game.chd -c zlib

HISTORY

Developed by Aaron Giles for MAME ~2003 (CHD v1). Evolved with MAME releases: v3 (2005), v4 (2010), v5 (2014) adding better compression. Now standalone in MAME tools bundle. Maintained by MAMEdev team.

SEE ALSO

mame(6), romcmp(1), split(1)

Copied to clipboard