A Rust command-line tool for converting Dolby Atmos audio files to multi-channel WAV files on macOS.
- Auto-detect E-AC3 and TrueHD audio formats
- Support 13 different channel configurations from 2.0 stereo to 9.1.6 Dolby Atmos
- Parallel decoding for multiple channels with improved speed
- Sequential decoding mode to save memory
- Optional channel merging to combine mono files into multi-channel WAV
- Automatic cleanup of intermediate files
- Support for local Dolby tools or system-installed Dolby Reference Player
- macOS 10.13 or higher
- Rust 1.70 or higher for building
- GStreamer and Dolby-related plugins and libraries
cargo build --releaseOutput binary is located at target/release/MacinConvert-Atmos-Tool.
The tool requires the following GStreamer related components:
- gst-launch-1.0 - GStreamer command-line tool
- dlbac3parse - E-AC3 format parser
- dlbtruehdparse - TrueHD format parser
- dlbaudiodecbin - Dolby audio decoder
- Related GStreamer plugin libraries
There are two ways to obtain the required GStreamer tools:
Method 1: System Installation
If Dolby Reference Player is already installed on your system, the tool will automatically search for it at the following location:
/Applications/Dolby/Dolby Reference Player.app/Contents
Install from: https://professional.dolby.com/product/media-processing-and-delivery/drp---dolby-reference-player/
Method 2: Local dolby-tools Directory
Place a dolby-tools/ folder next to the executable with the following structure:
<exe_dir>/dolby-tools/
├── gstreamer/
│ └── bin/
│ └── gst-launch-1.0 # GStreamer main program
├── gst-plugins/ # GStreamer plugins directory
│ ├── libdlbac3parse.so # E-AC3 parsing plugin
│ ├── libdlbtruehdparse.so # TrueHD parsing plugin
│ ├── libdlbaudiodecbin.so # Dolby audio decoder
│ └── [other GStreamer plugins]
└── gst-plugins-libs/ # GStreamer plugin dependencies
├── libdlb*.dylib # Dolby library files
├── libgst*.dylib # GStreamer library files
└── [other dependency libraries]
When not specified via CLI/env, the tool looks next to the executable first, then the system Dolby Reference Player.
You can override tool locations via environment variables:
MCAT_GST_LAUNCH: absolute path togst-launch-1.0MCAT_GST_PLUGINS: path to GStreamer plugins dirMCAT_DOLBY_TOOLS: base dir containinggstreamer/binandgst-plugins
Lookup order:
MCAT_GST_LAUNCH+MCAT_GST_PLUGINSMCAT_DOLBY_TOOLS<exe_dir>/dolby-tools- Dolby Reference Player app bundle
GStreamer and related plugins can be obtained from the following sources:
- System package manager (
brew install gstreamer) - Official GStreamer binary releases
- Other applications that include GStreamer
Place the required binary files and libraries in the above directory structure.
./MacinConvert-Atmos-Tool --input file.eac3Default is 9.1.6 (16 channels). Other available configurations:
./MacinConvert-Atmos-Tool --input file.eac3 --channels 5.1Supported channel configurations:
- 2.0 - Stereo
- 3.1 - Left, Right, Center, LFE
- 5.1 - Standard surround
- 7.1 - Extended surround
- 9.1 - Nine channel
- 5.1.2, 5.1.4 - Dolby Atmos (5.1 base)
- 7.1.2, 7.1.4, 7.1.6 - Dolby Atmos (7.1 base)
- 9.1.2, 9.1.4, 9.1.6 - Dolby Atmos (9.1 base)
./MacinConvert-Atmos-Tool --input file.eac3 --output ~/Movies/decodedIf not specified, output files will be in the same directory as the input file.
The program auto-detects the format, but you can also specify it explicitly:
./MacinConvert-Atmos-Tool --input file.eac3 --format eac3
./MacinConvert-Atmos-Tool --input file.thd --format truehd./MacinConvert-Atmos-Tool --input file.eac3 --singleParallel decoding is faster but uses more memory. Sequential decoding processes one channel at a time, saving memory.
./MacinConvert-Atmos-Tool --input file.eac3 --mergeThis option merges all separated mono WAV files into a single multi-channel WAV file.
./MacinConvert-Atmos-Tool --input file.eac3 --merge --cleanupAutomatically delete separated mono files after merging.
Default format: input.01_L.wav, input.02_R.wav, ...
Output without numbers:
./MacinConvert-Atmos-Tool --input file.eac3 --no-numbersOutput format: input.L.wav, input.R.wav, ...
./MacinConvert-Atmos-Tool \
--input /path/to/source_file.mp4 \
--output ~/Movies/decoded \
--channels 9.1.6 \
--merge \
--cleanupThis command will:
- Detect the input file format
- Get the 9.1.6 channel configuration (16 channels)
- Decode all channels in parallel
- Merge into a single multi-channel WAV file
- Delete intermediate mono files
Usage: MacinConvert-Atmos-Tool [OPTIONS]
Options:
-i, --input <INPUT>
Input audio file (E-AC3/TrueHD format; optional in lazy mode)
-o, --output <OUTPUT>
Output file base path (optional, defaults to input directory)
-c, --channels <CHANNELS>
Output channel configuration (default: 9.1.6)
-f, --format <FORMAT>
Input audio format (eac3/truehd, optional, auto-detect by default)
--dolby-tools <PATH>
Specify dolby-tools base directory (contains gstreamer/bin and gst-plugins)
-j, --jobs <JOBS>
Parallel jobs (overrides default and env MCAT_MAX_PAR)
--no-numbers
Output filenames without channel numbers
-s, --single
Sequential decoding of individual channels (saves memory)
-m, --merge
Merge decoded channels into a single multi-channel WAV file
--cleanup
Remove separated mono files after merging
--lazy
Lazy mode: auto batch one file at a time with merge + cleanup
--flac
Convert merged WAV to FLAC format with maximum compression
--keep-wav
Keep the original merged WAV file after FLAC conversion
-h, --help
Show help information
-V, --version
Show version information
Convert merged multi-channel WAV to FLAC format with maximum compression and Dolby channel metadata:
./MacinConvert-Atmos-Tool --input file.eac3 --channels 5.1 --merge --flacFLAC features:
- Maximum compression level (-8)
- Preserves original Dolby channel naming in Vorbis comments
- Channel layout marked as "Sourced from Dolby"
- Supports up to 8 channels (FLAC limitation)
Optional: keep the original WAV file after FLAC conversion:
./MacinConvert-Atmos-Tool --input file.eac3 --channels 5.1 --merge --flac --keep-wavWithout --keep-wav, the original WAV is deleted after successful FLAC conversion to save disk space.
Format: input.01_L.wav, input.02_R.wav, ...
Specifications:
- Sample format: Float32
- Sample rate: 48000 Hz (same as source)
- Number of channels: 1
Format: input.wav
Specifications:
- Sample format: Float32
- Sample rate: 48000 Hz (same as source)
- Number of channels: based on configuration (2-16 channels)
- Channel order: following ITU-R BS.2051 standard
Format: input.flac
Specifications:
- Codec: FLAC (Free Lossless Audio Codec)
- Compression: maximum level (-8)
- Sample format: 24-bit PCM Integer
- Sample rate: 48000 Hz (same as source)
- Number of channels: max 8 (FLAC specification limit)
- Metadata: Vorbis comments including channel layout information
- File size: approximately 15-20% of original WAV size with max compression
Performance example:
- 5.1 channel 16-minute audio: ~244 MB WAV → ~42 MB FLAC (82.8% reduction)
Control logging level with the RUST_LOG environment variable:
RUST_LOG=debug ./MacinConvert-Atmos-Tool --input file.eac3Supported levels: error, warn, info, debug, trace.
Double-click or run the binary with no args, and it will:
- Scan the current directory only (non-recursive), detect E-AC3/TrueHD via headers, and process one file at a time in chronological order.
- For each file, decode with default parallelism (4 by default; tune via
-j/--jobsorMCAT_MAX_PAR) and auto--merge --cleanupwith 9.1.6. - In batch mode,
--outputis treated as an output directory (auto-created), each output named after the input stem.
Equivalent command:
./MacinConvert-Atmos-Tool --lazyYou can point the tool location via:
--dolby-tools <PATH>: base dir must containgstreamer/bin/gst-launch-1.0andgst-plugins.- Environment variables:
MCAT_GST_LAUNCH+MCAT_GST_PLUGINS, or base dirMCAT_DOLBY_TOOLS. - If not set, it tries
<exe_dir>/dolby-toolsthen the system Dolby Reference Player app bundle.
- Using
--singlefor sequential decoding may be slower. - Parallel decoding is faster but uses more memory.
- Decoding speed mainly depends on GStreamer plugin performance.
Use the --single option for sequential decoding to process one channel at a time.
Make sure the output directory has enough disk space. A typical 9.1.6 decode output is 15-20 times the size of the source file.
cargo buildcargo fmt
cargo clippy -- -D warningscargo run -- --input audio/sample_input.ec3 --channels 5.1Issue
On macOS, the Dolby Reference Player's GStreamer plugin only supports decoding the first 8 channels of TrueHD Atmos files. While TrueHD files can contain multiple presentations including 16-channel versions, the macOS plugin cannot access these higher-channel presentations.
Root Cause
The macOS plugin build disables or removes the truehddec-presentation parameter at the implementation level. Although the property exists in GObject metadata, it is not accessible via gst-launch-1.0 command-line or programmatic APIs (PyGObject, Rust bindings).
Impact
- E-AC3 files: fully supported, no limitations
- TrueHD files: only first 8 channels decodable
Workaround
Use the --channels auto option to automatically detect the actual decodable channels in a file:
# Auto-detect available channels
./MacinConvert-Atmos-Tool --input file.mlp --channels autoFor TrueHD Atmos files, this will detect and extract exactly 8 channels. If you need to access all presentations in a TrueHD file, you may need to:
- Use the Windows version of the tools (Windows supports
truehddec-presentation) - Use the Dolby Reference Player CLI to export specific presentations
- Wait for Dolby to update the macOS plugin (unlikely)
MIT License
Sakuzy
- Claude 4.5 Haiku (Anthropic): led the code implementation for this project.
- OpenAI GPT-5 and Codex series: provided code review and quality assurance.
- For research and educational use only — verify local laws and licenses before decoding proprietary formats.
- No Dolby binaries are bundled; you must supply your own tools and ensure you have rights to use them.
- We are not affiliated with Dolby; all trademarks belong to their respective owners.
New features:
- Add FLAC audio conversion support
- Convert merged multi-channel WAV to FLAC format with the
--flacflag - Support the
--keep-wavflag to preserve the original WAV file - Maximum compression level (-8) for optimal file size
- Preserve Dolby channel naming in FLAC Vorbis comments
- Channel layout marked as "Sourced from Dolby"
- Support up to 8 channels (FLAC specification limit)
- 32-bit Float WAV to 24-bit PCM conversion during encoding
- Real-world example: 244 MB WAV → 42 MB FLAC (82.8% reduction)
- Convert merged multi-channel WAV to FLAC format with the
Improvements:
- Add WAV file comment support for merged channels
- Channel configuration is now stored in the WAV INFO/ICOM chunk
- mediainfo and other tools can now read the original channel configuration
- Example comment:
5.1.2 [1: L, 2: R, 3: C, 4: LFE, 5: Ls, 6: Rs, 7: Ltm, 8: Rtm]
- Remove JSON metadata output (replaced by WAV comments)
- Code cleanup and minor optimizations
Initial release with support for:
- E-AC3 and TrueHD format detection
- 13 channel configurations
- Parallel and sequential decoding
- Channel merging and automatic cleanup