Audiobook Forge 🎧
A blazing-fast CLI tool for converting audiobook directories to M4B format with chapters and metadata. Written in Rust for maximum performance and reliability.
📑 Table of Contents
- Why Audiobook Forge?
- Features
- Installation
- Quick Start
- Documentation
- Performance
- Contributing
- License
🎯 Why Audiobook Forge?
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.
📚 Benefits of Single M4B Files
✅ 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
✨ Features
- 📁 Auto-Detect Current Directory: Run from inside audiobook folders without
--rootparameter - ⚡ Parallel File Encoding: Encode files concurrently for 3.8x faster processing (121s → 32s)
- 🚀 Parallel Book Processing: Convert multiple audiobooks simultaneously
- 🎯 Smart Quality Detection: Automatically detects and preserves source audio quality
- 📖 Chapter Generation: Multiple sources (files, CUE sheets, auto-detection)
- 🎨 Metadata Management: Comprehensive metadata from multiple sources
- 🖼️ Auto-Extract Cover Art (v2.8.0): Automatically extracts embedded cover art as fallback
- 🎭 Interactive Metadata Matching (v2.3.0+): BEETS-inspired fuzzy matching with confidence scoring
- 🎧 Audible Integration (v2.2.0): Fetch comprehensive metadata from Audible's catalog
- 🔄 Batch Operations: Process entire libraries with a single command
- ⚡ Copy Mode: Ultra-fast concatenation without re-encoding when possible
- 🔁 Error Recovery: Automatic retry with configurable settings
- 📊 Progress Tracking: Real-time progress with ETA calculation
- ⚙️ Configuration: Comprehensive YAML-based configuration with CLI overrides
💖 Support This Project
If you find audiobook-forge useful, please consider supporting its development!
Your sponsorship helps:
- 🚀 Active Development: Keep the project maintained and add new features
- 🐛 Bug Fixes: Respond quickly to issues and edge cases
- 📚 Documentation: Maintain comprehensive guides and examples
- 🆓 Free & Open Source: Keep audiobook-forge free for everyone
Every contribution, no matter the size, is deeply appreciated! 🙏
📦 Installation
Quick Install
Dependencies
Install required tools:
macOS:
Ubuntu/Debian:
Fedora/RHEL:
Verify Installation
📖 Detailed installation guide: See docs/installation.md
🚀 Quick Start
Convert a Single Audiobook
# Auto-detect: Run from inside an audiobook folder
# Or specify the path explicitly
Batch Process Multiple Audiobooks
With Audible Metadata
# Rename folders with ASINs: "Book Title [B00G3L6JMS]"
Interactive Metadata Matching
# Match existing M4B files with Audible metadata
# Batch match entire directory
📖 Complete usage guide: See docs/usage.md
📚 Documentation
Comprehensive documentation is available in the /docs directory:
- Installation Guide - Setup and dependencies
- Usage Guide - Commands, examples, and workflows
- Configuration Guide - All configuration options
- Metadata Guide - Metadata management and Audible integration
- Troubleshooting Guide - Common issues and solutions
Quick Reference
Essential Commands:
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.
📊 Performance
Benchmarks
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 |
Performance Tips
- Enable parallel encoding (default in v2.1.0+)
- Use parallel workers:
--parallel 4or more - Enable copy mode: Automatic for M4A/AAC files
- Use SSD storage: Faster I/O for large libraries
- Apple Silicon: Hardware acceleration with
aac_atencoder
🎯 Supported Formats
Input
- MP3 (
.mp3) - MPEG Audio Layer III - M4A (
.m4a) - MPEG-4 Audio - AAC (
.aac) - Advanced Audio Coding
Output
- M4B (
.m4b) - MPEG-4 Audiobook with embedded chapters and metadata
Metadata Sources
- Local: ID3 tags, M4A atoms, CUE sheets, filenames, folder names
- Auto-Extract: Embedded cover art from MP3/M4A files (v2.8.0)
- Audible: Comprehensive metadata from 10 regional stores (v2.2.0)
- Interactive: Fuzzy matching with confidence scoring (v2.3.0+)
⚙️ Configuration
Configuration file: ~/.config/audiobook-forge/config.yaml
# Initialize default configuration
# Show current configuration
# Edit configuration
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
🔧 Common Issues
FFmpeg not found
Permission denied
Out of memory
📖 Complete troubleshooting guide: See docs/troubleshooting.md
🤝 Contributing
Contributions are welcome! See CONTRIBUTING.md for guidelines.
Quick Start for Contributors
- 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
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License Summary:
- ✅ Commercial use
- ✅ Modification
- ✅ Distribution
- ✅ Private use
- ⚠️ Liability and warranty disclaimer
🙏 Acknowledgments
- Original Python version: This Rust rewrite delivers 3-4x better performance
- FFmpeg: The backbone of audio processing
- Rust community: For excellent crates and tooling
- Contributors: Thanks to all who have contributed
Built With
- Rust - Systems programming language
- Tokio - Async runtime
- Clap - CLI framework
- FFmpeg - Audio/video processing
- AtomicParsley - Metadata embedding
- MP4Box/GPAC - MP4 container tools
📞 Support
- Documentation: docs/ folder
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with ❤️ and 🦀 (Rust)