Alex headshot

AlBlue’s Blog

Macs, Modularity and More

From DVD to Mac, Xbox and iPod

2006, mac

My brother kindly put together an XBox (the old one, not the 360) running XBox Media Center, which allows it to be used as a TV-capable video hosting solution. Given that it's got a hard drive on-board, as well as an ethernet network cable, it's pretty easy to get hooked up onto a network and read (from a Samba share) any home movies etc. that you have made.

I've got a few DVDs that I'd put together with Final Cut Pro, and I wanted to see how easy it would be to get them running on the Xbox media center, and at the same time, a solution to get them running on the iPod as well.

First stop is a program called Handbrake. It reads from a VIDEO_TS folder or directly from a compatible drive and turns the content into QuickTime movies (actually, MPEG4 movies). It uses things like ffmpeg under the covers to do the conversion into the appropriate video format; you can choose to encode it into MPEG4 or H264 encoded video. (I chose MPEG4; a video iPod supports higher bitrates for MPEG4 than it does H264, and even though it's likely to be a bit larger, it doesn't make enough difference for it to be worthwhile.)

Handbrake's user interface is a bit clunky, but works well enough; it's a Universal application, so will run on Intel as well as PowerPC systems. What's more, it's multi-threaded, so it will take advantage of multi-processor systems. Currently, it's chomping its way through both of the PowerPC chips in my system. You get to pick what combination of chapters/titles to pull out (chapters can be pulled out contiguously; each title must be extracted on its own, however). There's some minor niggles; if you increase the 'from' chapter, the 'to' chapter isn't bumped up; nor is there a way of being able to pull multiple chapters into individual files). But you don't spend that long in figuring out how to use it; and it automatically crops the resulting file to the dimensions, so if it's a letterbox format, the letterbox part isn't encoded and thus doesn't take any space up.

You get to tweak a lot of features; specifying target size, average bitrate or quality; given that I had no idea which ones, I left it at an average bitrate of 1mpbs. You will probably also want to select the 'deinterlace' option which is hidden on the Picture Settings screen; and if you want to just get data for your iPod, the max resolution is 480x480 at 2.5mbps for MPEG4 video. If you want to run it on other systems e.g. an XBox media center or a Mac Mini connected to your TV, the you might want to leave it as the same resolution as is on the DVD. I also used the 2-pass encoding; it takes twice as long, but it's supposed to give better quality (since it analyses it in its entirety once, then encodes on the way through afterwards).

Whilst you can rip two languages (e.g. main audio track and audio commentary) I've found that the players tend to play both at the same time, which is less than desirable. Without convincing the output that it's a different language, you might not be able to switch between them; so my recommendation is to just get a single language on the output.

Whilst you're doing the conversion, you should be writing to a local drive. This is likely to be a default, but if your final destination is going to be on a shared network drive, start off with it on the local drive first. Also, standard advice -- do a test run first, and see what you think -- is always a good thing to follow.

Having got a bunch of .mov files, you can now run them directly with the XBox media center. You'll need to set up a Samba share first of all; it's easier to do this on Windows than on Linux, and easier to do on Linux than Mac OS X. You either want to have it completely unpermissioned, or set up an account for your XBox media center to log in as. It probably makes sense to share it as read-only; after all, the XBox media center won't need to write there.

The access for the media center is done via the setup in My Videos; you can then connect to the Samba share. If it doesn't work at first, it might be because of your userid/password that you set up before; try on a Windows PC first of all, to make sure it's visible. I had problems before I set up an account for the Xbox media center to use. The user interface is a bit clunky; you end up navigating by folders. (I suspect there are some new interfaces that are coming along in the future though.) But you just pick a folder and then the file, and it will start playing.

If you want to play them on your iPod, you'll need to convert them into a suitable form. iTunes will do this for you; even if it's in a supported encoding and bitrate, iTunes may need to do another pass to shrink it down to fit the iPod's resolution. Realistically, this will lose more quality, but on an iPod screen, you're seriously unlikely to notice. However, iTunes has the ability to report videos as either music videos, videos, or TV shows (thanks to the recent TV shows being sold on iTunes). Unfortunately, iTunes doesn't offer much of an interface to be able to type in metadata; even if you've got QuickTime Pro, it doesn't let you type the information in.

Instead, a library called Atomic Parsley (and a bunch of derivative GUIs that drive it) can be used to add information about show, season, episode and so on. Personally, my favourite is PAD (Parsley is Atomically Delicious). With PAD, you can amend the meta-information for many files in one go; good if you've got one file-per-chapter from above. You just drag multiple files into PAD, and then step through each one assigning the episode and season values. PAD has a 'replace' mode which makes sense; because Atomic Parsley has to read and then write a file to add metadata, if you don't chose 'replace' you get a random -temp filename on the end. Like other GUIs, it's not perfect -- you have to remember to click one of the files, as if you don't you get a warning message about not doing anything -- but it's fairly simple, and re-writing the file doesn't take long. If you're doing a lot of conversion, I'd suggest doing the encoding to MPEG4 in totality first, then check the output, and then add the meta-data in one go. You won't forget which files you've amended then :-)

There's a 'bug' in the Atomic Parsley libraries that causes some badly encoded MP4 files to generate huge sized files in the output. If you get something which isn't the size you expected, then try to convert it into a decent MP4 first of all (there's a droplet that comes with PAD that converts a QuickTime supported movie into MP4, even without QuickTime Pro installed).

You can then move the newly metadata'd MP4 files into a network share, and then drag them into iTunes to register them. (Or, if you've got iTunes to copy the files into the library when you add them, you could just drag them in and let iTunes do the copy.)

So, in summary:

  1. Use "Handbrake" to convert your MPEG2 and VIDEO_TS folders into MPEG4 compliant files.
    • Click the 'enable queue' checkbox to support many conversions at once
    • Click on 'add to queue' when you've set up each title/chapter
    • Remember to check 'deinterlace picture' (from the picture options)
    • Remember to check '2-pass encoding'
    • Click on 'rip' to do the conversion of all queued items (can take some time, have a good cup of tea handy whilst it happens)
  2. Check each file to make sure it worked. Normally, this just involves looking to see if it comes up as a preview and play a couple of seconds in Finder.
  3. Use "Parsely is Atomically Delicious" (aka PAD) to add metadata to the shows. This is particulary important if you want to add information about episodes.
    • Click on the 'Apply to music fields' if you want the season/episode of TV shows to be stored in the disc and track number respectively. Since this information isn't often shown, having it in there can allow you to use smart playlists, which otherwise ignore the information.
    • Click on the 'replace' checkbox. Otherwise, it will write out a -temp file.
    • If you want the episode ID as a number, unselect 'Derive Episode ID'. Otherwise, it sets up the episode ID as 1x01 First Episode Title. I don't have Front Row, but it seems like a good thing to have in the episode details; and it's also shown in the iPod window, too.
    • Click 'process' after each episode. If you move off the file entry, your changes are lost.
  4. Move them to a network share, add them into iTunes, sync with the iPod and/or view them on an Xbox media center or Mac Mini hooked up with Front Row.

Hope that's useful stuff :-) There's a lot of information out there; I'd also recommend you read The last iPod video guide you'll ever need, which has a bunch of screenshots for some of these applications.

Final note; if you're just pulling off video for use with an iPod, then there's a Handbrake Express, which knows the default settings for iPod videos, and uses those. However, if you're using them to watch on a TV as well, I recommend encoding to at least the same resolution as the original, so that they look OK when broadcast on screen. And if hard drive space is a premium, and you know you're going to be playing the movies with a QuickTime source, then H264 is probaby a good encoding choice.