Automated Video Processor for iTunes (AVPI)


Videos purchased from iTunes come in standard and or high definition, perfectly formatted for your iDevice, and include features like cover art, movie ratings, description, cast and crew names, subtitles, and more.  While purchasing from iTunes is convenient, it can quickly grow to an unacceptable expense (especially if you already have a video file library).  This script outlines how you can automatically (for the most part) create iTunes like videos from the media (ex. avi, mkv, DVD’s, etc) you already own.

JesseWeb.Com’s Automated Video Processor for iTunes (AVPI)
Version 2.1  09/05/2012

Key Features:

  • Converts existing video sources to iTunes format (m4v)
  • Automatically selects and converts “main movie” for DVD folder or ISO sources
  • Automatically creates an iTunes HD-SD video combo from HD sources – enabling you to stream or sync your desired version from iTunes (ex. sync the SD version to your iPhonee and stream the HD version to your Apple TV)
  • Automatically optimizes videos for HTTP streaming (i.e. optimize for iTunes home sharing)
  • Batch convert videos with same or different encoding types (ex. encode all as SD, encode first as HD and second SD)
  • Automatically includes English audio tracks (if present) - You can customize to your desired audio languages by modifying the script below.
  • Automatically includes English and Portuguese subtitles (if present) – You can customize to your desired subtitle preferences by modifying the script below.
  • Automatically deinterlaces interlaced sources (when selected) – good for 480i files like DVD video or 1080i broadcasted video
  • Add video metadata like album art, movie synopsis, director and cast info, movie rating, etc
Current Limitations/Issues:
  • All sources must be on writeable media (ex your hard drive)
  • Only works on video files, DVD folders, and DVD ISOs (not folders, not files and folders, not DVD discs, not mounted DVD volumes, etc)
  • DVD’s with multiple titles (ex. a TV show DVD) may not have all episodes encoded (as only the “main movie” will be encoded)
  • Requires you to edit/confirm metadata in iDentify (I prefer to validate and fine tune this information before saving so this will likely always be a limitation)
  • Slopping but effective coding with limited error handling
Note: I am sharing the work I have done for my personal use as it may help save others time seeking to do the same.  As I automate more, I will continue to update this post.  This information and code comes with no support.  Use at your own risk.
    1. Create a new Automator service
    2. At the top of the service, set ”Service receives Files or Folders in Finder”
    3. Add a “Run AppleScript” step with the following code:
    4. Save the service


  1. Simply right click on any video file or DVD folder, choose “Services”, and select the name of the service you created
  2. Select your video source type

    - An SD source will produce 1 SD video formatted for the iPhone 4
    - An HD source will produce 1 SD video formatted for the iPhone 4 and 1 HD video formatted for the Apple TV 3 (and display as 1 HD-SD video in iTunes)
  3. Wait for the encoding to finish and the files to be loaded in iDentify
  4. The script will indicate that it has finished, leaving you to use iDentify and edit/save the correct metadata in your new videos
  5. Simply import the new videos into iTunes and you’re done!

Jesse Torres

Found something you liked? Like or Share it above or comment below.

You may also like...