Batch convert iPhoto Videos to MP4

Exporting videos from iPhoto is quite easy – just create a smart album to filter out your movies, then select the movies you want, and go to File > Export… and export the movies in their current formats.

However, if you want to convert your videos into a consistent format that will play on your Apple TV, iPhone, iPad etc, then you are going to have to convert them first. You could do it manually by opening each video in Quicktime, and exporting it in the right format. If you have dozens, or like me, hundreds of video clips then this isn’t going to work very well.

Batch convert iPhoto videos with Handbrake

To speed things up you can exploit the power of a free application called Handbrake to batch convert iPhoto videos.

Handbrake is an incredibly useful video conversion utility for converting a broad range of formats into H.264 MP4 format (i.e. playable on all of your Apple devices). It will also do a very good job of ripping DVD’s to MP4 as well (although this is technically illegal in many countries, including the UK) – great for making your DVD collection available from your NAS/iTunes.

What makes Handbrake exceptional, though, is its command line interface. Just about everything it does can be called from a script.

The following script will search your iPhoto library for video clips, convert them into MP4 format, and then save them into a tidy directory structure broken down by year. Now you can batch convert iPhoto videos to MP4 in one fell swoop.

Notes on setting up the script

Head along to the Handbrake downloads page and grab a copy of handbrake app and get the command line extensions as well.

  • Install Handbrake in the usual way by dragging the app from the dmg container into your Applications folder.
  • Install the CLI application, HandBrakeCLI, from the second dmg file into the same directory as you save the script below. Alternatively, if you know how to view hidden files and directories you could save it into /usr/local/bin to make it universally available.

Now you just need to configure the script for your input and output directories.

For example if your iPhoto library was at

and you wanted to output your converted videos to

then inputdir and outputdir should be configured as follows:

Here’s the script – copy and paste this into an empty file, call it something meaningful (converter.sh for example) and then chmod 700 the file to ensure you can execute it.

There is a wealth of information from the developer for the HandBrakeCLI and I encourage you to have a good read and the settings used in the script above are quite basic and you may want to experiment to get optimal results. Enjoy!

,

No comments yet.

Leave a Reply

Time limit is exhausted. Please reload CAPTCHA.