Reply to comment

Good starting point

It does work for me, but I expanded it a little to have a bit more sophisticated script.
This allows for a -s (small) flag to avoid the upscaling of 160*120 movies (sometimes I set my camera to that mode -- what a shame), allows specifying multiple movies, and renames files ending with .AVI to .flv (it lacks some error checking, though).


#!/bin/sh

sflag=
while getopts s: name
do
case $name in
s) sflag=1;;
?) printf "Usage: %s: [-s] [avifile 2] ...\n" $0
exit 2;;
esac
done
if [ ! -z "$sflag" ]; then
printf "Small file option specified\n"
SCALE="scale=-2:120"
shift 1
else
SCALE="scale=-2:240"
fi

for i in $@
do
INFILE=$i
OUTFILE=`echo $INFILE| sed 's/\.[aA][vV][iI]$/.flv/'`
echo doing conversion: "$INFILE -> $OUTFILE"
mencoder -forceidx -of lavf -oac mp3lame \
-lameopts abr:br=56 -srate 22050 -ovc lavc \
-lavcopts vcodec=flv:vbitrate=250:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 \
-vf $SCALE -o $OUTFILE $INFILE 2>&1 | tee -a /tmp/`basename $0`.log | grep '[0-9]%)'
done

Reply

  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.