Monday, July 16, 2007

VOB to Divx using ffmpeg

I was so fed up with my children DVD being damaged after few weeks, that I decided to convert them to divX and store them on my computer. So, when the DVD is no longer playable, I play them from the computer.
I also would like to setup a nice TV interface is the future, to select them from my living roon.

Anyway, to convert a DVD to DivX, you can use the DVD O'matic software or follow the procedure below :
1 ) extract the contents to you hard disk
2 ) use the following command line to do a 2 pass encoding :
date;ffmpeg -i filename.VOB -pass 1 -passlogfile vts.log -qscale 2 -vcodec xvid VTS_02_temp.avi;date;ffmpeg -i filename.VOB -f avi -vcodec xvid -pass 2 -passlogfile vts.log -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 output_filename.avi;date
or for a single pass encoding :
ffmpeg -i filename.VOB -f avi -vcodec xvid -b 800 -g 300 -bf 2 -acodec mp3 -ab 128 ouput_filename.avi

NOTE : If your video sequence is split in 2 VOB files, you can do a simple >> to create a single VOB file :
cp VTS_01_1.VOB filename.VOB
cat VTS_01_2.VOB >> filename.VOB