summary

To almost quote Wikipedia, ripping is the process of copying input audio or video content (typically from an optical disc such as a CD or DVD) and outputting to a "normal" storage filesystem. Ripping is typically more difficult than simple file copying (as when copying files from a flash drive or external hard drive) in that

Hence ripping audio or video involves at least 3 separate problems:

  1. reading the optical disc
  2. writing to the desired output format
  3. gathering (or authoring) metadata

Fortunately we Debian users have access to many services and software packages to assist us with these problems.

ripping audio CDs

Popular CD rippers with Debian builds include

TODO:

ripping audio CDs with pacpl

pacpl will rip tracks from the current disc to any of several supported formats with commandlines like

pacpl --rip all --to flac
pacpl --rip 1,3,9,15 --to mp3

Install package=pacpl and read info pacpl (especially section=RIPPING OPTIONS).

ripping audio CDs to MP3s with Sound Juicer

wheezy

If you want to rip audio CD's to MP3's with Sound Juicer, install the gstreamer0.10-plugins-ugly package:

apt-get install gstreamer0.10-plugins-ugly

squeeze

If you want to rip audio CD's to MP3 files with Sound Juicer, you want to have the "gstreamer0.10-lame" package from, e.g., www.deb-multimedia.org.

# Type these commands for amd64 machines.
wget http://www.deb-multimedia.org/pool/main/g/gst-plugins-ugly/gstreamer0.10-lame_0.10.17-0.0_amd64.deb
dpkg -i gstreamer0.10-lame_0.10.17-0.0_amd64.deb

# Type these commands for i386 machines.
wget http://www.deb-multimedia.org/pool/main/g/gst-plugins-ugly/gstreamer0.10-lame_0.10.17-0.0_i386.deb
dpkg -i gstreamer0.10-lame_0.10.17-0.0_i386.deb

ripping audio CDs to MP3s with abcde

abcde (A Better CD Encoder) is a performant and reliable commandline tool for ripping audio CDs which can be installed from package builds. For much more information about abcde, see

Following is a simple example of installing and using abcde to rip an audio CD to MP3 files (one per track), retrieving metadata with MusicBrainz:

install abcde

Install abcde from packages with your favorite manager, or from source.

package install

As of Jessie, abcde recommended several packages:

$ sudo aptitude -s install abcde
The following NEW packages will be installed:
abcde cd-discid
The following packages are RECOMMENDED but will NOT be installed:
bsd-mailx heirloom-mailx libmusicbrainz-discid-perl libwebservice-musicbrainz-perl mailutils

Because

I installed as follows:

$ sudo aptitude -s install abcde cd-discid eyed3 libmusicbrainz-discid-perl libwebservice-musicbrainz-perl
The following NEW packages will be installed:
abcde cd-discid eyed3 libdiscid0{a} libmusicbrainz-discid-perl libwebservice-musicbrainz-perl python-eyed3{a}
The following packages are RECOMMENDED but will NOT be installed:
bsd-mailx heirloom-mailx mailutils
0 packages upgraded, 7 newly installed, 0 to remove and 3 not upgraded.
...
$ sudo aptitude -y install abcde cd-discid eyed3 libmusicbrainz-discid-perl libwebservice-musicbrainz-perl

configure abcde

abcde has many configuration options! As Andrew Strong notes, "abcde can be operated purely from the commandline but it is much easier to run the program from a configuration file." If you use /etc/abcde.conf or $HOME/.abcde.conf, you can run abcde simply with that commandline; alternatively, I prefer

$ date ; abcde -c ~/.config/abcde/abcde-MP3.conf ; date

See Strong's example/template abcde.conf files for

output filetype

The key configuration options is OUTPUTTYPE, which will in turn drive choice of encoder with, e.g., MP3ENCODERSYNTAX.

metadata source

Metadata source (or retrieval method) is specified with configuration option=CDDBMETHOD. As noted above, you may need to install libraries to support your desired metadata source.

rip an audio CD to MP3s with abcde and MusicBrainz

My current ~/.config/abcde/abcde-MP3.conf closely follows Strong's example/template MP3 abcde.conf:

### adapted from http://www.andrews-corner.org/abcde.html#mp3 by Andrew Strong
# > Best to note here as well that with abcde 2.6 tagging is done using eyeD3 which is a significant change from older versions of abcde. I use eyeD3 0.7.5 and it has given me no trouble at all, eyeD3 versions less than 0.7.0 will have issues with abcde 2.6 at the moment.

# ...

# > The most obvious area to change is the MP3 encoding options but you will find that the example above will deliver perfectly acceptable sound on most systems.For those who want the maximum possible bitrate you could always try a slightly crazy -V 0 which gives between 220-260 kbits/s or better still read the Hydrogen Audio page on lame options

# http://wiki.hydrogenaud.io/index.php?title=LAME

# >  and go from there. Tagging is done post-encoding so options can be added to EYED3OPTS in this abcde.conf file if you wish.

COMMENT='abcde version 2.5.4' # `abcde -v` as of 8 Feb 2015. TODO: keep me in sync with updates!

# Specify the method to use to retrieve the track information: consider setting 'musicbrainz' instead, which is my own preferred option
# CDDBMETHOD=cddb
CDDBMETHOD=musicbrainz

# Specify the encoder to use for MP3. In this case the alternatives are gogo, bladeenc, l3enc, xingmp3enc, mp3enc
MP3ENCODERSYNTAX=lame

# Specify the path to the selected encoder unless it's in your path.
LAME=lame

# Specify your required encoding options here. Multiple options can be selected as '--preset standard --another-option' etc.
# The '-V 2' option gives VBR encoding between 170-210 kbits/s.
LAMEOPTS='-V 2'

# Output type for MP3.
OUTPUTTYPE="mp3"

# The CD-ripping program to use. There are a few choices here: cdda2wav, dagrab, cddafs (Mac OS X only) and flac.
CDROMREADERSYNTAX=cdparanoia

# Give the location of the ripping program and pass any extra options:
CDPARANOIA=cdparanoia
CDPARANOIAOPTS="--never-skip=40"

# Give the location of the CD identification program:
CDDISCID=cd-discid

# Give the base directory/folder for output
OUTPUTDIR="$HOME/music/downloaded"

# The default actions that abcde will take.
ACTIONS=cddb,playlist,read,encode,tag,move,clean

# Decide here how you want the tracks labelled for
# * a standard 'single-artist', multi-track encode
#OUTPUTFORMAT='${OUTPUT}/${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM}_${TRACKFILE}'
#${OUTPUT} == 'mp3'
OUTPUTFORMAT='${ARTISTFILE}/${ALBUMFILE}/${TRACKNUM}_${TRACKFILE}'
# * a multi-track, 'various-artist' encode:
VAOUTPUTFORMAT='Various-${ALBUMFILE}/${TRACKNUM}_${ARTISTFILE}-${TRACKFILE}'
# (Create a single-track encode with 'abcde -1' from the commandline.)
# * a standard 'single-artist', single-track encode
ONETRACKOUTPUTFORMAT='${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}'
# * a single-track 'various-artist' encode.
VAONETRACKOUTPUTFORMAT='Various-${ALBUMFILE}/${ALBUMFILE}'

# Create playlists for single and various-artist encodes. [Andrew Strong] would suggest commenting these out for single-track encoding.
# Playlists are easy enough to generate with emacs, anyway.
# PLAYLISTFORMAT='${OUTPUT}/${ARTISTFILE}-${ALBUMFILE}/${ALBUMFILE}.m3u'
# VAPLAYLISTFORMAT='${OUTPUT}/Various-${ALBUMFILE}/${ALBUMFILE}.m3u'

# Put spaces in the filenames instead of the more correct underscores:
mungefilename ()
{
  echo "$@" | sed s,:,-,g | tr / _ | tr -d \'\"\?\[:cntrl:\]
}

# What extra options?
MAXPROCS=2       # Run a few encoders simultaneously
PADTRACKS=y      # Makes tracks 01 02 not 1 2
# EXTRAVERBOSE=2   # Useful for debugging
EJECTCD=y        # Eject CD when finished, same as commandline `-x`

retrieving metadata

MusicBrainz has a lot of previously-authored audio-CD metadata. As a result, abcde can usually just retrieve from MusicBrainz, without further effort from the user, resulting in an abcde session like the following:

$ date ; abcde -c ~/.config/abcde/abcde-MP3.conf ; date
Thu Apr  9 15:19:49 EDT 2015
Use of the encoding pragma is deprecated at /usr/bin/abcde-musicbrainz-tool line 15.
Grabbing entire CD - tracks: 01 02 03 04 05
Use of the encoding pragma is deprecated at /usr/bin/abcde-musicbrainz-tool line 15.
Retrieved 1 Musicbrainz match...done.
---- Пётр Ильич Чайковский / Symphony No. 5; Capriccio Italien ----
1: Symphony No. 5 in E Minor, Op. 64 movement 1: Andante; Allegro con anima
2: Symphony No. 5 in E Minor, Op. 64 movement 2: Andante cantabile, con alcuna licenza
3: Symphony No. 5 in E Minor, Op. 64 movement 3: Valse: Allegro moderato
4: Symphony No. 5 in E Minor, Op. 64 movement 4: Finale: Andante maestoso; Allegro vivace
5: Capriccio italien, Op. 45

Edit selected CDDB data? [y/n] (n):
Is the CD multi-artist [y/N]?
Creating playlist...
Grabbing track 01: Symphony No. 5 in E Minor, Op. 64 movement 1: Andante; Allegro con anima...
cdparanoia III release 10.2 (September 11, 2008)

Ripping from sector       0 (track  1 [0:00.00])
          to sector   68011 (track  1 [15:06.61])

outputting to /home/me/abcde.u.4VEXhrSvlFYLh1zkAQ413br.M-/track01.wav

 (== PROGRESS == [                              | 068011 00 ] == :^D * ==)

Done.

Grabbing track 02: Symphony No. 5 in E Minor, Op. 64 movement 2: Andante cantabile, con alcuna licenza...
Encoding track 01 of 05: Symphony No. 5 in E Minor, Op. 64 movement 1: Andante; Allegro con anima...
cdparanoia III release 10.2 (September 11, 2008)

Ripping from sector   68012 (track  2 [0:00.00])
          to sector  132561 (track  2 [14:20.49])

outputting to /home/me/abcde.u.4VEXhrSvlFYLh1zkAQ413br.M-/track02.wav

 (== PROGRESS == [     >                        | 079883 00 ] == :-) o ==)   Tagging track 01 of 05: Symphony No. 5 in E Minor, Op. 64 movement 1: Andante; Allegro con anima...
 (== PROGRESS == [                              | 132561 00 ] == :^D * ==)

Done.

Grabbing track 03: Symphony No. 5 in E Minor, Op. 64 movement 3: Valse: Allegro moderato...
cdparanoia III release 10.2 (September 11, 2008)

Encoding track 02 of 05: Symphony No. 5 in E Minor, Op. 64 movement 2: Andante cantabile, con alcuna licenza...
Ripping from sector  132562 (track  3 [0:00.00])
          to sector  158719 (track  3 [5:48.57])

outputting to /home/me/abcde.u.4VEXhrSvlFYLh1zkAQ413br.M-/track03.wav

 (== PROGRESS == [                >             | 145673 00 ] == :-) O ==)   Tagging track 02 of 05: Symphony No. 5 in E Minor, Op. 64 movement 2: Andante cantabile, con alcuna licenza...
 (== PROGRESS == [                              | 158719 00 ] == :^D * ==)

Done.

Grabbing track 04: Symphony No. 5 in E Minor, Op. 64 movement 4: Finale: Andante maestoso; Allegro vivace...
cdparanoia III release 10.2 (September 11, 2008)

Encoding track 03 of 05: Symphony No. 5 in E Minor, Op. 64 movement 3: Valse: Allegro moderato...
Ripping from sector  158720 (track  4 [0:00.00])
          to sector  215674 (track  4 [12:39.29])

outputting to /home/me/abcde.u.4VEXhrSvlFYLh1zkAQ413br.M-/track04.wav

 (== PROGRESS == [   >                          | 163447 00 ] == :-) O ==)   Tagging track 03 of 05: Symphony No. 5 in E Minor, Op. 64 movement 3: Valse: Allegro moderato...
 (== PROGRESS == [                              | 215674 00 ] == :^D * ==)

Done.

Grabbing track 05: Capriccio italien, Op. 45...
cdparanoia III release 10.2 (September 11, 2008)

Encoding track 04 of 05: Symphony No. 5 in E Minor, Op. 64 movement 4: Finale: Andante maestoso; Allegro vivace...
Ripping from sector  215675 (track  5 [0:00.00])
          to sector  280034 (track  5 [14:18.09])

outputting to /home/me/abcde.u.4VEXhrSvlFYLh1zkAQ413br.M-/track05.wav

 (== PROGRESS == [    >                         | 225184 00 ] == :-) O ==)   Tagging track 04 of 05: Symphony No. 5 in E Minor, Op. 64 movement 4: Finale: Andante maestoso; Allegro vivace...
 (== PROGRESS == [                              | 280034 00 ] == :^D * ==)

Done.

Encoding track 05 of 05: Capriccio italien, Op. 45...
Tagging track 05 of 05: Capriccio italien, Op. 45...
Finished.
Thu Apr  9 15:30:24 EDT 2015

$ mv /home/me/music/downloaded/Пётр\ Ильич\ Чайковский /home/me/music/downloaded/Pyotr\ Ilyich\ Tchaikovsky
$ find /home/me/music/downloaded/Pyotr\ Ilyich\ Tchaikovsky/ -type f | sort
/home/me/music/downloaded/Pyotr Ilyich Tchaikovsky/Symphony No. 5; Capriccio Italien/01_Symphony No. 5 in E Minor, Op. 64 movement 1- Andante; Allegro con anima.mp3
/home/me/music/downloaded/Pyotr Ilyich Tchaikovsky/Symphony No. 5; Capriccio Italien/02_Symphony No. 5 in E Minor, Op. 64 movement 2- Andante cantabile, con alcuna licenza.mp3
/home/me/music/downloaded/Pyotr Ilyich Tchaikovsky/Symphony No. 5; Capriccio Italien/03_Symphony No. 5 in E Minor, Op. 64 movement 3- Valse- Allegro moderato.mp3
/home/me/music/downloaded/Pyotr Ilyich Tchaikovsky/Symphony No. 5; Capriccio Italien/04_Symphony No. 5 in E Minor, Op. 64 movement 4- Finale- Andante maestoso; Allegro vivace.mp3
/home/me/music/downloaded/Pyotr Ilyich Tchaikovsky/Symphony No. 5; Capriccio Italien/05_Capriccio italien, Op. 45.mp3

when metadata retrieval fails

Ripping is relatively effortless when you can retrieve metadata from your chosen source; i.e., when that source has metadata regarding the recording you are ripping. Unfortunately, that will not always be the case, particularly with less-well-known recordings, producing results like

$ date ; abcde -c ~/.config/abcde/abcde-MP3.conf ; date
Mon Apr 13 18:46:31 EDT 2015
Use of the encoding pragma is deprecated at /usr/bin/abcde-musicbrainz-tool line 15.
Grabbing entire CD - tracks: 01 02 03
Use of the encoding pragma is deprecated at /usr/bin/abcde-musicbrainz-tool line 15.
No Musicbrainz match.
---- Unknown Artist / Unknown Album ----
1: Track 1
2: Track 2
3: Track 3

Edit selected CDDB data? [y/n] (y):

In this case, you have 3 options: at the CDDB prompt above,

  1. Enter n: this will rip the recording's audio, but with no metadata. This is obviously substandard, esp for playlists.

  2. Enter y: this will launch your $EDITOR, allowing you to enter the metadata manually to abcde, which will then use it as above. However, your data entry will be unavailable to others.

  3. Hit Control-c to exit abcde, then use an appropriate tool (like Picard) to attach existing metadata, or create new metadata, for your CD's release in your music database (e.g., MusicBrainz).

In case you were wondering, the third option is the morally correct one :-) You are only able to rip relatively effortlessly because other people in the past took the effort to capture the metadata from other recordings you have ripped; equity demands that you "pay them forward."

Metadata retrieval usually fails in one of two ways (details below):

  1. The release metadata exists, but is not connected to the release ID on your current physical CD. Fix this by attaching the release ID to the existing metadata.

  2. No metadata exists for your CD's release. Fix this by authoring new metadata for the release (and then attaching the release ID).

attaching metadata

Follow this procedure to connect your CD's release ID to MusicBrainz's release metadata using Picard.

authoring metadata

Follow this procedure to author MusicBrainz metadata for your CD's release using Picard.

ripping restart

Suppose you

  1. fail to retrieve metadata (like the example above)
  2. "do the right thing": you exit abcde and then attach the metadata from, or author it to, MusicBrainz

  3. restart abcde to resume ripping

At this point, abcde will attempt to resume the previous failed session, like

$ date ; abcde -c ~/.config/abcde/abcde-MP3.conf ; date
Mon Apr 13 19:42:17 EDT 2015
Use of the encoding pragma is deprecated at /usr/bin/abcde-musicbrainz-tool line 15.
Grabbing entire CD - tracks: 01 02 03
abcde: attempting to resume from /home/me/abcde.81Qr5SsVyffzOBEYApEuGd1jiQA-..
No Musicbrainz match.
---- Unknown Artist / Unknown Album ----
1: Track 1
2: Track 2
3: Track 3

Edit selected CDDB data? [y/n] (n): ^C

At this point, you need to

  1. delete the directory/folder backing-up the failed session (above, /home/me/abcde.81Qr5SsVyffzOBEYApEuGd1jiQA-)

  2. then restart abcde. It will now go to MusicBrainz, pickup your newly-entered metadata, and automagically rip your container:

$ rm -fr ~/abcde.81Qr5SsVyffzOBEYApEuGd1jiQA-/
$ date ; abcde -c ~/.config/abcde/abcde-MP3.conf ; date
Mon Apr 13 20:01:53 EDT 2015
Use of the encoding pragma is deprecated at /usr/bin/abcde-musicbrainz-tool line 15.
Grabbing entire CD - tracks: 01 02 03
Use of the encoding pragma is deprecated at /usr/bin/abcde-musicbrainz-tool line 15.
Retrieved 1 Musicbrainz match...done.
---- Topography / Topography ----
1: AKA Spy Theme
2: William Hurt
3: Mad Adore

Edit selected CDDB data? [y/n] (n):
Is the CD multi-artist [y/N]?
Creating playlist...
Grabbing track 01: AKA Spy Theme...
...

handling broken tracks

Contrary to initial marketing, CDs are not permanently readable :-) and one will occasionally encounter tracks too badly damaged (typically by scratches) to rip. Typically one will then want to rip the other, undamaged tracks from the CD. Unfortunately `abcde` currently cannot be told to rip all rippable tracks, but will instead either exit to commandline, or hang, on encountering damaged tracks. However one can tell abcde to (attempt to) rip all remaining tracks ... but not quite that simply. Instead, currently one must

  1. Note the number of the failing track.
  2. Note the number of tracks on the CD.
  3. Tell abcde to rip tracks from the number of the next track following the failing track, to the number of the last (desired) track on the CD.

E.g.

me@it:~$ abcde -c ~/.config/abcde/abcde-MP3.conf
Looking at EXTRAVERBOSE ()
Grabbing entire CD - tracks: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
Retrieved 1 Musicbrainz match...done.
---- Louis Armstrong / The Complete Hot Five and Hot Seven Recordings ----
1: Gut Bucket Blues
2: My Heart
3: Yes! I'm in the Barrel
4: Come Back, Sweet Papa
5: Georgia Grind
6: Heebie Jeebies
7: Cornet Chop Suey
8: Oriental Strut
9: You're Next
10: Muskrat Ramble
11: Don't Forget to Mess Around
12: I'm Gonna Gitcha
13: Droppin' Shucks
14: Who'sit
15: King of the Zulus
16: Big Fat Ma and Skinny Pa
17: Lonesome Blues
18: Sweet Little Papa
19: Jazz Lips
20: Skid-Dat-De-Dat
21: Big Butter and Egg Man
22: Sunset Cafe Stomp
23: You Made Me Love You
24: Irish Black Bottom
25: [silence]

Edit selected CDDB data [y/N]? 
Is the CD multi-artist [y/N]? 
# ...

outputting to /home/me/abcde.Mo7SBhbon7UaqZUeGv7lmAfWDbs-/track16.wav

 (== PROGRESS == [   >                          | 190854 00 ] == :^D   ==)   Tagging track 15 of 25: King of the Zulus...
WARNING: The CDROM drive appears to be seeking impossibly quickly.-P   ==)   
This could be due to timer bugs, a drive that really is improbably fast,
or, most likely, a bug in cdparanoia's cache modelling.

Please consider using the -A option to perform an analysis run, then mail
the cdparanoia.log file produced by the analysis to paranoia-dev@xiph.org
to assist developers in correcting the problem.

 (== PROGRESS == [       +C+>                   | 193412 00 ] == ;-( 0 ==)   scsi_read error: sector=193442 length=1 retry=0
                 Sense key: 2 ASC: 3a ASCQ: 2
                 Transport error: Device not ready
                 System error: No medium found
scsi_read error: sector=193443 length=27 retry=0
                 Sense key: 2 ASC: 3a ASCQ: 2
                 Transport error: Device not ready
                 System error: No medium found

paranoia_read: CDROM drive unavailable, bailing.

[ERROR] abcde: The following commands failed to run:
readtrack-16: cdparanoia --never-skip=40 returned code 1
Finished. Not cleaning /home/me/abcde.Mo7SBhbon7UaqZUeGv7lmAfWDbs-.

me@it:~$ abcde -c ~/.config/abcde/abcde-MP3.conf 17-
Looking at EXTRAVERBOSE ()
Grabbing entire CD - tracks: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# ...

Erase, Append to, or Keep the existing playlist file? [e/a/k] (e): 

Note that if you do not erase the existing playlist file (a *.m3u file in your OUTPUTDIR), abcde's behavior will often not change: it will continue to attempt to rip the problem track.

Grabbing track 01: Gut Bucket Blues...
cdparanoia III release 10.2 (September 11, 2008)

Ripping from sector       0 (track  1 [0:00.00])
          to sector   12204 (track  1 [2:42.54])

outputting to /home/me/abcde.Mo7SBhbon7UaqZUeGv7lmAfWDbs-/track01.wav
^C # because that's not what I want: see http://abcde.einval.com/bugzilla/show_bug.cgi?id=18

me@it:~$ abcde -c ~/.config/abcde/abcde-MP3.conf 17-25
Looking at EXTRAVERBOSE ()
Grabbing tracks: 17 18 19 20 21 22 23 24
abcde: attempting to resume from /home/me/abcde.Mo7SBhbon7UaqZUeGv7lmAfWDbs-..
Creating playlist...
Grabbing track 17: Lonesome Blues...
cdparanoia III release 10.2 (September 11, 2008)

Ripping from sector  203270 (track 17 [0:00.00])
          to sector  217121 (track 17 [3:04.51])

outputting to /home/me/abcde.Mo7SBhbon7UaqZUeGv7lmAfWDbs-/track17.wav
# ... is what I want

ripping video DVDs

See also


CategorySound CategoryVideo CategorySoftware