I am looking to implement a fully automated solution that will pick video files from an incoming directory, process them and put the result to iTunes special "Automatically Add to iTunes" directory.
Before starting to propose different products do read the requirements:
- Command line interface, so we can use it with a cron
- Do Pass Thru for video and audio streams if the source is already compatible with target format
- Download subtitles from an external service (optional)
- Embedding existing SRT files into the output video
- Fixing metadata from an external service (optional)
Initially I would say that Handbrake should be able to do this, but I discovered that handbrake will never do Pass Thru for video (that's a statement that I got from the author).
Best Answer
z264
z264 will look at every file, but will only touch avi, flv, mpg, mpeg, wmv, vob, mkv and mp4 video files, copying video and audio streams and rewrapping if possible, transcoding just the audio if necessary, and transcoding only what video is necessary, and leave you with iTunes friendly, atom optimized mp4 files, leaving the originals in your Trash. It makes reasonably intelligent decisions for you about how to transcode files based on how you set its HandBrake variables (set at lines 312-333).
copy and paste binary install section into a new bash script and use it to download and install the dependencies into /usr/local/bin/ (create /usr/local and /usr/local/bin/ if not there already)
create 2GB ramdisk called 'Two' using command in ramdisk section
double-check command definitions (locations of dependencies), and correct locations (to "/usr/local/bin/")
save as z264 in /usr/local/bin/
make executable
sudo chmod +x /usr/local/bin/z264
use Terminal to call z264 on single file, directory of files, or call it from a cron to crawl entire file systems periodically
minor issues: user needs to be able to read, debug, and use bash. z264 does not yet count how many background_transcoder processes it spawns, meaning if there are a lot of transcodes, it will take awhile for them to complete, but they will complete. You also need a lot of memory (8GB is ok). Snow Leopard users will need to install purge command from xcode developer tools.