Setting up an automated workflow to convert files for Apple TV on OS X
March 23, 2007 – 8:45 pmWith the arrival of my Apple TV yesterday I needed a solution to get my Xvix/WMV/Divx files converted and imported into iTunes so that I can watch them. I already have Quicktime Pro, which with the recent release added the ability to “Export to Apple TV”. Since I have a lot of files, and no desire to sit around and convert these one at a time, it seemed like a perfect job for automator. I figured someone out there at some point had to have done something similar so I did a bit of google searching and found the required automator actions. Using the actions I found combined with the sample workflow they have already created for you, it is trivial to set-up a workflow that will convert to the Apple TV format and then import the file into your iTunes library. With a slight modification you can set it up a plug-in and attach it to a folder action. Now I have a simple drop folder on my desktop that launches quicktime pro and converts the file to an Apple TV viewable format, imports the file into iTunes, and cleans up after itself.
Here is a simple step-by-step guide to walk you through what I did:
1) Install xvid, divx, and wmv codecs.
These can be found here:
2) Install the automator actions for compressing and importing into iTunes.
Download Quick Time Compression Actions and Workflow
3) Once installed you will have a directory on your desktop called “QuickTime Compression Workflow resources”. In this folder you will find a sample automator workflow called “Convert videos and add to iTunes”. Open this workflow in automator.
4) Delete the first step of the workflow which is “Ask for Finder Items”. Instead of being prompted for which items to convert, we want to setup a folder action that will automatically convert the files dropped in our folder.
5) Add a new first step to the workflow called “Get Selected Finder Items”. This action can be found under the “Finder” application.
6) Under the “Compress QuickTime Using Most Recent Settings” step change “Choose directory for converted files” to the desktop (or any other temporary folder you want to use).
7) Create a new folder on your desktop. This will be your drop folder, so call it something relevant. I called mine “Convert to AppleTV”.
8 ) Back in automator, click on file and choose “Save as plug-in”, choose “Folder Actions” from the “plug-in for” drop down. Give the plug-in the same name as your folder. Select your newly created folder for the “Attached to folder” option. Click save.
9) Since the script will convert whatever file you drop in your conversion folder using the last settings you used in QuickTime you’ll need to launch QuickTime with a test file and then choose “Export” from the file menu. Assuming you have the most recent version of QuickTime Pro you should have an option “Export Movie to Apple TV”.
10) That’s it!!! Now just close out of everything and drop your files into your new folder and watch as they are converted and imported to iTunes. It works great to leave your Mac on and then drop a bunch of files in the folder before you go to bed. When you get to your PC in the morning everything should be all ready to go.
To find out more about folder actions, check this page out:
52 Responses to “Setting up an automated workflow to convert files for Apple TV on OS X”
Great advice for all the Apple TV buyers in the same boat as you, sure wish Apple would just ad the support in iTunes for these codecs or maybe have the ability to point the Apple TV to a specified non iTunes folder that hold these files, of course the Apple TV would then have to be able to play them…
http://www.switchingtomac.com/
By Mac vs PC on Mar 24, 2007
Hey…just wanted to send out a big thank you for posting this great advice!
I’m getting a 42″ flat screen TV and AppleTV in April, so my conversions are beginning now. Hopefully by the time that beauty arrives through the door, most of my content will be ready to roll.
Again thanks for taking the time to post! This method will make my life so much easier.
Best!
-G5Man
By G5Man on Mar 24, 2007
Seems that Apple has chosen to make AppleTV *very* open, and some smart free-thinking hackers have already figured out how to allow AppleTV to play x-vid, divx, and a host of other formats (No Matroska, yet, though
)
You can find this info out at:
http://forums.somethingawful.com/showthread.php?s=&threadid=2391956
So far the steps are not pretty or easy, but they are working on it and it should be no time before they are able to do all of it without having to open the appletv up.
By Jim on Mar 24, 2007
Cool story. Automator is a really cool application that’ underrated in my opinion. I was thinking of making something like this for when the iphone is finally released.
I made some automator actions just for converting movies to other formats. one uses quicktime, the other ffmpeg. http://rhettmaxwell.org/automator
By Rhett Maxwell on Mar 24, 2007
See - this is the kind of thing I needed ages ago, as I have a large library of DivX and XviD encoded avi files. I tried to convert them in QT Pro but always got really crappy output. Even in H.264 at like 2500KBit/s.
I’m gonna give this a whirl see how I get on
pac
By Richard Harris on Mar 24, 2007
Make sure when you do this:
8 ) Back in automator, click on file and choose “Save as plug-in”, choose “Folder Actions” from the “plug-in for” drop down. Give the plug-in the same name as your folder. Select your newly created folder for the “Attached to folder” option. Click save.
That you click on enable folder action check box, once you do that it works. took me a little bit, might be a noob
By Lawerance Oak on Mar 24, 2007
This is great! Since I live in Canada, iTunes does not offer any movies or TV shows in their store for us canucks. As a result, I saw no need to get an Apple TV.
All my video comes from bittorrent and I have to watch them on my 15″ screen. But I want to watch on my large screen with friends/family, instead of hovering around my laptop.
With this tutorial, I can no reconsider getting an Apple TV.
Thanks!
By dalvin112 on Mar 25, 2007
Thanks this worked great
By lufcpdx on Mar 25, 2007
Can one of you talented hackers make an automated program that does the same for XPPro users? I’d like to be able to convert .wmv, .avi. and .dv files to Apple TV.
Or else a hack that does what reviewers are claiming for ATV; that it ‘finds all the videos and music on your computer.’ Wrong! As we know, it only finds them in your iTunes folder, and there’s no way the average person is going to go through the transcoding process with any and all videos they may have downloaded…such a news stories from local news web sites that inevitably are ‘wmv files. Or DVD files they’ve got on their computers from DVD Ripper or similar.
By tektoni on Mar 26, 2007
This method works in theory, but I’ve tested it a bunch and I found a major flaw.
When you use the automator action, “Compress QuickTime Using Most Recent Settings” it occasionally will encode your files incorrectly, even if the most recent settings were “export to apple tv.” I’m not quite sure why, but I think it has to do with the fact that when you export to appletv, it outputs several different resolutions and framerates depending on the source video. This automator action isn’t smart enough to tell quicktime to use the “export to apple tv” preset, but instead uses some other custom indicators sent directly to quicktime pro. I’ve tested this a bunch and ended up having to bag it because only about half of my videos came out with the proper resolution. In fact, some of them came out very blurry and horribly compressed, as if they weren’t even using the proper settings at all!
All in all, I think for this method to work, you’re going to have to have the developer of the compression quicktime automator action do some revisions to the code. I can’t say I can trust this method now because if I can’t get the proper results 100% of the time, then automator actually WASTES my time instead of saves it.
For apple tv compression, just use ffmpegx. It’s much faster than quicktime pro and you can tweak exactly how you want it to look when it’s done.
By Thayne on Mar 26, 2007
Thanks! I just followed your instructions and am test converting an episode of BSG that is in .avi format. I don’t have QT pro but the regular QT seems to be working just fine. We’ll see. If not, then I guess I’ll pop for another license. Of course, last time I did that they updated QT about 2 weeks later and my license was no longer valid.
By Darleen on Mar 26, 2007
Doesn’t work for med. If I run the script directly in automator (without modifying it) I get an error saying QuickTime can’t find some file. :/
By Leo on Mar 26, 2007
me*
The error message:
“QuickTime Player got an error: a file could not be found (-43)”
By Leo on Mar 26, 2007
Leo,
The problem you are seeing is because the temporary location on the “Compress with recent settings” step is not set correctly. Change that to your desktop (or elsewhere) and it should work from within automator.
By Jason on Mar 26, 2007
Yay, it works now. Thanks.
By Leo on Mar 26, 2007
you may not need a QuickTime Pro license; you can export from QuickTime Player to many formats using AppleScript; i don’t know exactly what spec “Export to Apple TV” outputs, but there are options that should work with Apple TV
By sporobolus on Mar 26, 2007
For some reason the script works to the extent that it converts files dropped into the folder and exports them to the desktop in the proper format. However, it is not automatically importing the files into iTunes. Any thoughts on where I may have gone wrong?
By Ryan on Mar 26, 2007
I use a freeware tool called iSquint to convert all my DIVX files to *.mp4 format. Works great and delivery great quality as well.
By marc on Mar 28, 2007
Suggested reading:
http://www.roughlydrafted.com/RD/RDM.Tech.Q1.07/147048D8-D8B7-45E7-9A97-3CD5B4C2B75A.html
and scroll down to:
Pirate 5.1 using DivX and XviD
By Anthony on Apr 9, 2007
I wish I had something like this to convert videos for my xbox.
By Motorcycle Guy on Apr 22, 2007
Great post! What I am looking for is a way to automate FFMPEG X, since it’s the only way I know to convert DivX files and also add SRT subtitle files. (I have a ton of subtitled DivX movies). Any ideas?
By Wiley Wiggins on May 3, 2007
What a great tutorial! As an Apple TV Owner myself, this information is really useful. Thanks.
http://www.dvd-to-wmv.com
By James on Jun 12, 2007
This recipe doesn’t work in Leopard… Can I get an update for it with updated “Download Quick Time Compression Actions and Workflow” Thank you! Jeff
By Jeffrey Engle on Nov 21, 2007
Doesn’t work for me either I am trying to run this under leopard I am getting the following error.
“QuickTime Player got an error: a file could not be found (422517408)”
I already modified the temporary location to point to my desktop, anyone have any ideas.
I have also tested different video files(AVI,mpg4)
By Anthony on Dec 5, 2007
Wow. I just found this (where have I been?), and as the author of the QuickTime Compression Actions, I’m thrilled to hear how all of you have been using it. Like some of you, I’m a bit frustrated at the moment that the Compress Quicktime Using Most Recent Settings action doesn’t seem to be working. I’m poring over the code to try to figure it out. Is it working for ANYONE with Leopard?
By Tim on Dec 31, 2007
Tim,
I’m running a similar automator script on Leopard and when I run it manually it works. When I run it with an Automator script that uses Compress Quicktime Using Most Recent Settings the audio tracks are out of sync. Note that I’m converting TOD (JVC MPEG2) to MOV using apple intermediate codec. Any suggestions would be appreciated.
By Peter on Mar 2, 2008
Running Leopard, this works up to a point: the files are not put into iTunes. Conversion is fine, though.
By Jeff on Mar 18, 2008
Yeah I set the scrip up to convert a divix file to apple tv through automator just like the top of the post says. The whole process seemed to work, but the file was never put in itunes. Actually I cannot find it anywhere on my hard drive. Can somebody give me some help. I am running tiger, itunes 7. So I would think it would work fine.
thanks for your help.
By Billy on Mar 18, 2008
is there a way to drag and drop into the apple tv? I want a lot of movies on the apple tv, but dont want them all on my computer…so instead of sync. i can just drag and drop and then it wont matter if I have deleted them on the computer
By max on Jul 22, 2008
Hello.
I have a question:
I donwloaded the automator actions for compressing and importing into iTunes and follow the steps that are mentioned in the procedure, the procedure starts perfect and the movie is converted, but when I see the output the file the resolution is not correct (I think is 320×480)
When I export the same movie direct from Quick Time the result file is converted perfect.
Can any help with this issue?
Thank you.
By Daniele Zanvettor on Jul 23, 2008