Watching, ripping and converting DVDs (xine, mplayer, mencoder, dvd, iso image)

Both xine and MPlayer can play DVDs directly, but xine has a DVD navigation. In Mplayer you need to specify which movie (VOB file) you want to play:
xine dvd:// mplayer dvd://3 If you just want to temporarily store the DVD on your hard disk it might be sufficient to create a DVD image:
dd if=/dev/dvd of=rosenstrasse.iso The image can be mounted as follows:
sudo mount -o loop rosenstrasse.iso /media/temp/ Xine can play a DVD from an iso image directly (without mouting the image):
xine dvd://media/isos/movie.iso Note that you need to specify always the complete path even if the movie is in the current directory! Mplayer can play the individual VOB files from the image (however without subtitle support). I couldn't make Mplayer to accept the iso image as dvd.
For conversion to e.g. DivX/XviD the easiest is to use Mplayer/mencoder. First I extracted audio:
mencoder dvd://1 -ovc frameno -o frameno.avi -oac mp3lame -lameopts abr:br=128 Then the 1. pass encoding:
mencoder dvd://1 -nosound -oac copy -o /dev/null -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=800:vhq:vpass=1:vqmin=1:vqmax=31 -vop scale -zoom -xy 640 -vf pp lb Then the 2. pass encoding:
mencoder dvd://1 -oac copy -o file.avi -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=800:vhq:vpass=2:vqmin=1:vqmax=31 -vop scale -zoom -xy 640 -vf pp lb

It is more difficult to extract the subtitles. You can either extract them as images (easier but bigger filesize) or then convert these images into textfiles (requires an OCR step).
Extract subtitle images (from mounted iso image in this case):
cat /media/temp/VIDEO_TS/VTS_01_?.VOB | tcextract -x ps1 -t vob -a 0x20 > movie.ps1 Convert subtitle images:
subtitle2vobsub -i /media/temp/VIDEO_TS/VTS_01_0.IFO -p movie.ps1 -o movie_name Copy metadata:
cp /media/temp/VIDEO_TS/VTS_01_0.IFO movie_name.ifo Play from VOB file directly:
mplayer /media/temp/VIDEO_TS/VTS_01_1.VOB -vobsub movie_name -vobsubid 0 Play from avi file:
mplayer movie.avi -vobsub movie_name -vobsubid 0