The following information applies to my IBM ThinkPad running Libranet Linux (essentially Debian Sarge/Sid). I have no idea if it will work on your Linux box. It may, and it may not.
My ultimate goal was to grab the entire soundtrack of the film Koyanisqaatsi, as the score by Philip Glass is one of my favorite compositions. You can buy a CD of Koyanisqaatsi, but it doesn't match the DVD exactly, so I decided to get the real thing in a form that I could listen to digitally.
The following requires that you have the wonderful Mplayer and related software installed on your system. For Debian, I simply use:
# apt-get install mplayer mencode-686 vorbis-tools
Once the software you need is installed, insert your DVD and run the following command. You may need to change the number in "dvd://2" to match the track you want to grab. Start with 1 & increment until it works. Also, you may want to change "my_movie.avi" to a path and filename more agreeable to you.
$ mencoder dvd://2 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=1000 -oac copy -vop scale -zoom -xy 720 -o my_movie.avi
The above command has actually ripped the entire film to your hard drive. In my case, the resulting file - my_movie.avi - is around 810 MB, which is large, but perfect for a multi-gigabyte hard drive. Keep the film if you'd like, so you can watch it easily any time you want.
Now we're going to extract the soundtrack from the movie we just ripped. Feel free to change "stream.wav" in the following command to another name; of course, "my_movie.avi" should match the filename you used in the previous command.
$ mplayer -vo null -ao pcm -aofile stream.wav my_movie.avi
We are now going to compress the enormous WAV file into a smaller format that we can easily play on our computer or portable music player. I prefer OGG over MP3 as a format for a variety of reasons, but if you don't like OGG and want to use MP3 instead, feel free, but I don't know how to encode using MP3, as I never use it.
$ oggenc -q 8 stream.wav
I used a very high quality level for OGG - 8 - which creates a 134 MB file that sound great and lets me listen to the entire soundtrack in one unbroken stream. If you use a lower number for a quality level - 3 or 4, say - you'll get a much smaller file that may sound fine to you. I use -q 8 for all my OGG encoding, and I'm sticking with it.
At this point, feel free to delete the WAV file, unless you want to keep it for a backup. Now enjoy the movie by opening the AVI, or listen to a great soundtrack my opening the OGG. Either way, you're in for a great experience.
|