Log in

View Full Version : Rip DVDs to Xvid using MPlayer - One Man's Guide


JRoK
1st November 2006, 03:28
First, a note about my set-up:
I have two computers in my office. One is a P4 2.4 gHz with an ATI All-in-Wonder Radeon 8500DV video card running s-video out to my living room. This machine runs Windows XP. I use the remote provided with my ATI card in combination with ZoomPlayer to control things when I watch movies in my living room. I'd like to migrate this machine to Linux, but my attempts have been ill-fated due to sketchy hardware support for the ATI components. My other machine, an AMD64 3500+, is running Ubuntu Dapper. Now that I'm beginning to figure things out, I can accomplish most everything I need to do in Ubuntu.

Like most people new to Linux, I was frightened by the command line in the beginning. I tried to use GUIs, but I could never get anything to sync. Avidemux looks like VirtualDub, but it's not there yet. I truly wish it was. With Linux, Mplayer/MEncoder/CLI is the way to go. MPlayer's website has great documentation, as does Doom9, but I had trouble finding a set of instructions to accomplish exactly what I wanted to do. I found that once I grew accustomed to the CLI, it was actually easier to accomplish my tasks in Linux.

My goal:
Rip a DVD, encode it using Xvid (retaining the 5.1 AC3 audio track), and burn it to a DVD. I'm not looking to shrink movies to an exact size -- rather, I shoot for a high quality encode. When I have a set of 3-5 movies that will fit nicely on a DVD-R, I burn 'em.

My Guide:
1 - Rip DVD:
mplayer dvd://1 -dumpstream -dumpfile rip.vob
or
mplayer dvd://1 -dvd-device /media/cdrom0 -dumpstream -dumpfile rip.vob
* I have two dvd drives. The first command is for the top drive, the second is for my bottom drive.

2 - Detect crop area:
mplayer rip.vob -aid 128 -vf cropdetect
* -aid 128 is the first audio track on the DVD. On older discs, this is sometimes the two-channel stereo track, and 129 is the 5.1. To find out, pay attention to the audio information in the console after you run the above command.

3 - Encode from file:
mencoder rip.vob -aid 128 -ovc xvid -vf crop=720:480:0:0 -oac copy -xvidencopts fixed_quant=3.7 -o newmovie.avi
* fixed_quant 3.7 is my default. If I am encoding an action flick, I'll drop it down to 3.5 or so. If it's a talky film or a chick flick my wife wants, I might go to 3.9.
* If the audio is just 2.0 stereo and there is no 5.1 track, use 'mp3lame' in place of 'copy'.

Subtitles
I'm not quite happy with my method, but it works (sometimes)...
Rip mirror image (-m) of DVD:
vobcopy -m /media/cdrom0

Encode:
mencoder -dvd-device /home/user/DVD_VOLUME/VIDEO_TS/ dvd://1 -ovc xvid -vf crop=720:480:0:0 -xvidencopts fixed_quant=3.7 -oac copy -vobsubout subtitles -vobsuboutindex 0 -sid 0 -o newvideo.avi

Use ksubtitleripper GUI > save as SRT.

OR...

Use SubRip under Wine. Probably the best option.


When all is ready, burn to DVD-R using K3b or other burning software of your choosing. Again, my goal is not to play the movie using a standalone DVD player, but it might be possible with some of the new Divx capable players on the market.

Doom9 has been very helpful to me through the years, and I hope this guide provides some assistance to someone out there.

Thanks.

JRoK

setarip_old
1st November 2006, 06:57
Are you the same "JROK" who used to post at "Dave's Forum"?

JRoK
1st November 2006, 07:27
Are you the same "JROK" who used to post at "Dave's Forum"?
No, I am not.

danpos
1st November 2006, 19:57
@JRoK

Great guide. I liked it because of it goes direct to the point, simple language...

Thanks for share it with us.

Regards,