#!/bin/bash
# Convert a Movie file to MP4
#
# Copyright 2009 Ben Tasker
#
# Released under the GNU GPL V2
# See http://benscomputer.no-ip.org/LICENSE2





# Call this script using the file to convert as an argument
#


for arg;do
file=$(echo "$arg" | sed 's/\.\w*$/''/')
mencoder "$arg" -oac lavc -ovc lavc -ffourcc DX50 -o "${file}.avi"
ffmpeg -vcodec libxvid -b 300 -qmin 3 -qmax 5 -g 300 -bufsize 4096 -i "${file}.avi" -s 320x240 -aspect 4:3 -acodec libfaac -ab 128 -ar 48000 -ac 2 -benchmark "${file}.mp4"
rm "${file}.avi"
done
