I know I can use Handbrake to do this all by hand, but I'd like to automate the process. I'm on a Mac, so as a first step, I've tried downloading ffmpeg for the Mac but it's a nightmare to get it going. (This requires XPorts, XPorts requires the Xcode unix tools, those aren't available to install in the Mac App Store as best I can tell, etc...)
Ideally this would all be done on a remote server instead of on my Mac... my dream setup is a box in the cloud (like an Amazon EC2 instance?) that monitors a folder; when AVI files appear in that folder, it converts them to mp4 that's good for iTunes, then on my Mac I can just automate the last step: FTPing them down to the iTunes "automatic import" folder (so they eventually end up in my iTunes library and sync to the iPhone... phew, that's a lot of steps!!!). Is that out there?