How to Rip DVD audio to mp3 or ogg
Posted by admin on April 27th, 2007
Email This Post
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
If you want to be notified the next time we write something please subscribe to our RSS feed.Thanks for Visiting!


April 27th, 2007 at 4:18 pm
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
April 28th, 2007 at 8:52 pm
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…
May 17th, 2007 at 1:23 pm
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!!
May 27th, 2007 at 3:03 pm
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.oggWithout -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 (:
May 27th, 2007 at 3:08 pm
Uhm, not -q but -b (:
June 9th, 2007 at 2:08 pm
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, ‘
June 24th, 2007 at 3:05 pm
Just wanted to drop a note that if you find yourself with standard DVDs that have no video, as is the case with DVD singles lately, then you need to use
-x null,dvd
Otherwise, transcode will fail to read the video (because there isn’t any). So my command is:
transcode -i /dev/dvd -x null,dvd -T 4,1,1 -a 0 -y null,ogg -o Marillion.ogg
As a side note, this actually speeds up the extraction process too!
August 18th, 2007 at 6:39 pm
Does this extract full surround sound audio or just stereo? I have a music DVD with surroud sound and would like to keep the 5.1 format but as have yet found a way to do that.
December 9th, 2007 at 8:02 am
Hi all,
any one with solution as the same problem with Doug , me too.
parser error : Start tag expected,
thanks
January 22nd, 2008 at 2:05 pm
Another useful command for ripping to wav:
transcode -i /dev/dvd1 -x null,dvd -U file -N 0×1 -T 1,-1 -a 0 -y wav
“-N 0×1″ processes the audio data as PCM instead of MPEG. This is better if the dvd already has PCM sound.
“-U xxx” outputs a file for each chapter. Files are named xxx-ch01.avi, xxx-ch02.avi etc. Though the files are named avi they are still wav-files.
January 26th, 2008 at 7:56 am
transcode wrks,but i get a little detail, my tracks aren’t longer than 127 seconds. I have tried ogg, mp3 and wav to no avail, the titles on the dvd have only 1 chapter and are most of them longer than 3 minutes; any ideas? Great work by the way. And thanks in advance.
February 14th, 2008 at 1:59 am
I cannot seem to make the audio from my dvd to extract.
transcode -i /media/cdrom0 -x dvd -T 1,1,1 -a 2 -y raw -o /tmp/aus_ch1.mp3
transcode v1.0.2 (C) 2001-2003 Thomas Oestreich, 2003-2004 T. Bitterberg
(dvd_reader.c) DVD title 1/1: 3 chapter(s), 1 angle(s), title set 1
(dvd_reader.c) title playback time: 02:49:00.03 10141 sec
(dvd_reader.c) [Chapter 01] 00:00:00.000 , block from 0 to 707608
(dvd_reader.c) [Chapter 02] 00:50:29.166 , block from 707609 to 1722548
(dvd_reader.c) [Chapter 03] 02:08:29.166 , block from 1722549 to 2260923
[transcode] (probe) suggested AV correction -D 0 (0 ms) | AV 0 ms | 0 ms
[transcode] auto-probing source /media/cdrom0 (ok)
[transcode] V: import format | MPEG-2 DVD NTSC (V=dvd|A=dvd)
[transcode] V: AV demux/sync | (2) initial MPEG sequence / enforce frame rate
[transcode] V: import frame | 720×480 1.50:1 encoded @ 4:3
[transcode] V: bits/pixel | 0.217
[transcode] V: decoding fps,frc | 23.976,1
[transcode] V: Y’CbCr | YV12/I420
[transcode] A: import format | 0×2000 AC3 [48000,16,2]
[transcode] A: export format | 0×55 MPEG layer-3 [48000,16,2] 128 kbps
[transcode] V: encoding fps,frc | 23.976,1
[transcode] A: bytes per frame | 8008 (8008.000000)
[transcode] A: adjustment | 0@1000
[transcode] V: IA32/AMD64 accel | sse2 (sse2 sse mmxext mmx asm C)
tc_memcpy: using sse for memcpy
[transcode] V: video buffer | 10 @ 720×480
[import_dvd.so] v0.4.0 (2003-10-02) (video) DVD | (audio) MPEG/AC3/PCM
[export_raw.so] v0.3.12 (2003-08-04) (video) * | (audio) MPEG/AC3/PCM
[import_dvd.so] tccat -T 1,1,1 -i “/media/cdrom0″ -t dvd -d 0 -L | tcdemux -a 2 -x ac3 -S 0 -M 2 -d 0 | tcextract -t vob -x ac3 -a 2 -d 0 | tcdecode -x ac3 -d 0 -s 1.000000,1.000000,1.000000 -A 0
[import_dvd.so] tccat -T 1,1,1 -i “/media/cdrom0″ -t dvd -d 0 | tcdemux -s 0×82 -x mpeg2 -S 0 -M 2 -f 23.976024 -P /tmp/filehhkE0I -d 0 | tcextract -t vob -a 0 -x mpeg2 -d 0 | tcdecode -x mpeg2 -d 0 -y yv12
[import_dvd.so] delaying DVD access by 3 second(s)
.tc_memcpy: using sse for memcpy
..tc_memcpy: using sse for memcpy
[decode_mpeg2.c] libmpeg2 0.4.0b loop decoder
[decode_mpeg2.c] libmpeg2 acceleration: mmxext
Audio: using new version
Audio: using lame-3.97
[export_raw.so] codec=YV12, fps=23.976, width=720, height=480
clean up | frame threads | unload modules | cancel signal | internal threads | done
[transcode] encoded 0 frames (90830 dropped, 0 cloned), clip length 0.00 s
April 23rd, 2008 at 11:21 pm
I’m not an Ubuntu user, but whenever I google for a Linux problem, the solution usually comes from an Ubuntu post. Thanks to everyone. My goal today was to rip the audio off of a “home-made” DVD video of my boss giving a presentation into an MP3 file so I can just listen to it on my iPod. What worked for me was this command: (rips audio of all chapters of 1st DVD track in MP3 format)
transcode -i /dev/dvd -x null,dvd -T 1,-1 -N 0×55 -y null,raw -m /path/A.mp3
The comments mentioning to add “null” definitely help and made the encoding process much faster. The “-N 0×55″ indicates MP3 and without it and I got best results using the -m flag for the output (contrary to the comment that it should be -o filename). It seems like specifying “null” made transcode ignore the video track.
April 23rd, 2008 at 11:29 pm
Clarifying my above comment
I’m not an Ubuntu user, but whenever I google for a Linux problem, the solution usually comes from an Ubuntu post. Thanks to everyone. My goal today was to rip the audio off of a “home-made” DVD video of my boss giving a presentation into an MP3 file so I can just listen to it on my iPod. What worked for me was this command: (rips audio of all chapters of 1st DVD track in MP3 format)
transcode -i /dev/dvd -x null,dvd -T 1,-1 -N 0×55 -y null,raw -m /path/A.mp3
The comments mentioning to add “null” definitely help and made the encoding process much many times faster. It seems like specifying “null” made transcode ignore the video track. The “-N 0×55″ indicates MP3 and without it my output was like 5 gigs, with it 18 MB. (That might also have been because I was specifying output with -o instead of -m.) I got best results using the -m flag for the output (contrary to the previous comment that it should be -o filename).
June 8th, 2008 at 7:21 pm
I prefer flac. How would (can) I rip to flac files?
July 17th, 2008 at 4:00 pm
Where is the output file dropped?
August 3rd, 2008 at 12:05 pm
I’m running Debian, but I often find Googling directs me to this very useful forum. Thanks guys.
I’ve tried running transcode to give a .wav output, as follows:
transcode -i /dev/dvd -x null ,dvd -T 1,2,1 -a 1 -y wav -o track2.wav
and it gives an output file which, when played, the sound comes in one-second bursts. At least, it does when played with my default Totem movie player. I’ve found since that it works fine in VLC, Gnusound or Audacity.
OTOH, changing the output to -y raw -o track2.mp3 gives a MP3 file which plays properly
in Totem or VLC, but gives ‘unknown file format’ with Gnusound and plays in 22 seconds flat (with chunks omitted) in Audacity. If converted from MP3 to .wav using mpg321, the resulting .wav file also plays in 22 seconds flat.
The moral seems to be, if one program doesn’t work, try another. And sound, like DVD formats, seems to be a black art.
I haven’t tried burning to a CD yet to see what it will do in a CD player.
cr