Audiobook Forge 🎧
A fast, multi-process Rust CLI that orchestrates FFmpeg to convert audiobook directories into single M4B files with chapters and metadata.
Table of Contents
- Why Audiobook Forge?
- Features
- Installation
- Quick Start
- Advanced Features
- Performance
- Documentation
- Contributing
- Support
- License
Why Audiobook Forge?
Audiobooks often come as dozens of separate MP3 files. While that works, managing a library is much easier when each audiobook is a single M4B file (MPEG-4 Audiobook) — the standard format for audiobook players.
Audiobook Forge takes those scattered files and produces one M4B with embedded chapters, metadata, and cover art.
- One file per book — simplified library management and transfers
- Chapter markers — jump between sections, resume where you left off
- Full metadata — title, author, narrator, cover art, all embedded
- Universal playback — Apple Books, Audiobookshelf, Plex, and most players
Features
Performance
- Multi-process encoding — encode files concurrently across all CPU cores (3.8x faster)
- Parallel book processing — convert multiple audiobooks simultaneously
- Copy mode — lossless concatenation without re-encoding when possible
- M4B merge — combine multiple M4B files without re-encoding (v2.9.1)
Audio Processing
- Smart quality detection — automatically matches source audio quality
- Chapter generation — from files, CUE sheets, text files, EPUB, or Audnex API
- Chapter updates — replace generic names with meaningful titles (v2.9.0)
- Cover art extraction — pulls embedded artwork from source files (v2.8.0)
Metadata
- Full tag preservation — artist, album artist, composer, comment, genre, year
- Audible integration — fetch metadata from Audible's catalog across 10 regions (v2.2.0)
- Interactive matching — BEETS-inspired fuzzy matching with confidence scoring (v2.3.0)
Workflow
- Auto-detect — run from inside an audiobook folder, no flags needed
- Batch operations — process entire libraries with a single command
- Error recovery — automatic retry with configurable settings
- Progress tracking — real-time progress with ETA
- YAML configuration — with CLI overrides for everything
Installation
Prerequisites
Rust 1.85 or later is required. Distro-packaged Rust (e.g., Ubuntu 24.04 ships 1.75) is often too old — install via rustup:
|
Install
Runtime Dependencies
Audiobook Forge wraps these tools — install them for your platform:
macOS:
Ubuntu/Debian:
Fedora/RHEL:
Verify
See docs/installation.md for detailed setup instructions.
Quick Start
Convert a Single Audiobook
# Run from inside an audiobook folder
# Or specify the path
Batch Process
With Audible Metadata
# Rename folders with ASINs: "Book Title [B00G3L6JMS]"
Interactive Metadata Matching
See docs/usage.md for the complete command reference.
Advanced Features
Chapter Updates (v2.9.0)
Replace generic chapter names ("Chapter 1", "Chapter 2") with meaningful titles:
# From Audnex API (Audible chapter data)
# From text file (simple, timestamped, or MP4Box format)
# From EPUB table of contents
Merge strategies: keep-timestamps (default for text/EPUB), replace-all, skip-on-mismatch, interactive (default).
M4B Merge (v2.9.1)
Combine multiple M4B files into one without re-encoding:
# Auto-detect sequential parts
# Force merge
Recognizes naming patterns like Part 1, Disc 1, CD1, Book 01.m4b, etc. Chapters are merged with adjusted timestamps and metadata is preserved.
Performance
Encoding Benchmarks
| Mode | Time | CPU Usage | Speedup |
|---|---|---|---|
| Serial encoding | 121.5s | 13% | Baseline |
| Parallel encoding | 32.1s | 590% | 3.8x |
10-file audiobook (~276MB) on 8-core CPU
vs Python (Original Version)
| Operation | Python | Rust (parallel) | Speedup |
|---|---|---|---|
| Startup | ~500ms | ~10ms | 50x |
| Single book (copy) | 45s | 12s | 3.8x |
| Single book (transcode) | 180s | 17s | 10.6x |
| Batch (10 books) | 25m | 2.5m | 10x |
| Memory | ~250 MB | ~25 MB | 10x less |
Tips: Enable parallel encoding (default), use --parallel 4+ for batch jobs, use SSD storage, Apple Silicon benefits from hardware aac_at encoder.
Documentation
- Installation Guide — setup and dependencies
- Usage Guide — commands, examples, and workflows
- Configuration Guide — all YAML and CLI options
- Metadata Guide — metadata management and Audible integration
- Troubleshooting — common issues and solutions
Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Run tests:
cargo test - Run linter:
cargo clippy - Format code:
cargo fmt - Commit:
git commit -m "feat: add my feature" - Push and open a Pull Request
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
If you find Audiobook Forge useful, consider sponsoring its development:
License
MIT License — see LICENSE for details.
Acknowledgments
Built with Rust, Tokio, Clap, FFmpeg, AtomicParsley, and MP4Box/GPAC.