Convert DVD to H264 in terminal

http://blog.teamleadnet.com/2012/03/decss-and-convert-dvd-into-h264-video.html

 
1. INSTALL PACKAGES
 
The fist step is to install the Handbrake’s command line interface, so called Handbrake-CLI. To do this, you have to add a non-official repository to your software collection:
 
sudo add-apt-repository ppa:stebbins/handbrake-releases
 
 
after this, you can install Handbrake CLI using the well know process:
 
sudo apt-get install handbrake-cli
 
 
After this step, you have the tool to compress any video into H264 format. The following steps are required to rip (DeCSS) a DVD because Handbrake will refuse to work if the DVD is copy protected:
 
sudo apt-get install libdvdread4
 
 
This step will only allow you to watch copy protected DVDs. If you want to copy them to your hard drive and remove the copy protection, you need to manually run a custom shell script file that was installed with libdvdread4:
 
sudo /usr/share/doc/libdvdread4/install-css.sh
 
 
This will provide a library to every tool on your system if they require to remove the copy protection (DeCSS).
 
 
2. PREPARE ISO FROM DVD AND MOUNT.
 
If you have a physical DVD in your drive, you can skip the following two steps. If you have a DVD ISO, you can skip the following one.
 
To create a DVD ISO file from a VIDEO_TS directory on your hard drive, run the following:
 
mkisofs -dvd-video -udf -o dvd.iso /folder-with-VIDEO_TS-in-it/
 
 
When you have the ISO, simply mount it:
 
sudo mount -o loop dvd.iso /mnt
 
3. JOIN DVD IN ONE SINGLE FILE.
 
You are close to removing copy protection! To do so, use vobcopy utility to copy your DVD video VOB files into a single large video file without copy protection (the –l option tells vobcopy to use a single large file instead of creating 2Gb chunks):
 
vobcopy -l -o outDir/
 
 
This will open the mounted ISO/physical disk and copy into a single VOB file, which can be converted to H264 video using Handbrake CLI (-q corresponds for quality; -B tells to compress the audio into 160kbps; -t tells which title to convert in case you have more than 1):
 
4. CONVERT TO H264 AND UNMOUNT
 
HandBrakeCLI -i outDir -o movie.mp4 -e x264 -q 20 -B 160 -t 1
 
 
Don’t forget to unmount your ISO at the end:
 
sudo umount /mnt
 
 
Done, download and enjoy your quality H264 video!
 
MORE ABOUT VOBCOPY:
 
 
 
 
Here you can learn how to copy the whole dvd structure to a hard disk:
 
IN SHORT:
 
1. To copy the dvd to a hard disk:
a. Go to the folder where you want to create the copy.
b. Type in terminal: $ vobcopy -m
(you must have libdvdcss2 installed
 
2. To create an iso from the copy created in the folder:
$ cd MOVIE_FOLDER
$ mkisofs -v -dvd-video -o ../MOVIE_NAME.iso
 
3. You can mount the iso and rip it with Handbrake.
This entry was posted in Uncategorized and tagged , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s