A fast, parallel OGG to MP3 converter that preserves metadata tags and offers flexible output options.
# Install dependencies
pip install -r requirements.txt
# Basic conversion (in-place)
python ogg_to_mp3_converter.py /path/to/music
# Convert with restructured output (camelCase paths in RS folder)
python ogg_to_mp3_converter.py /path/to/music --restructure
# Convert to custom directory
python ogg_to_mp3_converter.py /path/to/music --output-dir /backup/mp3s
# Convert with post-check and cleanup
python ogg_to_mp3_converter.py /path/to/music --post-check --deleteRequirements: Python 3.7+, ffmpeg, ffprobe
- π Parallel Processing - Multi-threaded conversion for speed
- π·οΈ Tag Preservation - Maintains all metadata (artist, title, album, etc.)
- π Flexible Output - In-place, restructured, or custom directory
- π Smart Skipping - Idempotent (skips already converted files)
- β Post-Check - Verification and optional cleanup
- π Verbose Mode - Detailed debugging information
- π₯οΈ Terminal-Friendly - Proper progress bars and cleanup
- Python 3.7+
- FFmpeg (with ffprobe)
# Ubuntu/Debian sudo apt install ffmpeg # macOS (with Homebrew) brew install ffmpeg # Windows (with Chocolatey) choco install ffmpeg
pip install -r requirements.txtpython ogg_to_mp3_converter.py <folder_path> [options]| Option | Description |
|---|---|
folder_path |
Required. Path to folder containing OGG files |
--bitrate |
MP3 bitrate (default: 320k) |
--threads |
Number of conversion threads (default: auto) |
--restructure |
Output to camelCase structure in RS/ folder |
--output-dir |
Custom output directory (overrides --restructure) |
--post-check |
Verify conversions after completion |
--delete |
Delete original OGG files (requires --post-check) |
--verbose |
Show detailed conversion information |
--dry-run |
Show what would be converted without converting |
Converts OGG files to MP3 in the same directory:
python ogg_to_mp3_converter.py "/music/My Collection"Result:
Music/My Collection/Artist/Album/Song.ogg β Song.mp3
Creates camelCase directory structure in RS/ subfolder:
python ogg_to_mp3_converter.py "/music/My Collection" --restructureResult:
Music/My Collection/Artist Name/Album Name/01 - Song Title.ogg
β Music/My Collection/RS/artistName/albumName/01SongTitle.mp3
Preserves original structure in custom location:
python ogg_to_mp3_converter.py "/music/My Collection" --output-dir "/backup/mp3s"Result:
Music/My Collection/Artist/Album/Song.ogg
β /backup/mp3s/Artist/Album/Song.mp3
Convert, verify, and remove originals:
python ogg_to_mp3_converter.py "/music/My Collection" \
--bitrate 256k \
--post-check \
--delete \
--verboseControl threading and quality:
python ogg_to_mp3_converter.py "/music/My Collection" \
--threads 8 \
--bitrate 192kMP3cator automatically preserves metadata tags including:
- Basic Tags: Artist, Title, Album, Date/Year, Genre
- Advanced Tags: Album Artist, Track Number, Disc Number, Composer
- Additional: Performer, Comment, Lyrics, Copyright
Supported Tag Mappings:
tracknumberβtrack(formatted as "01", "02", etc.)yearβdatepictureβalbumart- And many more...
- Converts files in their original location
- Preserves exact directory structure
- Files:
Song.oggβSong.mp3
- Creates
RS/subfolder in source directory - Converts paths to camelCase
- Example:
01 - My Song.oggβRS/artistName/albumName/01MySong.mp3
- Outputs to specified directory
- Preserves original directory structure
- Overrides
--restructureif both specified
- Multi-threading: Utilizes all CPU cores by default
- Smart Skipping: Only converts new/changed files
- Batch Processing: Handles thousands of files efficiently
- Progress Tracking: Real-time progress with file counts
- Small files (3-5 MB): ~50-100 files/minute
- Large files (50+ MB): ~10-20 files/minute
- Performance scales with CPU cores and disk speed
The --post-check option provides:
- β Verification that all OGG files have corresponding MP3s
- π Summary of conversion results
- ποΈ Optional safe deletion of originals (
--delete)
Safety Features:
- Only deletes when ALL files converted successfully
- Clear warnings before any deletion
- Detailed reporting of any unconverted files
python ogg_to_mp3_converter.py "/music" --verboseShows:
- Tag extraction details
- FFprobe command execution
- File processing steps
- Error diagnostics
"No tags found in source file"
- Enable
--verboseto see tag extraction process - Check if OGG files have embedded metadata
- Verify ffprobe can read the files
"Could not decode file"
- File may be corrupted
- Install vorbis-tools:
sudo apt install vorbis-tools - Check file permissions
Terminal display issues
- Fixed automatically with built-in terminal cleanup
- Progress bars restore cursor and input echo
mp3cator/
βββ ogg_to_mp3_converter.py # Main script
βββ core/
β βββ __init__.py
β βββ converter.py # Single file conversion logic
β βββ finder.py # File discovery and filtering
β βββ postcheck.py # Post-conversion verification
β βββ utils.py # Path utilities and helpers
β βββ constants.py # Application constants
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ .gitignore # Git ignore patterns
pydub- Audio file manipulationtqdm- Progress barsaudioop-lts- Audio processing support
ffmpeg- Audio conversion engineffprobe- Audio metadata extraction
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Run tests (if any)
- Commit:
git commit -am 'Add feature' - Push:
git push origin feature-name - Submit a pull request
This project is open source. Feel free to use, modify, and distribute.
If you encounter issues:
- Check the Common Issues section above
- Run with
--verbosefor detailed logging - Verify ffmpeg/ffprobe installation
- Check file permissions and disk space
Happy Converting! π΅βπΆ