This is a small rewrite of a script found on an other blog (tell me if you are the author of this script)
#!/bin/bash
# encodage au format .avi des video .mov
# encode .avi files to .mov files
# rewrote by Yoda-BZH tristan AT kerguz DOT fr
if [ $# -lt 1 ]
then
echo "Usage: mov2avi file.mov"
echo " mov2avi *.mov"
echo " mov2avi file1.mov file2.mov ..."
echo " The file will be converted to file.avi"
exit 0
fi
for i in $*
do
echo "============ $i ================="
if [ ! -e $i ]
then
echo "WARNING : The file $i doesn't exists"
exit 0
fi
out=${i/.mov/.avi}
if [ -e $out ]
then
echo "WARNING : You are going to overwrite $out !!!"
exit 0
fi
mencoder $i -ovc lavc -lavcopts vcodec=mpeg4:vpass=1 -oac mp3lame -lameopts br=128:cbr:vol=0:mode=0 -o $out
mencoder $i -ovc lavc -lavcopts vcodec=mpeg4:vpass=2 -oac mp3lame -lameopts br=128:cbr:vol=0:mode=0 -o $out
done
rm divx2pass.log
exit 0