flac2mp3 – Batch FLAC to MP3 Converter

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

  • Recursive search: Walks through all subdirectories, finds every .flac file automatically.
  • Multiple export modes: In-place conversion, mirrored directory tree, or flattened single-folder dump. You can even combine modes in a single run.
  • Parallel processing: Pass –parallel-run=4 to harness multiple CPU cores and speed up batch conversion significantly.
  • Clean handling: Properly handles file and folder names with spaces and special characters.
  • 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

  • Python 3.x
  • ffmpeg installed and available in your system PATH
  • The script has zero additional Python dependencies — pure standard library.

    https://github.com/zefir1990/flac2mp3