Ubuntu Geek

Tips,Howtos,Tutorials and Articles about Ubuntu Linux (Dapper - Edgy - Feisty - Gutsy)

How to Rip DVD audio to mp3 or ogg

Posted by admin on April 27th, 2007

You can extract sound from a DVD, one track at a time or a chapter at a time. Some simple command line examples should suffice to demonstrate how this is done.

First thing you need to do is make sure you have lsdvd and transcode installed:

sudo apt-get install lsdvd transcode

A DVD in your DVD drive will probably be identified as /dev/dvd. Have a look at its table of contents with the lsdvd command

lsdvd

to find the track information, and the longest track

Output looks like as follows
libdvdread: Using libdvdcss version 1.2.5 for DVD access
Title: 01, Length: 02:32:44 Chapters: 26, Cells: 27, Audio streams: 02, Subpictures: 01
Title: 02, Length: 00:17:36 Chapters: 02, Cells: 02, Audio streams: 01, Subpictures: 00
Title: 03, Length: 00:00:11 Chapters: 02, Cells: 02, Audio streams: 01, Subpictures: 00
Longest track: 1

To capture the audio from the tenth chapter of the first title, saving it in ogg format, the command line is simply

transcode -i /dev/dvd -x dvd -T 1,10,1 -a 0 -y ogg -m track10.ogg

The arguments identify the input as /dev/dvd (-i), the type of input as DVD (-x), the title, chapter, and angle to encode, in this case being title 1, chapter 10, and camera angle 1 (-T), the audio track is track 0 (-a), the output format is ogg (-y, and the output filename is track10.ogg (-m).

generates mp3 output of chapter 20 from title 1

transcode -i /dev/dvd -x dvd -T 1,20,1 -a 0 -y raw -m track20.mp3

To extract the whole audio track of a title (all chapters) as ogg audio

transcode -i /dev/dvd -x dvd -T 1,-1 -a 0 -y ogg -m audiotrack.ogg

If you prefer WAV files, the following will do it

transcode -i /dev/dvd -x dvd -T 1,20 -a 0 -y wav -m track20.wav

Tags: , ,
These icons link to social bookmarking sites where readers can share and discover new web pages.
  • BlinkList
  • blogmarks
  • del.icio.us
  • Furl
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • Reddit
  • Simpy
  • Spurl
  • YahooMyWeb
  • Stumble it

Related Articles:

6 Responses to “How to Rip DVD audio to mp3 or ogg”

  1. Manuel Says:

    Thank you very much !
    I love these tricks especially when it is about multimedia.

    Your website is in my RSS aggregator since a ‘long time’, and i can’t wait for new tips/tricks :)

    Thank you again

    Bye from France
    Manuel

  2. Russ Methlie Says:

    Thank you, but one small correction…

    The switch for the output file is wrong. “-m” is for specifying an output stream. “-o” is for specifying an output file name. It also should not just be a name with extension, you should also specify a full output path. So instead of “-m track20.ogg”, as it appears in the example, it should be “-o /home/[username]/music/track20.ogg”, (or whatever is right for your setup). Using the command given will do nothing more than write the file to a stream that is not saved anywhere.

    Otherwise it works great…

  3. John Says:

    I was excited to read your how-to as I had just given up on rip::dvd. It wouldn’t work for me after the first try, will likely get back to it, but I wanted to try your cli route.
    It looked promising but I got the following 3 error lines:
    [transcode] warning : (encoder.c) video codec not supported by export module
    [transcode] warning : failed to init export modules
    [transcode] critical: plug-in initialization failed

    I would appreciate any thoughts you might have for me. It was the same error using Russ’s edited command. Thanks!!

  4. Hadret Says:

    Well, there is one more thing. If you want to rip DVD to Ogg, you should use this one:

    transcode -i /dev/dvd -x dvd -T 1,-1 -a 0 -y null,ogg -q 192 -m audiotrack.ogg

    Without -y null, you will get an error and few warnings. -q argument depends on what bitrate you would like to have in your ripped audio file (:

  5. Hadret Says:

    Uhm, not -q but -b (:

  6. Doug Says:

    Hello all,

    Well…hmmm…doesn’t seem to work so swiftly for me. What am I doing wrong?

    Thanks for any light shed,
    Doug

    doug@nimbus:~$ transcode -i /dev/dvd -x dvd -T 1,2,1 -a 0 -y ogg -q 192 -o /home/doug/Desktop/Farewell_I_Tour/The_Long_Run.ogg
    transcode v1.0.2 (C) 2001-2003 Thomas Oestreich, 2003-2004 T. Bitterberg
    [tcprobe] DVD image/device
    (dvd_reader.c) DVD title 1/2: 21 chapter(s), 1 angle(s), title set 1
    (dvd_reader.c) title playback time: 01:39:09.01 5950 sec
    (dvd_reader.c) [Chapter 01] 00:00:00.000 , block from 0 to 49628
    (dvd_reader.c) [Chapter 02] 00:01:34.080 , block from 49629 to 203804
    (dvd_reader.c) [Chapter 03] 00:06:25.080 , block from 203805 to 362080
    (dvd_reader.c) [Chapter 04] 00:11:28.080 , block from 362081 to 551149
    (dvd_reader.c) [Chapter 05] 00:17:40.080 , block from 551150 to 689463
    (dvd_reader.c) [Chapter 06] 00:22:04.680 , block from 689464 to 847078
    (dvd_reader.c) [Chapter 07] 00:27:04.080 , block from 847079 to 1002248
    (dvd_reader.c) [Chapter 08] 00:31:58.440 , block from 1002249 to 1140958
    (dvd_reader.c) [Chapter 09] 00:36:18.840 , block from 1140959 to 1343112
    (dvd_reader.c) [Chapter 10] 00:42:46.800 , block from 1343113 to 1507825
    (dvd_reader.c) [Chapter 11] 00:47:52.680 , block from 1507826 to 1653207
    (dvd_reader.c) [Chapter 12] 00:52:25.080 , block from 1653208 to 1801239
    (dvd_reader.c) [Chapter 13] 00:57:36.720 , block from 1801240 to 1819579
    (dvd_reader.c) [Chapter 14] 01:01:06.240 , block from 1819580 to 1928433
    (dvd_reader.c) [Chapter 15] 01:05:44.160 , block from 1928434 to 2072420
    (dvd_reader.c) [Chapter 16] 01:10:43.920 , block from 2072421 to 2227307
    (dvd_reader.c) [Chapter 17] 01:15:15.000 , block from 2227308 to 2365080
    (dvd_reader.c) [Chapter 18] 01:19:13.320 , block from 2365081 to 2489305
    (dvd_reader.c) [Chapter 19] 01:26:36.000 , block from 2489306 to 2722745
    (dvd_reader.c) [Chapter 20] 01:30:33.480 , block from 2722746 to 2852249
    (dvd_reader.c) [Chapter 21] 01:37:02.520 , block from 2852250 to 3058384
    [transcode] (probe) suggested AV correction -D 0 (0 ms) | AV 0 ms | 0 ms
    [transcode] auto-probing source /dev/dvd (ok)
    [transcode] V: import format | unknown (V=dvd|A=(null))
    /dev/dvd:1: parser error : Document is empty

    ^
    /dev/dvd:1: parser error : Start tag expected, ‘

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

 
Rodney's Kontera DynamiContext Plugin plugged in.