Mar 5, 2008

Save space on your iPhone by re-encoding movies and TV shows

If you encode your own video for watching on various devices and you're looking to save every last MB on your iPhone, it could be worth your time to re-encode at least some of your larger files with more conservative settings. While I, for example, have been copying the iTunes Store's settings and encoding my DVD movies at full dimensions and about 1500 Kbps to really let H.264 shine, the truth is you don't need anywhere near that much data to watch quality video on an iPhone's display. By re-encoding your videos and perhaps keeping them in a special iPhone playlist for synching, you can bring even more of your favorite videos with you in a fraction of the space. Unfortunately, you can't re-encode videos you've purchased from the iTunes Store because of the DRM. This how-to primarily applies to video you download from the web or encode yourself from DVD movies and other sources.

To keep things simple, I'll use Blade Runner as our encoding guinea pig (which runs a length of 1:56) and Handbrake for all the encoding. Following are a few sample screenshots of how far you can compress a movie, along with the settings you can use in apps like Handbrake and TUAW favorite VisualHub to try this out for yourself.

These are encoded at 100, 200 and 350 Kbps and 480 pixels wide (the width of the iPhone display in landscape layout) from the top down:



Obviously, the 350 Kbps shot has a bit more detail than the other two in this particular scene, but the 100 Kbps movie on a whole is very watchable. Now here's the kicker - the difference in file size is incredible: This movie encoded at 1500 Kbps and full resolution weighs in around 1.5GB, but using these newer settings knocks the file down to around 190 MB (for the 100 Kbps file), 300 and 400 MB, respectively. That means you could easily fit anywhere from three or four movies (at the highest quality 350 Kbps setting) to as many as six movies (at the lowest 100 Kbps setting) in the same space as the original high-quality version. That's a huge difference, and a lot more entertainment in your pocket for those long commutes and plane flights.

If you want the full list of iPhone-optimizing settings to use for encoding your videos, here's a list that I used for this test case:
  • width to 480 and maintain aspect ratio
  • anamorphic off
  • de-interlace on (interlacing is for devices like traditional TVs; you don't need it for your computer display or devices like iPod or iPhone)
  • x264 (otherwise known as h.264, the high-quality codec/video format used for iTunes Store videos)
  • 2-pass encoding on (while this takes more time, it maximizes the quality of your final video file by basically giving Handbrake or your video compressor of choice two chances to get all the tricky compression math just right. This isn't necessary, but it will help you squeeze as much quality as possible into a smaller file.)
Of course, this isn't the only formula that can get you good - or at least decent - looking video to save space on your iPhone, but it's the thought that counts: If you're getting strapped for space, taking the time to re-encode your DVDs and other video for the iPhone can give you some breathing room for more stuff. Finally, since video encoding is one of the most intensive and time-gobbling things you can do on a computer, something like the recently-updated Turbo.264 could help save a few hours while re-encoding so you can waste time being entertained later.
Source...

No comments: