When you have a massive music library in lossless FLAC format and need portable MP3 copies, doing it manually is not an option. flac2mp3 is a clean Python script that recursively finds all FLAC files and converts them to high-quality MP3 using ffmpeg.
Why flac2mp3?
The script uses libmp3lame encoder with -q:a 0 — the highest Variable Bit Rate quality setting. The audible difference from the original FLAC is virtually nonexistent, while file sizes drop dramatically.
Features
Usage
The simplest case — convert all FLACs in the current directory in-place:
python flac2mp3.py
A more advanced real-life example — converting all FLACs from D:\Downloads to D:\mp3s with 4 parallel threads, preserving directory structure:
python flac2mp3.py D:\Downloads\ --output-directory-save-directories-tree=D:\mp3s\ --parallel-run=4
Under the Hood
At its core, the script walks the file system, constructs an ffmpeg command for each file:
ffmpeg -i "song.flac" -c:a libmp3lame -q:a 0 "song.mp3"
And spawns subprocesses to execute conversions, optionally using a thread pool for concurrency.
Prerequisites
The script has zero additional Python dependencies — pure standard library.
https://github.com/zefir1990/flac2mp3