It should be noted before we begin that the DVD ripping and transcoding guide with Linux as well as the mplayer user manual already do a fairly good job of explaining the DVD to divx conversion process. Most of this section is simply a distilled version of the information provided from these sources.
You should use
tccat, which is part of the
package. Use it like this:
tccat -i /dev/dvd -T A,B-C,D > filename.vob
Ais the title that you want to rip
Bis the chapter that you want to start from
Cis the chapter that you want to end with
Dis the angle that you want (typically, 1)
filename.vobis the file where you want the ripped output to go
The only tricky part about audio encoding is that, if your DVD has
multiple language tracks, you need to decide which language track you
want to encode the audio from. The choice of audio track is controlled
-aid option in mplayer. Do not use the
option in mplayer; in my experience this option is buggy.
The first audio track in your .vob file has
-aid 128; the second,
-aid 129, and so on. To encode the audio from the first audio
rm frameno.avi mencoder -ovc frameno -o frameno.avi -oac mp3lame -lameopts abr:br=128 -aid 128 filename.vob
If you want to use a lower or higher bitrate for the audio, adjust the
br=128 option to suit your tastes. Do not change the
frameno.avi output filename; the
video encoding portion of
mencoder relies on this hard-coded
You can easily use mplayer to extract a .wav file of any audio track contained in the .vob file. For example, to copy audio track #1 to a .wav file, run
mplayer -vo null -nogui -aid 128 -ao pcm -aofile audio.wav filename.vob
If you want to use this .wav file to time the dialogue in Sub Station Alpha, you have to convert it to mono, 44100 Hz sample rate, and 8 bit precision:
You can then load the
sox audio.wav -r 44100 -c 1 -b audio2.wav
audio2.wavfile into Sub Station Alpha and time from it, with digitally guaranteed accurate timings. What a deal.
audio encoding process
mencoder will print a list of recommended video
bitrates to use for fitting the finished product onto CDs of various
sizes. You can use one of the recommended bitrates, or you can choose
a different bitrate if your goal is not to burn the result to a CD.
To perform the video encoding, run
mencoder -sub script.mpsub -ffactor 1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=NNNN:vhq:vpass=1 -npp ci -o output.avi mencoder -sub script.mpsub -ffactor 1 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=NNNN:vhq:vpass=2 -npp ci -o output.avi
Explanation of the options:
-sub script.mpsubspecifies the filename of the script containing your subtitles. Omit if you are not adding any subtitles.
-ffactor 1controls the darkness of the black borders that are used to outline the subtitles. See the
mencoderman page for further information. If you're not adding subtitles, omit this as well.
vbitrate=NNNNis the bitrate that you want to encode at. Replace
NNNNwith the actual number that you want to use, in kbits/sec.
mencoderto deinterlace the video, which is a good thing to do for divx files. See Myths about DeInterlacing for more information.
-o output.aviis the filename that you want the output to land in.
An .avi file, unfortunately, does not have any aspect ratio
information stored within the file. The lack of aspect ratio
information causes problems when playing back "anamorphic" videos,
which are designed to play back at a resolution different from the
resolution that is actually used to store them on disc. If your
original source DVD was anamorphic (and most film-source material is),
then you have to explicitly tell your divx player what the right
aspect ratio is at playback time. For example, with
mplayer -aspect 16:9 output.avi
For playback on Windows, you will have to download the DivX 5.0 freeware player application at http://www.divx.com/divx/. When playing back the divx files on windows, you must use the standalone DivX Player 2.0 application itself. Playing back the file in Windows Media Player, in my experience, does not work, even if you have the DivX codec installed.