Extract audio from a DVD in linux
Although you can use K9Copy to extract the audio track from DVD some times is more convenient to use the commanline.
Ripping the sound track of a DVD movie through the terminal can be achieved using transcode and lsdvd commands.
These can be installed via
sudo apt-get install transcodelsdvd
Through the following command
lsdvd
you can browse the DVD toc (table of content) in order to locate the track information, and for instance the longest track which would be the movie’s one.
This command would assume you have the DVD inserted in the physical drive /dev/dvd however if you are willing to rip the audio track from a DVD video ISO image you have to first mount the image in a folder
sudo mount dvdimage.iso /media/dvdimage/ -t iso9660 -o loop
and than tell lsdvd where to look for the DVD
lsdvd /media/dvdimage
The output would look similar to the following one
libdvdread: Using libdvdcss version 1.2.5 for DVD access Title: 01, Length: 01:24:34.286 Chapters: 17, Cells: 17, Audio streams: 08, Subpictures: 32 Title: 02, Length: 00:01:54.086 Chapters: 01, Cells: 01, Audio streams: 01, Subpictures: 03 Longest track: 1
To capture the whole audio track of a title run (according to the codec you want to have the output in)
transcode -i /dev/dvd -x dvd -T 1,-1 -a 0 -y ogg -m audio.ogg transcode -i /dev/dvd -x dvd -T 1,-1 -a 0 -y wav -m audio.wav
or in case you are manipulating an ISO image
transcode -i /media/dvdimage -x dvd -T 1,-1 -a 0 -y ogg -m audio.ogg transcode -i /media/dvdimage -x dvd -T 1,-1 -a 0 -y wav -m audio.wav
If you want to capture only a specific chapter (let’s say the 3rd) you can use this string
transcode -i /dev/dvd -x dvd -T 1,3,1 -a 0 -y ogg -m track3.ogg
Basically the arguments identify
[-i] the input as /dev/dvd
[-x] the type of input as DVD
[-T] the title, chapter, and angle to encode, in this case being title 1, chapter 3, and camera angle 1
[-a] the audio track is track 0
[-y] the output format
[-m] the output filename is