Tech Blog‎ > ‎

Converting CD to MP3s with Cover Image – Best Practise & How to

lähettänyt Jukka Niiranen 30.10.2011 klo 9.50   [ 15.1.2013 klo 10.35 päivitetty ]
This autumn I finally decided to take the time and convert my entire CD collection to MP3s. Afterwards I can say that it was a great decision as now the entire collection is once again usable, I can't even remember when I had last time crawled into the cupboard and taken those CDs out from there.

The actual CD ripping took the time it took, you really can't make it happen any faster. But clearly the biggest obstacle at this process was the decision making at the beginning. How and with what tools I should do the job. Thus I decided to write this “Best Practise” / “How to” blog entry, perhaps this can help someone with the same dilemma. At least this will help me to remember how to do this. ;)


What I wanted to do?

When I started I made the following decisions:
  1. I want best possible music quality
  2. I want to be able to listen the music with all devices I have
  3. I want to have the CD cover images available to all music players

Naturally I had to make few compromises to full fill the first and the second decisions. The best possible music quality would have required me to use FLAC format, but that would have not allowed me to listen to the music with all devices.

With “all devices” I mean all phones in our family (Android and Symbian), network media players (WD TV Live HD), media players (Creative ZEN X-Fi Style), car stereos (very important!), laptops (Ubuntu) and most importantly all future additions to this arsenal.

This lead me to choosing MP3 with Variable Bit Rate as the format. Now all I had to do was to figure out how to efficiently add CD cover images to the the ripped MP3s and albums.


CD Cover Images

I was a bit surprised to find out that the ripping software in general wasn't ready to add the CD Cover Images automatically and even more surprised that there really isn't any standard, de facto or otherwise, about the size of the cover images to use.

I did some research in the Internet and also benchmarked some MP3 files sold in the net stores and found out that one could actually use almost any picture size one likes. Majority of the current MP3s sold seem to include cover images embedded with ID3 Tags sized 300x300 pixels. And this seems to be the currently prevailing recommendation of many web sites also.

The major concern with the embedding of the cover images is their impact on the MP3 file size. A cover image sized 300x300 pixels adds about 40-60kB to the file size. My opinion is that this is very acceptable, especially considering that the size of a good quality MP3 file is between 6-8MB. This means that the picture takes less than one percent of the final file size.

I also considered whether I actually should put in larger cover images, but when I tested 300x300 pixel images in different devices, I came to the conclusion that it looks really good and there is no need for larger images.


But... Yes, there is a but!

Even though I had embedded the CD cover images to all files of my test album, some of my devices still were unable to show the cover image when browsing the albums. It seems that some devices look for a separate image file within the album folder and use that as cover image. So I came to a conclusion that one must have both the separate image file and the embedded ID3 tag image.


Final decision about the CD cover images

To make the cover images available to all devices I made a decision to:
  • embed the small 300x300 pixels image to the MP3 files' ID3 Tags and
  • add a larger 1500x1500 pixels (or best available) cover image as a separate file to the album folder
  • all images will be in JPG format
CD Cover Image 300x300 px
The larger image also makes it possible to later on replace the small embedded image with a larger one, should it seem necessary in the future. The practise also showed that vast majority of the cover images available in the Internet are actually a bit smaller than 1500x1500. And my scanner also seemed to produce images sized around 1420x1420 pixels.

Picture: For example, the CD cover image on the right is sized 300 x 300 pixels.


Where to get the CD cover images?

There are many places where you can download the CD cover images. However there aren't that many places that offer really good quality, so most likely you are going to have to do some searching from several places. Here's where I found my images from:

Decisions about the tools for ripping and tagging

There is a huge number of possible software to use for CD ripping and file ID tagging. And at least as many web sites recommending and evaluating these tools. Thus I won't go into details here.

As I'm an Ubuntu user I ended up using Rubyripper for CD ripping and EasyTAG for adding the embedded cover images to ID3 tags. EasyTAG can be installed thru both Synaptic Package Manager and Ubuntu Software Centre so it's just click'n'play. However Rubyripper is a bit of a pain to install but it's well worth the effort. I'll explain the installation in detail later in this document.

It's kind of matter of opinion, but I also decided to exempt my laptop's internal CD drive from the chore of ripping two hundred CDs. And went to the local computer store and purchased a cheap external USB CD/DVD drive to be used in this job. I gathered that it's cheaper this way if the CD drive gets destroyed during the ripping. Luckily nothing of that kind happened and the external LG CD/DVD drive is still live and kicking after the ripping job.


CD Ripping and Tagging Process - In Brief

Here's how the ripping and tagging process went in a nut shell
  1. Launch Rubyripper
  2. Insert CD
  3. Click “Scan Drive” and verify that the disc information is correct
  4. Click “Rip CD Now” and go do something else for 1,5 hours (snogging with wife/girlfriend recommended)
  5. Exit Rubyripper when it's done
  6. Launch EasyTAG
  7. Add small CD cover image to all files / songs in the ripped album folder
  8. Exit EasyTAG
  9. Add large CD cover image to the album folder
  10. Move album folder to appropriate location (to Music folder of your computer and/or network drive)
So that's how it goes. I will explain the process in more detail later in this document.


Finding out your CD drive's Accuraterip Offset

Rubyripper uses a thing called Accuraterip offset value to make the CD drives perform better with the digital audio extraction. The offset and the values seem somewhat confusing and things aren't that well explained at the Accuraterip's web site, but the offset value is easy to find and I guess it won't hurt if you also put this value into the Rubyripper. My guess however is that this really isn't absolutely necessary!

To find the Accuraterip offset value for you specific device please to to this web page: http://www.accuraterip.com/driveoffsets.htm
and locate your CD/DVD drive from the list. Then pick the right offset value from the “Correction Offset” column. You'll need this value when you're setting up Rubyripper for the first time.

If you are unsure about your CD/DVD drive's exact name you can always install “Sysinfo” -tool from Ubuntu Software Centre (Ubuntu's apps service) and pick up the needed information from there. See picture below line “Model” tells you the needed info, which was in my case: “DVD RAM GP10NW20” (the LG's external USB drive). The same information can also be found from the listing console command "dmesg" shows.

Device information provided by Sysinfo
Picture: CD Drive model information provided by Sysinfo.

For my drives the Acccuraterip Offset values where as follows:
HP Laptop:  +6,
VAIO Laptop: +102
External LG USB CD/DVD drive: +6 


Rubyripper Installation and Setup

You can download Rubyripper CD ripping software from there: http://code.google.com/p/rubyripper/downloads/list

This “how to” is written using version 0.6.0. But you should pick the latest version. Download it and open it with Archive Manager. Extract the Rubyripper folder to your hard drive. There is a “Readme” file within the Rubyripper folder, which contains detailed installation instructions.

I used this procedure:
  1. I installed all additional software needed by Rubyripper (dependencies) thru Synaptic Package Manager. According to Rubyripper's instructions needed softwares are: cdparanoia, ruby, ruby-gettext, ruby-gtk2, cd-discid or discid, eject, flac, oggenc, lame, wavgain, vorbisgain, mp3gain and normalize. Many of these were already installed onto my computer and I found the rest rather easily. Only difficulties I had was with “normalize” and “wavgain”, which I wasn't able to find. However I installed “normalize-audio” instead. But missing these two packages doesn't seem to make any major difference. At least I was able to use Rubyripper without them. Please note that installing ruby-gnome2 brings in ruby-gtk2.
  2. To install Rubyripper I opened the console, moved to Rubyripper's folder and said the following commands:

    ./configure --enable-lang-all --enable-gtk2 --enable-cli --prefix=/usr

    sudo make install

  3. That's it. Now you can launch Rubyripper either from Applications / Sound & Video menu, or thru console by typing in “rrip_gui
When Rubyripper starts you get the following screen.

Rubyripper just started
Picture: Rubyripper has just started.

At the first run you should have a look at the settings by clicking the “Preferences” button.

On the “Secure Ripping” tab you should pay attention to the following: (See picture below)

Cdrom device:

  • Type in the mount point of your cd rom device. Most likely the default value points towards your main / internal cd rom drive, and it works out-of-the-box. But if you want to use another drive, or like me, an external usb drive then you'll have to change this value. One approach is to use trial-and-error method and just type in consecutively “/dev/cdrom2”, “/dev/cdrom3” etc. and click the “Scan drive” button in between every try. Do remember to put an audio CD into the drive before you try this. More intellectual way to figure out the mount point of you cd rom drive is to for example open System Monitor (from System / Administration menu) and pick the information up from there. (see picture below). Or you can also open a console and type in “df”. The listing will show your file systems and you should be easily able to figure out which one is the cd drive. Please note that you need to have a data disc inserted into the cd drive in both cases, you cannot do this with audio disc! If there are too many possibilities, eject the cd and compare the lists to see which file system disappeared.
System Monitor view
Picture: Finding the device with System Monitor.

Finding out the cd rom mount point
Picture: Finding the device with console.

For example, in my case, the mount points were:
Vaio's internal CD drive: /dev/cdrom OR /dev/sr0
Vaio's external USB CD drive: /dev/cdrom4 OR  /dev/sr1

Cdrom offset:
  • Type in the Accuraterip offset value of your cd rom drive here. See the text above about how to acquire this value.
Ripping options:
  • These options guide Rybyripper about how many times you want it to try to read a bad CD before giving up and how many times you want the read chunks to match. Rubyripper divides the songs into thousands of very short chunks and reads these chunks numerous times. If the read chunks match then we can assume that the CD was read right and the music plays correctly. My experience showed that matching chunks just twice is quite enough. Note that more times the chunks are read, more time the ripping will take. Please note also that you have to put in some number to the field “Maximum trials”, because if you put “0=unlimited” you might end up in a situation where Rubyripper says that there is only one chunk left to match and it just keeps on re-reading that chunk. If you then the click “Abort” button, you will lose all read chunks! So I recommend the values “2”, “2” and “50” as in the picture below.

Rubyripper secure rip tab
Picture: Rubyripper's Secure Ripping tab

On the “TOC analysis” tab:
  • Make sure the “Rip hidden audio sectors” is ticked.
  • I had to remove the tick from “Create cuesheet” because when it was ticked I had major problems with some CDs. For example while ripping one CD the first 8 tracks went nicely but  the ripping stopped on the 9th track with an error: "Cdparanoia doesn't output wav files".

Rubyripper toc analysis tab
Picture: Rubyripper's TOC analysis tab

On the “Codecs” tab:
  • As my goal was to create high quality MP3s I removed the ticks from all other codecs and just left the one at “Lame MP3”.
  • To create the best possible quality MP3s with Variable Bit Rate I used the following option: “-V 0 --vbr-new
  • Naturally the tick at “Create m3u playlist” box makes Rubyripper automatically create playlists for every album ripped. This is a good idea to do, as some of the mp3 players and mobile phones require playlists, if you want to listen to entire albums.
Rubyripper codecs tab
Picture: Rubyripper's Codecs tab

I didn't see it necessary to change anything on the “Freedb” or “Other” tabs. I just left them to their default values. You can control the MP3 file and folder naming scheme and file locations on the “Other” tab.

You can find more on the Rubyripper settings from here: http://filesharefreak.com/tutorials/rubyripper-native-secure-cd-ripping-on-linux/


EasyTAG Installation and Setup

EasyTag is a software which can be used to modify the ID3 tags within the MP3 files. ID3 tags hold information about the song, album, artist and so on. And you can embed the CD cover image to the MP3 files using these tags.

Installation is very straight forwards. You can find EasyTAG from both Ubuntu Software Centre and Synaptic Package Manager. Just click install on either one and that's it!


Ripping CD with Rubyripper - In Detail

Ripping CDs is very easy and relative fast thing to do when all settings are done (see above). Here's the procedure:
  1. Open Rubyripper
  2. Insert an audio CD to be ripped
  3. Wait a second while Rubyripper recognizes the CD. Click “Scan drive” button if needed.
  4. If the CD can be found Internet's databases Rubyripper will soon show you the album and song information. If the CD is not found, then you'll have to type in the information by hand. If the CD information can be found from the databases, remember still to check that the information is correct. There seems to be some variation about song order and lots of typos!
  5. When you are satisfied with the CD information then just click “Rip cd now!” button. Now Rubyripper will create you a folder containing the MP3s. The ripping of a standard audio CD takes from 1 to 1,5 hours.
  6. When the ripping is done you can either “Exit” or put in another CD and click “Scan drive” to start again.
Rubyripper Disc Info
Picture: Rubyripper's Disc Info view


Tagging and Adding CD Cover Images with EasyTAG - In Detail

Rubyripper tags artist, album and song names as well as music genre and publishing year automatically to all MP3s it makes. If you want to later change this information, add more information or add CD cover images to MP3 files, you can use EasyTAG. Using EasyTAG is unfortunately not very intuitive, but when you get the idea, it's pretty fast.

  1. Here's the procedure how to add CD Cover Images to MP3 files using EasyTAG:
  2. Open EasyTAG
  3. From the left most area titled “Tree”, click open the folder that contains the MP3s you want to edit. (see the picture below, area “A”)
  4. The MP3 files of that folder are now shown in the middle area. (see the picture below, area “B”)
  5. Select all MP3 files in the folder. Now you indicate that you want to change some property of all these chosen files. You can do this by clicking the first song and then pressing down Shift button and clicking the last song.
  6. From the right most area titled “ID3 Tag” click the “Pictures” tab. (see the picture below, area “C”)
  7. To add a CD cover image click the green PLUS -sign. (arrow in the picture below) Locate the picture from your hard drive.
  8. Double click the cover image in the “Pictures” field. This opens a new window “Picture Properties”. Choose Picture Type by clicking the text “Cover (front)” and click OK. (see the smaller picture below)
  9. Click the tiny radio button on the right hand side of the “Picture” field. This applies the picture to all MP3 files you chose earlier. (arrow in the picture below)
  10. Click the hard drive icon at the top of the window. This writes the changes to the disk. (arrow in the picture below)
  11. You are done. Now either close EasyTAG or start again from the item 2.

EasyTAG Screenshot
Picture: EasyTAG main screen
EasyTAG Picture Properties
Picture: EasyTAG Picture Properties


If you wish to edit other ID Tags, you can do so on the Common tab. Always first choose the MP3 files from the central “Area B”, which you want to edit. And then make the changes under the Common tab and click the small radio button on the right hand side of each field you change. Finally remember to click the hard drive icon to write the changes to the disk.

EasyTAG ID area
Picture: EasyTAG ID3 area's Common tab


Special Cases

Some times it happens that Rubyripper just doesn't get thru some song. This might be due to scratched CD for example. In these cases Rubyripper seems to do worse job than other possible ripping software as it still tries to combine the ripped chunks and thus ends up with silent gaps in the final ripped MP3 file. I decided to make a compromise in these few cases and just copy the wav file directly from the CD and then convert that file into a MP3. Another option would be to use some other ripping software that doesn't care for reading errors. Using WAV to MP3 conversion I was able to create equal quality MP3s minus, of course, the unrepairable CD reading errors. Here is the command I used:

Convert WAV to MP3

lame -V 0 --vbr-new input.wav output.mp3


Where “input.wav” is the name of the WAV file and “output.mp3” is the name of the MP3 file after the conversion.
Read more about this from here: http://askubuntu.com/questions/59520/how-to-convert-wav-to-ogg-and-mp3-using-vbr

I also had another special case. Some of my music was already in FLAC format. To convert these files into MP3s, again with equal quality as the ripped CD, I used this command:

Convert FLAC to MP3

for file in *.flac; do flac -cd "$file" | lame -V 0 --vbr-new - "${file%.flac}.mp3"; done

Read more about this from here: http://www.linuxtutorialblog.com/post/solution-converting-flac-to-mp3

Create Playlist Manually
Rubyripper – as propably all ripping softwares – automatically creates a playlist for all ripped CDs. If you'll have to do manual converting of WAVs and/or FLACs to MP3s you'll also have to create or edit the playlist files.

Luckily the playlist files are really really simple. All they are, is a simple list of file names, nothing else. The quickest way to manually create a playlist is to open console and type in the following command when you are in the folder containing the MP3 files:

ls > filename.m3u

You will probably want to name the playlist “filename.m3u” according to the band and album names. In my case the playlist file names are like this: “The Corrs - Forgiven, Not Forgotten (mp3).m3u”. I just adapted the naming format from the Rubyripper. Note: the comma in the file name might create problems in some cases, but I didn't face any problems with any of my devices.

The playlist files are just normal text files that can easily be edited with any text editor. The above command lists all files in that folder to the playlist file. After running the command you do have to edit away all other files (lines in the text file) but the MP3 files. After this the playlist works perfectly. It's really quick and easy.


Final words

Do not copy! Support the artists and software vendors. Rip only the CDs you own! And use open source or use money to buy the software!

Never ever buy music in WMA format as it might be broken with DRM and most likely will not play in any of your devices! Burning CDs out of DRM broken WMAs is not a solution - it's just idiotic!


Comments