ripping

Transcoding DVDs

Oliver Brown
— This upcoming video may not be available to view yet.

Following my post about ripping DVDs, here is a method for transcoding the DVDs into something more manageable. I should point out that is probably for the more technical amongst you - there are certainly easier ways to do it but this has the advantage of being very automatable.

Since MythTV (and Linux in general) seems to like ffmpeg for video encoding/decoding, I figured I’d use that. You can get a binary version for Windows and read the documentation.

The actual command line I use to transcode is: ffmpeg -i $in_file -vcodec xvid -qscale 5 -acodec copy $out_file

That means to use $in_file as input (a VOB file in my case), use the Xvid codec for the video, set the “quality” to 5, copy the audio straight from the original and save as $out_file. The quality in this case is just simplification of lots of other settings that are available. 1 is perfect and 31 is the worst. 5 results in files that are about 500MB per hour with MPEG artifacts that are visible when I’m sat at y desk but not when I sit on my bed six feet away which is where I normally watch video from. It may be worth transcoding a short clip with a few different settings to see which your happy with.

I made the whole process semi-automatic by writing a CLI PHP script that checks for VOB files in a specifc folder and transcodes the ones it finds. That way I can have the transcoding going on in the background while I rip the DVDs (and then leave it running it overnight to finish). I could make it available to anyone who wants it, but a batch files doing the same thing would probably be more useful for people…

There is one last caveat. I originally encoded the movies with MP3 audio and then half way though decided I want to keep the 5.1 audio (which the above method does). However the version of ffmpeg I used at first had a problem such that AVIs with AC3 audio played back with no sound. If you have a similar problem make sure you have the latest version of ffmpeg you can get.

Ripping DVDs

Oliver Brown
— This upcoming video may not be available to view yet.

Since I’ve decided to try and set up a MythTV system I figured getting my DVD collection on to hard drive(s) would be a good move for convenience.

There’s a lot of information on the Internet about copying DVDs, whether to other DVDs, to CDs or to a hard drive in their original format or transcoded. I wanted to get the main movie only from a disk and transcode it to XviD for space saving. Here are the steps I have that worked (for Windows incidentally):

The first step is to get the main movie from the disc. This isn’t straightforward since most movies are put on DVDs in a way to deliberately make it confusing to get them off. I used a program called DVDDecrypter (getting a hold of this might be a problem since the original author doesn’t make it available any more due to a recent change in his local laws). DVDDecrypter has a mode called “IFO Mode”. IFO files are the files on a DVD that contain information about how the chapters and program streams go together. The basic idea is to find the program stream that “looks right”. In the case of a movie, the one that’s about an hour and a half long (or two hours -whatever) should be the right one.

This process is pretty quick, about 8 minutes on my Athlon 64 3000 for a movie 100 minutes long. The result is a .VOB file with just the section you selected. A .VOB is really just an MPEG file with specific encoding setting and possible subtitle information. Many media players can play these directly.

In the next part, I’ll deal with transcoding the VOB files.

It should be noted that there may be legal considerations with this sort of thing. A lot of DVDs are encrypted and bypassing the encrpytion may or may not be illegal where you live (for example it’s skirting on the edge of the DMCA). In my case I own all the DVDs I rip and the rips are of a (marginally) lower quality than the originals, don’t have 5.1 sound and are missing all the extra features. As such I feel any concept of fair use covers me morally. You have been warned however and follow any of this advice at your own risk.