#!/bin/sh
#
# mkthumb_FFMpeg.sh:
# create a mov formattet movie preview
# - output size is 320x180, 
# - input aspect ratio is 4:3
# - framerate is 25                   
# - time is 30 seconds
#
# Syntax:
# mkthumb_FFMpeg.sh filename
#
# Requires ffmpeg video converter
# 
# Supported formats: 
#    see http://ffmpeg.org/
#    for full documetation. 
#    Example:
#        mov, flv, wmv, avi, mpg, m2v, vob
#
# Special thanks to Alex Pronin 
# --------------------------------------------------------- 
#
# use temp/pvconv_99999.png as outputfile to avoid 
# collisions when multiple converters run in parallel. 
rand=$RANDOM
out=/tmp/pvconv_${rand}.mov
/opt/local/bin/ffmpeg -i "$1" -t 00:00:30 -s 320x180 -aspect 4:3 -loglevel quiet -r 25 "$out" 2>/dev/null
echo "$out"   
exit 0

