Python-based CLI audio format converter specifically designed for FLAC to MP3 conversions.
- Multi-threaded: Fast conversion using concurrent processing.
- Non-Destructive: Your original FLAC files and directory structure are never deleted or modified. The program creates a completely new output.
- Recursive: Converts files in a directory and its subdirectories.
- Smart: Copies non-FLAC files (images, logs, etc.) to the output directory to preserve album structure.
- Metadata Preserved: Keeps ID3 tags (Artist, Album, Title, etc.) intact during conversion.
pip install flac2mp3-cli- FFmpeg: This tool requires ffmpeg to be installed on your system, see: https://ffmpeg.org/download.html to install guide.
- Python 3.8 or higher is recommended.
Basic Command:
flac2mp3 <input_path>Note: The <input_path> is strictly read-only. The converter creates a new file or directory for the results.
| Flag | Argument | Description | Default |
|---|---|---|---|
| -t | thread_count | Number of threads to use for conversion. | 1 |
| -o | output_path | Directory to save converted files | Input path |
| -b | bitrate | MP3 Quality (1-5). See key below. | 5 (320k) |
| -ow | Overwrite output files if they exist | False |
Bitrate Key:
1: 96k,
2: 128k,
3: 192k,
4: 255k,
5: 320k
- Convert a single file:
flac2mp3 "/music/Artist/Song.flac"Creates Song.mp3 in the same folder of the given input file, in this case is saved in /music/Artist/Song.mp3. The original FLAC remains untouched.
- Convert a directory with 4 threads:
flac2mp3 "/music/MyAlbum" -t 4The output is saved in "/music/MyAlbum_converted"
- Convert to a specific output folder with 192k bitrate:
flac2mp3 "/music/MyAlbum" -o "/mp3_collection/MyAlbum" -b 3If you want to contribute or build the project locally:
- Clone the repository:
git clone https://github.com/rimaout/flac2mp3.git- Install locally:
cd flac2mp3
pip install .This program uses the following Python packages:
Python Packages:
- alive_progress (UI/Progress bars)
- mutagen (Metadata handling)
System Dependencies:
- ffmpeg (Core audio conversion)
Note: see https://ffmpeg.org/download.html for ffmpeg to installation guide.
This program is released under the MIT License. See the LICENSE file for more details.
This project was born out of a personal need. I needed a tool that could convert my extensive library of FLAC files to MP3 format all at once. This would allow me to enjoy my music collection on devices that don't support FLAC.
This is one of my first projects and I'm still learning, so feel free to correct me or suggest improvements.