Here are some notes with tips on extracting video files from DVDs on Linux. This information is for a system running Fedora 18. It will likely apply to other Fedora releases as well as other Linux distributions. The notes will assume that you have handbrake and mplayer already loaded on your system along with support programs and libraries such as libdvdcss. I will create some documentation on how I installed that software before too long and link to that.
I find that handbrake is the easiest way to extract a video from a DVD and that it works about 90% of the time. When handbrake fails I fall back to using mplayer to extract the file and then use handbrake to transcode the file extracted with mplayer. In these notes I give the information on what works most of the time and then follow up with some tips to solve the situations when things don't work.
I find that some DVD readers work better than others. I also find that computer drives are much less forgiving about DVD defects than are DVD players. If you have a DVD that is slightly warped our out of balance a computer drive may encounter problems. I believe that one reason for this is that a computer drive is spinning much faster than a standard DVD player because it is trying to read data much faster than would be done for normal playback due to trying to transcode faster than real time.
The best DVD reader I have found (in an admittedly small sample size) is an LG Slim Portable DVD Writer Model AP70NS50. This is a USB external drive and was about $60 when I purchased it from Best Buy. You must have a dual layer DVD reader. I find that this LG reader is somewhat better than the drive that was built into my laptop. It may be that it is more forgiving of errors in a DVD, I do not know the reason. I tried a very inexpensive LG USB drive and had very poor results. If you run into problems with some disks check the surface for defects. I have found a few disks in which surface defects made transcoding impossible.
I use the Plex Media Server to play videos. I use the file naming convention recommended by the Plex software. This format has a directory with a movie name followed by the release date in parenthesis and then in that directory a file with the movie name followed by the release year in parenthesis. For example:
/movies/The Game (1997)/The Game (1997).m4v
In that example I am using an "m4v" container for the video. The file extension could have also been ".mpg". The Plex software site has a lot of good information devoted to file naming. If you plan to use Plex for video playback it is very important to get the naming correct so that Plex can index all your videos.
Launch handbrake and place your DVD in the drive. Tell handbrake about your source DVD drive. My internal drive is /dev/sr0 and my external USB drive is /dev/sr1. Click on the "Source" icon in the header:
This will bring up a standard file explorer window and you should be able to see your file system and devices. Choose the appropriate DVD device.
When the DVD has been selected and you click "OK" handbrake will scan the DVD looking for the longest title. This is typically the video you want. The scan will take a minute or so. If it progresses fairly quickly the transcoding will most likely work well. If the scan requires 5 minutes then the transcoding is likely to fail.
The screen should now have some information such as this:
The title drop down will have selected the longest title on the disk. This is probably what you want but in some cases you may have to change this. You should use a source such as www.imdb.com to look up the DVD information and determine the "official" title, release date, and running time. Verify that the running time is really close to what handbrake shows.
The "File:" and "Title:" fields will be filled in with information from the DVD. You will want to edit those to match the correct movie title. Note that the "File:" box will define the file name used. The "Title:" and "Release Date:" boxes will place information in tag fields of the video. This can be useful when the Plex software is indexing movies and I recommend setting this. Note that I am using the ".m4v" format. This defines a "container" used to hold media.
Now select the "Audio" tab and choose the desired audio format.
That will bring up a window in which you can name a preset. I have used "AC3 Passthrough" like so:
mplayer -dumpstream dvd://1 -dvd-device /dev/sr1 -dumpfile title1.mpg
That command will read title 1 (dvd://1) from the "sr1" device, and place the output of title 1 in a file named "title1.mpg". The file will be placed in the directory from which the command is run. You could specify a full output path for the file if desired. Note that the output file will be large. It could be 5 gigabytes or more in size so be sure there is sufficient file space for the resulting file.
While mplayer is running it will be displaying output showing how many bytes are written. Note that when it completes it will print a message saying that core has been dumped. This is a very poor "program finished" message. I do not know why the message appears but it is always output when mplayer finishes and does not seem to actually indicate a problem so don't be alarmed by this.
As the next step run Handbrake as described above and give it the .mpg file created with mplayer as the input file. It should transcode this file just as it would when reading from a DVD. Check the result and then delete the .mpg file.
This use of mplayer almost always works. I did find a case in which it failed to extract the full movie, repeatedly terminating before reaching the end. I found that I could get the full movie by changing the output to a .vob format. I do not know why, but this worked:
mplayer -dumpstream dvd://1 -dvd-device /dev/sr1 -dumpfile title1.vob
One of the tricks with this is figuring out what title you need to transcode. The first thing I try is to open the DVD with "movie player" the default application under Fedora. This will bring up the DVD menu. Select "play" and let the actual movie begin to play. The movie player software will display the title playing.
In some cases the default movie player application will report that the media format is incorrect. In this case try using vlc to play the DVD. As far as I know it will not show you which title is playing but it will show you the titles and video time by selecting "Playback -> Title".