Mike Klinke wrote:
On Monday 14 November 2005 17:46, Yuandan Zhang wrote:
This is the error i get
Was this your original *.avi file? As you note, both mencoder and
mplayer seem to dislike it. Is it on line somewhere? I'd be happy
to give it a go with a different version of mplayer. I'm using
mplayer-1.0pre8-0.1.20051019 here.
Regards, Mike Klinke
This works for me:
#!/bin/sh
DEFBITRATE=1150
#if the first argument is an integer, then it is BITRATE
x=$1
case $x in
*[!0-9]*)
#echo It is not an integer
;;
*)
#echo It is an integer
DEFBITRATE=$1
shift
;;
esac
for ARG in "$@"; do
# check BITRATE from source (VMW doesn't have this info)
BITRATE=$DEFBITRATE
aux=`mplayer -vo null -ao null -frames 0 -identify "$ARG" \
2>/dev/null | grep -e ^VIDEO`
if [ "`echo "$aux" | awk -F " " '{print $8}'`" = "kbps" ]; then
aux1=`echo "$aux" | awk -F " " '{print $7}' | awk -F "." '{print $1}'`
aux2=`echo "$aux" | awk -F " " '{print $7}' | awk -F "." '{print $2}'`
if [ $aux1 -eq 0 ]; then
aux1=$DEFBITRATE
else
BITRATE=$aux1
if [ $aux2 -ge 5 ]; then BITRATE=`expr $BITRATE + 1`; fi
fi
fi
nice -n 19 \
mencoder "$ARG" -of mpeg -o "${ARG}.mpg" \
-vf pp=de,harddup,softskip \
-ovc lavc -lavcopts vcodec=mpeg2video:vhq:vbitrate=$BITRATE:autoaspect \
-ofps 25.0 \
-oac mp3lame -lameopts br=128:q=9:aq=9:cbr:mode=1
done
Regards, Bob
--
Bob Marcan, Consultant mailto:bob.marcan@xxxxxx
S&T Hermes Plus d.d. tel: +386 (1) 5895-300
Slandrova ul. 2 fax: +386 (1) 5895-202
1231 Ljubljana - Crnuce, Slovenia url: http://www.snt.si