Transcoding FLAC to MP3

Having my entire record collection in a fully lossless format with properly scanned cover art has taken some time. Now that it is done I sometimes want to use the music in players that do not support FLAC or where I want to keep down the size of the files.

I have tried a number of existing solutions but none of them worked the way I wanted. Since I keep my music on a headless server I wanted a non-GUI solution. Also, since my main playing environment is based on Slimserver there are a number of features that give other players some headache – one such thing is that many of my genre tags contain multiple genres, separated by semicolon. I also wanted the tagged file to include the cover art and to work on both Windows Media Player and iTunes.

My current solution is based on a Bash script (attached) and includes the following features:

  • Incremental transcoding so it doesn’t have to run through the entire library (which may well take weeks)
  • Ability to skip a certain folder – in my case I have skipped the compilations for now since iTunes makes it messy otherwise
  • Fixes filenames so that they don’t include any non-ASCII characters

To run the script a rather updated Linux version is needed. I first started writing the script on Ubuntu 6.06 (Dapper) but realised after a while that the reason that I just couldn’t get the Unicode characters in the tags to work was not due to me but some bug in the id3lib. Currently I am running this on Ubuntu 7.10 (Gutsy).

Attachments

CD ripping workflow

Since some time back I have moved my entire music library online in a fully lossless format. The idea of ripping the entire library of CDs did not exactly thrill me – especially since I had ripped most of the records already, but in a non-optimal format.

After having carefully studied all alternatives I settled on using the FLAC format to store the music, the main reasons for this was the open source nature of FLAC. Your mileage may vary and for many a fully managed process using Windows Media Player or iTunes may be a better option – if you can live with your music being locked into the respective format.

My music environment includes multiple Slim devices (one Transporter and one Squeezebox) both driven by SlimServer on a Linux server running 24/7. To use this workflow the following applications are required: Exact Audio Copy, FLAC encoder, MP3Tag. In addition an graphics program is benecifical in order to process the cover art.

The step-by-step process I employ to rip a new CD is:

  1. Use Exact Audio Copy (EAC) to rip the CD (my configuration file can be found below). I don’t like the anglo-saxon way of capitalising every word in the song titles so I change them all manually. I also add multiple genres separated by semicolon which works fine with SlimServer but freaks out iTunes and Windows Media Player.
  2. I make sure to save a copy of the log file from EAC to the same folder as the FLAC files.
  3. For multi-record album (and other complex albums) I use MP3Tag to add DISCNUMBER and other information and rename the files so that each file has a three digit number where the first digit indicates the record within the album set.
  4. I then scan the cover of the record and create a 1080×1080 pixel JPG image which is save in the same folder as the files.
  5. Finally, the files are moved to my Linux server where the attached Perl script is used to generate thumb nails. The script requires the presence of ImageMagick on the system which must be installed separately.

Attachments