DVD Ripping and Encoding Under Linux
By Brent Norris
Disclaimer and Rant: I in no way condone the use of any of this for ripping of DVDs that aren't yours. Also know that by doing this you ARE breaking the DMCA. Also note that if you watch DVDs on a Linux machine in anyway that I know of you are breaking the DMCA as well. This is due to the fact that all Linux players I know of use source code to decode the DVD files, this is not the code that the MPAA has authorized and therefore according to the DMCA it is illegal. I personally find this a crock since I own all the DVDs that I am watching and working with and I paid for them all, as well as my computer and the hardware that it contains. I have performed nothing illegal, but yet I am a criminal. Fair-Use is a sham in the face of the DMCA. YOU ARE WARNED.
I know a few people that are reluctant to switch over to Linux for a few things that they already know how to do under Linux and they don't want to have to relearn how to do it, or they think that they have to learn a bunch of shell commands to get it things done under Linux. Hopefully this will help out with both of those problems.
- Linux Machine
- DVD Drive
- Lots of Hard Drive Space
- Network, the faster the better To take advantage of Clustering
Theory and ThoughtsThere are several things to talk about here, I guess. The first is that this is an extremely hardware intensive task. DVDs contain huge amounts of data and compressing that down to a resonable file size is quite CPU intensive. Also, since it is better to have the data on a faster storage medium than DVD so that the CPU doesn't have to wait for data, you need around 9 Gigs of free hard drive space to store the DVD data on. So fast, big drives and a quick CPU are a good idea. With the cluster effects of the setup I am going to describe you can use a bunch of slower machines to do the encoding in parallel, but it is still going to take a while.
Setup for the Ripping and Encoding (this was written before apt-rpm was available. You should get that to download all these packages)
- The first thing you need to do is head over to FreshRPMs.net and get the following RPMs for you distro: libdv, libdvdcss, libdvdread, avifile, transcode, perl-Video-DVDRip. I'm not going to link to them since they will change over time.
- You need Gtk-Perl and gtkglarea for DVDRip, but they are not done by FreshRPMs, so head over to rpmfind.net and search for it. Get the ones for your distro.
- For the clustering effects of the system you will also need perl-event, which can be gotten from CPAN at this URL: http://www.cpan.org/modules/by-module/Event/ and you will need fping which can be found at http://www.fping.com/. Unfortunately there are no RPMs for these packages so grab the
- Ok so now that you have all of this stuff you need to install it via rpm. Probably the fastest way would be to do a
rpm -Uvh *.rpm. This will sort the pacakages into the order they need to be and then install them, printing a hash for each package as it is installed. If you are the type of person who has to do things one at a time, I think the order you want to go in is the order I have them listed up above : libdv, libdvdcss, libdvdread, avifile, transcode, Gtk-Perl, gtkglarea, perl-Video-DVDRip.
- Now you need to do the compile on the two
tar.gzfiles, if you want to use the cluster capabilities. Start with the events tar file first. Decompress it with the command
tar -zxvf event.xxx.tar.gzwhere the xxx's represent the various numbers in there. It should decompress to its own directory.
cdinto that directory and run
perl ./Makefile.PMthis will build a makefile for you. Now as root (or with sudo) run a
make install. This should run for a minute and install all the stuff for you.
- The install for
fpingis similar except that it uses the somewhat more standard
configurescript. Short and dirty...
./configureand then with root privilages
make install. Now make a link to where
transcodeis looking for fping with
ln -s /usr/local/sbin/fping /usr/sbin/fpingand then set it setuid root with
chmod +s /usr/sbin/fping(both of these commands need to be ran with root privilages). Now I know there are people that are saying, "setuid root??!?!? That is so insecure!!!". To them I say, "Whaaa!!!" Look if you are encoding DVDs on this machine I hope to god it isn't a multi-user machine or at least you can trust the fools on your machine, if not then don't use the clustering stuff.
Working with Dvdrip
Well first you need to know what you run. The command is
dvdrip and should pop up a nice GUI to work with. The DVDRip site has some nice documentation for the GUI and the real indepth stuff. IMPORTANT: The version of PERL that Redhat 8.0 comes with has an issue. There is two ways to solve this: one is to run the command
export PERLIO=stdio and then run dvdrip. The other is two download one of the newer packages from freshrpms.net which contains a
dvdrip-safe script which works correctly.
The Clustering Effect
OK, here is the part that you most likely have been waiting for, "How can I harness the collection of 486s in my garage to rip DVDs in 3 minutes." Well the answer is... You can't. Nope not possible to do with the setup that this program has. See this program is not a true clustering setup, instead it uses a node of the "cluster" to encode each section of the file. So if there are only nineteen sections of the file then you can only use nineteen machines, and so therefore if you use nineteen 486s to encode the movie, you will still have to wait a really long time. The real bonus is when you cluster some relatively quick machines then you can churn out some movies.