October 7, 2007

Batch process Quicktime movies adding Fast-start header

Over Final Cut Pro-L, Mel Matsuoka answered his own question and dropped a useful script for QTCoffee, a set of command-line Mac OS X utilities for manipulating QuickTime readable media:

"...is there an easy way to batch process over 200+ H264 Quicktime movies which don't have the Fast-start header in place?

Answering my own question...I figured out a way to do it using the always kick-ass QTCoffee, and a horrifically ugly Bash shell-script I wrote. Here it is, for anyone to use as they please, and for real coders like Andreas, Bouke and Darrin to laugh...

# qt_add_faststart. sh
# description: uses QTCoffee (http://www.3am. pair.com/ QTCoffee. html)
'modmovie' command
# to add fast-start headers to all .mov files in the current working directory

# replace spaces in filenames with underscores

for filename in *.mov; do
filename_clean= $(echo $filename | tr ' ' _) # translate spaces
to "_", assign fixed filename to $filename_clean
[ ! -f $filename_clean ] && mv "$filename" $filename_clean # if
$filename_clean does not currently exist, then rename original
filename to $filename_clean

# create outfile name for QTcoffee 'modmovie' command
(originalfilename_ faststart. mov)

for filename in *.mov; do
faststart_fname= $(echo "$filename" | sed -e 's/\.mov/\_faststar t.mov/
g' )
echo "Adding fast-start header to $filename... "
modmovie -o $faststart_fname -self-contained $filename
echo "Backing up original .mov to $filename.original. .."
mv $filename "$filename". original
mv $faststart_fname $filename
echo "Done. Now get a life."

The original post and thread is over at the Final Cut Pro-List, in case there are format errors here. You could also check out QT_TOOLS by Dave van Brink.


Mike Matzdorff said...

hey rich, i happen to be looking for a tool to do exactly what this post talks about... adding the quickstart flag. has this been refined at all since 2007!?

THanks for any info you may share.


Rich said...

Sorry Mike, I don't know. I don't used QT for web delivery anymore, and anyway it's dying as-it-is as Apple switches to iOS-related tech and h.264.

You might try FCP-L, the AE-List, the Cow.