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: document examples of use of at least one GUI.

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

authoring metadata

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, and then enter the metadata manually into your music database (or metadata source, e.g., MusicBrainz) using an appropriate tool (like Picard).

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."

Regarding use of abcde with Picard (or other metadata tagger):

Suppose you encounter an unsuccessful metadata retrieval like that listed above, and you "do the right thing": you exit abcde, enter the data in Picard, save it to MusicBrainz, and exit Picard. When you restart abcde, it 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

Hence you need to delete the directory/folder backing-up the failed session (above, /home/me/abcde.81Qr5SsVyffzOBEYApEuGd1jiQA-). When you rerun abcde after deleting that, abcde will instead 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...
...

ripping video DVDs

TODO!

See also