Skip to content

swdunlop/flac2mp3

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Description

This is 1 utility scripts (in src/main) for transcoding flac files into mp3 files keeping covers, tags, and directory structure. It is multithreaded and creates as much thread as the number of cores on the host.

The flac tags will be added to the mp3 files ut8 encoded, and if a cover.jpg file is found in the flac files directory it will be added to the mp3.

The mp3 generated will be itunes compliant (accents, covers) and encoded with lame command : lame --silent -V2 --vbr-new -q0 --lowpass 19.7 --resample 44100

Why another flac2mp3 command ?

Because I didn't find one that included the cover and that did not break my accents on itunes. Cf http://www.barreverte.fr/ou-sont-mes-accents-dans-itunes (sorry, in french). Second because I wanted it to be robust (for example with comments on multiple lines, shell caracters in tags like !*$) and unit tested.

Compatibility and dependencies

It works with linux (with python version >= 2.6.2), MacOS (>= Snow Leopard)

Depends on lame and flac for the runtime.

Depends on eyeD3 for unit testing and developing.

Usage

flac2mp3 [origin directories] mp3/repository/destination

  • If one argument is given it is the destination : it will transcode flac files found under the current directory and put mp3 files in the destination directory with the same directory structure.
  • If more than one argument is given, it will transcode flac files from the given directories to the destination.

for example, if you have :

/path/to/flac/artist1/album1/song1.flac
             |              |song2.flac
             |              |song3.flac
             |              |cover.jpg
             |
             /artist2/album1/song1.flac
                            |song2.flac
                            |cover.jpg
  1. if you do in flac directory : $ flac2mp3.py ../mp3

you'll have :

/path/to/flac/artist1/album1/song1.flac
        |    |              |song2.flac
        |    |              |song3.flac
        |    |              |cover.jpg
        |    |
        |    /artist2/album1/song1.flac
        |                   |song2.flac
        |                   |cover.jpg
        |
        /mp3/artist1/album1/song1.mp3
            |              |song2.mp3
            |              |song3.mp3
            |
            /artist2/album1/song1.mp3
                           |song2.mp3
  1. if you do in flac directory : $ flac2mp3.py artist2 ../mp3

you'll have :

/path/to/flac/artist1/album1/song1.flac
        |    |              |song2.flac
        |    |              |song3.flac
        |    |
        |    /artist2/album1/song1.flac
        |                   |song2.flac
        |
        /mp3/artist2/album1/song1.mp3
                           |song2.mp3

This is a work in progress.

development

To develop and test, use your favorite IDE (mine is pycharm).

With bash to run the test you can do : $ PYTHONPATH=src/main/:src/test/ python -m unittest flac2mp3_test flac2mp3_acceptance_test

About

Script that converts a directory with flac files into another with mp3 files keeping tags, images.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.3%
  • Shell 0.7%