I have been asked numerous times about how to encode purchased DVDs into the video equivalent of MP3. For me, and many others, this is MP4.

DVD to MP4

The below steps will explain how to convert a DVD into a MP4 format, complete with metadata and artwork. (The process is nearly identical on Windows and Mac – Sorry Linux fans, I have yet to dabble with this on that platform, but I’m sure it’s almost the same too)

Even though you own the DVD, the act of ripping it and converting to another format is still very much a legal grey area. (I hope this guide doesn’t get pulled because of this!)

You will need a few applications;
MacTheRipper (Mac) or DVDShrink (Windows)
Handbrake (Mac & Windows)
MetaX (Mac & Windows) or Subler (Mac)

And a few sites to help with obtaining the metadata;
IMDb (General Data)
Netflix (Genre and Outline)
Barnes & Noble (Chapters)
tagChimp (General Data and Chapters)
Wikipedia (General Data)
Get Video Artwork (High resolution artwork)
Blockbuster (UK Ratings)
Internet Movie Poster Database (Last resort if you cannot find decent artwork)

Ripping the DVD

Handbrake can convert straight form the physical disk itself, but I prefer to rip it to my Hard Drive first.

With MacTheRipper, it’s easier to insert the disk and click “Go!”. This will rip the entire contents of the DVD, allowing you to pick out the parts you need later. Ripping a specific Title can be a bit fiddly.

DVDShrink can do the same thing via the “Entire Disk” button. But it is much easier to rip just the Title of the Main Feature using the Re-Author option.

To save getting into unnecessary detail, for the purpose of this guide, rip the whole Disk.

Encoding the Movie

Handbrake Main Screen

1. Launch Handbrake. You should be prompted for the Source File(s). If not, select File>Open.

2. Handbrake will scan the Contents. Once finished, open the Preset tray and select Universal.

3. In the main screen pick the Title you want to encode. This is usually the longest one for the main feature. Play the DVD elsewhere and take note of the Title number to be sure.

4. Type in the location and name of your desired output file (for the Windows version, all special characters must be removed. You can change the filename after).

The default setup here should be fine for most people, so it is safe to skip onto the Audio and Subtitles Step – you will be left with a perfectly acceptable video file. If you’re interested in some of the finer points, read on…

5. In the Video tab click Picture Settings.

HandBrake Picture Settings

5a. Set Anamorphic to Strict – this will force Handbrake to keep a pixel-for-pixel resolution of the original (no scaling like with the loose option)

Because of this, you have to adjust the Cropping to keep the video the correct shape;

5b. Set the crop to Custom and adjust the numbers so that they are multiples of 16 (this is to do with macroblocks – there are numerous post online explaining this, but for now trust me, 16 is the magic number) and even numbers (e.g. if you find you have 71 and 73 for the top and bottom, you should change them to 72 and 72 – this is to do with efficient encoding).

Keep note of how much of the video you are cutting away or adding back. adding too much back may leave more black edges than you would have liked. Cutting too much away may take away too much of the film. The last one is highly unlikely as, when overscan on CRT TVs was an issue, the extreme edges of the film were cut off anyway.

5c. If your source is interlaced or Telecined (again, plenty of posts about this elsewhere) select the relevant Filters. Decomb can be left on if you are unsure, as this is like a ‘safe’ de-interlacer that will only be brought into effect if needed.

5d. Now check your Source, Output and Anamorphic numbers;

The Output should be the source minus your crop values, exactly. The Anamorphic should with the same height as the Output. This can be ignored if you have chosen “Loose Anamorphic”. I prefer strict as you are left with an exact pixel-for-pixel copy of the original without any scaling.

6. Onto the Audio and Subtitles Tab.

Handbrake Audio and Subtitles

6a. The default here is for track 1 to be an AAC Pro Logic II mix-down of the 5.1 AC3 source, with Tack 2 being a passthru of the source. This is fine in nearly every case.

The two tracks are for compatibility. The Apple TV and Media Players can pick off the AC3 5.1 track (Amplifier friendly) whereas the iPhone and iPods can use the Pro Logic II track, as it’s just stereo. The ProLogic II allows those with PLII amps to playback the pseudo-5.1 from the portable devices too.

Ideally you would do away with both of these and choose the 6-Channel discrete AAC, as this is the ideal equivalent to AC3 5.1. But due to a slow uptake on this standard we are forced to use the 2-Track method above, breaking the MP4 standards. Plex and XBMC can down-sample 6-Channel discrete AAC to AC3 5.1, but they are the only ones, leaving you with a file un-playable on the iPods and iPhone and a mix-down to something non-AC3 from the Apple TV. A real shame, but what can you do?

You can set the 2nd Track to None if the source is only Stereo or Dolby Surround (no point have two sets of 2-Channel tracks).

6b. Choose any subtitles you would like hard-encoded to the movie file. These will be ‘burnt’ onto the video itself so be sure before you choose any (such as Forces Subtitles where some Movies may have translated scenes). I will post another guide for adding soft-subs to your files once I have found a bullet-proof method.

7. The Chapters Tab.

HandBrake Chapters

7a. Fill in the chapters via whichever method suites you (copy and pasting from one of the sites listed above, manually from the DVD box, or choose your own by watching the movie).

The Advanced Tab can be left alone, as this is really reserved for the hard-core tinkeres.

8. Click Add To Queue or Start depending on how many DVDs you are encoding. Depending on your Computer, the encoding process can take anywhere from 1 hour to 1 day (yes my 8 year old PC used to take a whole day to do this!).

Adding the Metadata, or ‘tags’

If you’re only interested in a file to playback the Movie, indifferent to cataloguing your collection, you can skip adding any data to the file. I, however, like having all the information stored within the file, like with MP3s (it’s only Apple Media players and various Operating Systems that can read this data for now, but this will change).

Open your weapon of choice, be it MetaX, Subler or one of the more obscure ones and populate all the required fields. The sites listed above are great for this.

Once complete, Save/Write the data to the file.

You’re done!

Tutorial Movie Screenshot

The file you are left with is about 33% to 50% the size of the DVD Title and can be imported to iTunes with all the data intact. It will be exactly the same resolution as the original (if you choose the ‘strict’ method) and can be played back on almost any device – one file the rule them all!

I will post a guide for Blu-ray and High Def rips once that process has been more streamlined and standardised.

Some likely questions and things to note

Why choose the ‘Universal’ Preset?
This is the most compatible format to use. It leaves out all the unnecessary ‘extras’ that make it un-playable on some devices. One example is the B-frames added for the Apple TV preset – this only saves about 10% more file space but makes no improvements to video quality.
The consoles are always changing their requirements and therefore rendering their presets useless too often. They are being removed from the next release I believe.
The AVI container is a dying format and will also be removed from the next release of Handbrake.
The device-specific presets reduce the resolution for playback via the device’s screen only – too low for TV use really.

Be careful of blank chapters at the end of a Title.
Some DVDs are authored with a chapter at the end of the movie no more than about 3 seconds long. This is to help with the menu navigation (I think) and can be left out (select the previous Chapter as the last one in Handbrake’s main screen). leaving it in will result in an unwanted entry at the end of your Chapter List – not a huge deal, but irritating non the less.

Double-check your Movie duration once encoding is complete.
Handbrake will add or remove a few frames here and there to keep things in sync (nothing that can be spotted during playback, don’t worry) so the output file’s duration should be the same as the original, give or take a few seconds at the most. The movie studios are very aware that programs like Handbrake can circumvent most attempts to prevent encoding, so have started adding deliberate errors to the DVDs. These errors are handled by stand-alone players no problem, and skipped over, but many can cause Handbrake to choke. I am suffering from this issue with Iron Man – selecting the subtitle track for the bits of translation at various scenes causes Handbrake to drop whole scenes from the movie, leaving me with a file a full 15 minutes too short. This is because they haven’t kept that particular subtitle track’s time-stamp in sync with the main movie… sneaky cretins.

You can set the Constant Quality to anything from 59% to 62%.
Anything lower will result in noticeable artefacts. Any higher and you are wasting space. In this version of Handbrake, the percentage is in relation to theĀ original film source, not the DVD – setting it to 80% will result in a file the same size as the original DVD, any higher and the size balloons. In comparison, a Blu-ray is considered 95% percent of the original film source.

The same method can be followed for TV Shows and 4:3 sources.
Just select the required Title, or Chapter range, that relates to the episode you’re wanting.

Some DVDs will flat-out refuse to rip.
For these you can plump out for DVDFab.

Please post any questions relating to this guide in the comments below.
I will respond as best I can.