| Crates.io | audiobook-forge |
| lib.rs | audiobook-forge |
| version | 2.9.1 |
| created_at | 2025-12-14 15:59:55.771422+00 |
| updated_at | 2026-01-18 05:53:03.420798+00 |
| description | CLI tool for converting audiobook directories to M4B format with chapters and metadata |
| homepage | https://github.com/juanra/audiobook-forge |
| repository | https://github.com/juanra/audiobook-forge |
| max_upload_size | |
| id | 1984651 |
| size | 471,104 |
A blazing-fast CLI tool for converting audiobook directories to M4B format with chapters and metadata. Written in Rust for maximum performance and reliability.
When downloading audiobooks, they often come as multiple separate MP3 files β one for each chapter or section. While this works fine with audiobook players, managing your library becomes significantly easier when each audiobook is consolidated into a single file.
Audiobook Forge takes those scattered audio files and merges them into a single M4B file (MPEG-4 Audiobook format), which is the standard for audiobook applications.
β Simplified Library Management - One file per audiobook instead of dozens
β Better Metadata & Chapter Support - Embedded chapter markers and complete metadata
β Improved Portability - Transfer entire audiobooks with a single file copy
β Enhanced Playback Experience - Resume exactly where you left off across devices
β Reduced Storage Overhead - Efficient compression while preserving quality
β Universal Compatibility - Works with Apple Books, Audiobookshelf, Plex, and most players
--root parameterIf you find audiobook-forge useful, please consider supporting its development!
Your sponsorship helps:
Every contribution, no matter the size, is deeply appreciated! π
cargo install audiobook-forge
Install required tools:
macOS:
brew install ffmpeg atomicparsley gpac
Ubuntu/Debian:
sudo apt update
sudo apt install ffmpeg atomicparsley gpac
Fedora/RHEL:
sudo dnf install ffmpeg atomicparsley gpac
audiobook-forge check
π Detailed installation guide: See docs/installation.md
# Auto-detect: Run from inside an audiobook folder
cd "/path/to/My Audiobook"
audiobook-forge build
# Or specify the path explicitly
audiobook-forge build --root "/path/to/My Audiobook"
audiobook-forge build --root "/path/to/audiobooks" --parallel 4
# Rename folders with ASINs: "Book Title [B00G3L6JMS]"
audiobook-forge build --root /audiobooks --fetch-audible
# Match existing M4B files with Audible metadata
audiobook-forge match --file "Book.m4b"
# Batch match entire directory
audiobook-forge match --dir /path/to/m4b/files
Replace generic chapter names ("Chapter 1", "Chapter 2") with meaningful titles from multiple sources:
# Update chapters from Audnex API (Audible chapter data)
audiobook-forge metadata enrich --file "Book.m4b" \
--chapters-asin B08V3XQ7LK
# Update from text file (simple, timestamped, or MP4Box format)
audiobook-forge metadata enrich --file "Book.m4b" \
--chapters chapters.txt \
--merge-strategy keep-timestamps
# Update from EPUB table of contents
audiobook-forge metadata enrich --file "Book.m4b" \
--chapters book.epub
# Update chapters only (skip metadata enrichment)
audiobook-forge metadata enrich --file "Book.m4b" \
--chapters chapters.txt \
--update-chapters-only
Supported chapter sources:
Merge strategies:
keep-timestamps: Update names, preserve existing timestamps (default for text/EPUB)replace-all: Replace entire chapter list with new dataskip-on-mismatch: Error if chapter counts don't matchinteractive: Prompt for each file (default)π Complete usage guide: See docs/usage.md
Combine multiple M4B files into a single file without re-encoding:
# Auto-detect sequential parts (Part 1, Part 2, Disc 1, etc.)
audiobook-forge build --root /path/to/book
# Force merge even without detected pattern
audiobook-forge build --root /path/to/book --merge-m4b
Supported naming patterns:
Part 1, Part 2, Pt 1, Pt. 1Disc 1, Disc1, CD1, CD 1, Disk 1Book 01.m4b, Book 02.m4bFeatures:
Comprehensive documentation is available in the /docs directory:
Essential Commands:
audiobook-forge build # Convert audiobook (auto-detect)
audiobook-forge build --root /path # Convert with explicit path
audiobook-forge organize --root /path # Organize library
audiobook-forge match --file book.m4b # Interactive matching
audiobook-forge metadata fetch --asin ID # Fetch Audible metadata
audiobook-forge config show # Show configuration
audiobook-forge check # Verify dependencies
Key Configuration:
performance:
enable_parallel_encoding: true # 3.8x faster encoding
max_concurrent_encodes: "auto"
metadata:
auto_extract_cover: true # Auto-extract embedded cover art (v2.8.0)
audible:
enabled: false
region: "us"
See docs/configuration.md for complete options.
Parallel File Encoding (v2.1.0+):
| Mode | Time | CPU Usage | Speedup |
|---|---|---|---|
| Serial encoding | 121.5s | 13% | Baseline |
| Parallel encoding | 32.1s | 590% | 3.8x faster π |
Test: 10-file audiobook (~276MB) on 8-core CPU
Overall Performance vs Python:
| Operation | Python | Rust v2.0 | Rust v2.1+ | Speedup |
|---|---|---|---|---|
| Startup | ~500ms | ~10ms | ~10ms | 50x |
| Single book (copy) | 45s | 12s | 12s | 3.8x |
| Single book (transcode) | 180s | 65s | 17s | 10.6x π |
| Batch (10 books) | 25m | 8m | 2.5m | 10x π |
| Memory | ~250 MB | ~25 MB | ~25 MB | 10x less |
--parallel 4 or moreaac_at encoder.mp3) - MPEG Audio Layer III.m4a) - MPEG-4 Audio.aac) - Advanced Audio Coding.m4b) - MPEG-4 Audiobook with embedded chapters and metadataConfiguration file: ~/.config/audiobook-forge/config.yaml
# Initialize default configuration
audiobook-forge config init
# Show current configuration
audiobook-forge config show
# Edit configuration
audiobook-forge config edit
Example configuration:
performance:
enable_parallel_encoding: true
max_concurrent_encodes: "auto"
processing:
parallel_workers: 4
skip_existing: true
metadata:
auto_extract_cover: true
audible:
enabled: false
region: "us"
download_covers: true
π Complete configuration reference: See docs/configuration.md
brew install ffmpeg # macOS
sudo apt install ffmpeg # Ubuntu/Debian
chmod -R u+rw /path/to/audiobooks
audiobook-forge build --root /path --parallel 1
π Complete troubleshooting guide: See docs/troubleshooting.md
Contributions are welcome! See CONTRIBUTING.md for guidelines.
git checkout -b feature/my-featurecargo testcargo clippycargo fmtgit commit -m "feat: add my feature"This project is licensed under the MIT License - see the LICENSE file for details.
MIT License Summary:
Made with β€οΈ and π¦ (Rust)