Mediaripper - Automatically Rip Audio CDs to MP3s

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 14:42, 27 December 2006 by Davy gravy (Talk | contribs) (MP3/AAC Encoder)

Jump to: navigation, search

Credit and Origin of this Idea

Mediaripper is the creation of B. Waite, a member of the Kurobox Forum. [1] [2] It was an entry in a contest at that site. If you ever have a chance, tip your hat to him for his contribution to all LS and Kurobox users. It is an excellent concept and works well.

What does it do?

Mediaripper does several things automatically:

  • insert an Audio CD into an attached USB/IDE CDROM drive/burner and it will rip the individual tracks to MP3 format, storing them where you configure it to, then auto-ejects the CD,
  • insert a USB mass storage device and it will search for image files (jpeg, png, etc.) and it will store those files to your chosen destination, and
  • insert a USB mass storage device and it will search for video files (xdiv, mpg, wmf, etc.) and it will store those files, also.

There is a DVD-ripping option that may be implemented in the future, but it is not currently functional.


  • LS1 or HG (not yet tested on the LS2)
  • Debian/FreeLink and a 2.6 Kernel
  • USB/IDE CDROM drive or burner (for MP3 ripping)
  • other USB mass storage devices (for image or video gathering)


Mediaripper Binaries

From the Kurobox site, download the Mediaripper Package and install it:

tar xzvf mediaripper.tgz
update-rc.d mediaripper defaults 

This downloads the package, unarchives it, and sets up the symlinks for the startup script. What is included in this tarred package? Here are the contents and their destinations/locations, with a description of each group:

#  Three executable scripts and a configuration file that form the backbone of the application
#  A Webmin module 
# A startup script for Mediaripper  

Debian Packages

Install (from Debian stable):

apt-get install udev usbmount eject cdparanoia cddb libcddb2 cd-discid id3v2 

Many of these packages are automatically installed if you have run the FreeLinkomatix script.

Install (from Debian testing)

apt-get install abcde

This package (abcde - A Better CD Encoder) is responsible for coordinating the access of the audio CDs, queries to the CDDB database, ripping .wav files from the CDs, and encoding those files to .mp3 format. Read the man pages of abcde for more information on this particular package and its back-end requirements. abcde has a configuration file in


where you can tailor it to your specific wants and needs. You can choose other encoders, for instance, and customize its behavior. This conf files is fairly well commented and is readable.

MP3/AAC Encoder

There are at least two options here (you choose):

  • For excellent compatibility (including Roku devices), install the LAME encoder At the time of writing this article, the current version of LAME was 3.97, and (in FreeLink/Debian) it compiled out-of-the-box.
cd /
tar xzvf lame-3.97.tar.gz
cd ./lame-3.97
make install

  • For faster, less compatible encoding (actually .mp2, strictly speaking), you can use toolame, which is available as a Debian (stable) package
 apt-get install toolame
  • For AAC,Ogg Vorbis or other encoding, choose and install the encoder of your liking. Read the documentation in the /etc/abcde.conf file or in the abcde man pages for details on encoder support. Note that this will require some editting of the script.

Add Directories for MP3s, Images and Videos

After you have installed both the Mediaripper binaries and satisfied all dependencies, you now have to set up directories for processing and storage of the MP3s, images and videos. A great place to put these is in your data partition, which is probably in hda3 (instructions below assume this - adjust to your own setup as necessary). It is also good to place these in your Samba share, as it will make it easier to work with them from a Samba, NFS or AppleShare interface (we will assume this is in /mnt/share).

cd /mnt/share
mkdir rippedmp3s
chmod 777 rippedmp3s
mkdir images
chmod 777 images
mkdir videos
chmod 777 videos

The above commands (mkdir) create the directories and (chmod) make sure the will have unfettered access by any Samba user that attaches to your share(s). If privileges or security are a concern for you in this area, then you can adjust this to your situation.

Take note of the location of these directories, as you will have to specify them to the configuration file for Mediaripper.



For Mediaripper to function, it needs to know where to do its processing and store the finished MP3 & M3U playlists, images and videos. This information is specified in


and peeking at its structure, one can see there are obvious variables that one can supply values to, such as:

INTERVAL=60                                #how often ripper checks for Audio CD (music), USB Mass Storage (images or video)
IMGDIR="/mnt/share/images"                 #set this to the location where you want to store your images
VIDDIR="/mnt/share/videos"                 #same for videos
MUSICDIR="/mnt/share/rippedmp3s"           #same for MP3s
IMGTYPES="jpg bmp gif"                     #extensions for images
VIDTYPES="xvid mpg wmf"                    #extensions for video files
MUSICTYPES="ogg mp3 wav flac"              #extensions for music

Use nano or your favorite editor to make this file reflect where you want each kind of files to be kept. These locations must agree with the three directories that you set in in the installation phase above.

via Webmin

While the originator of this article (davy_gravy) was unable to get the Webmin module to function, it may be just a minor tweak or permission change that is necessary.

Anyone who figures out how to get the Webmin module for Mediaripper working should consider this an invitation to share how they did this.  :^)

Troubleshooting and Behavior

If Mediaripper is working properly, you really should be able to just pop an audio cd in the usb cdburner, close the tray, wait for a few seconds (up to 60 seconds) for to sense that there is work to be done (tunes to be ripped), and the drive should whir into action. For me, it seems like it is ripping between 1.5x to 3x, roughly. When it is done, it the tray will eject/open automatically.

For me to get it to work, I had to either create symlinks for or copy, and to /usr/bin. Although I tinkered with it for quite a while, I just could not get it to work (automatically) without this step. If


is in your $PATH, then it should work without the symlinks.

Check dmesg and /var/log/ripper for pertinent log or error messages, if you have problems. You can also try running from the command line to get a feel for what it is doing.


LinkStationwikinet Forum Thread by member Francis Schmidt RE "Changing Everything - MP3 Ripper/Server:

  1. B. Waite's original Kurobox contest page
  2. Linkstationwiki Forum Discussion Thread "Mediaripper and Audio CD Stuff"