Some mencoder scripts

This mencoder script converts WMV into Xvid AVI:

#!/bin/bash
echo -e "   wmv2avi - converts wmv into Xvid avi \n"
echo -e "wmv2avi [wmv] [bitrate] [lame preset] [output] \n"
WMV=${1}
BITRATE=${2-2000}
LAMEPRESET=${3-standard}
AVI=${4-WMV%%.wmv}.avi
echo -e "\n $WMV --> $AVI \n"
echo -e "video bitrate = $BITRATE"
echo -e "LAME preset = $LAMEPRESET \n"
mencoder \
-oac mp3lame -lameopts preset=$LAMEPRESET \
-ovc xvid -xvidencopts pass=1:turbo:quant_type=mpeg \
-ofps 30000/1001 \
$WMV -o /dev/null
mencoder \
-oac mp3lame -lameopts preset=$LAMEPRESET \
-ovc xvid -xvidencopts pass=2:bitrate=$BITRATE:quant_type=mpeg \
-ofps 30000/1001 \
$WMV -o $AVI
rm divx2pass.log

And this one repeats the process for every WMV file in the dir:

#!/bin/bash
echo -e "   allwmv2avi - converte todos os wmv em Xvid \n "
echo -e "   allwmv2avi [bitrate] [lame preset] \n "
for file in *.wmv
do
BITRATE=${1-2000}
LAMEPRESET=${2-standard}
file=${file%%.wmv}
echo -e "\n $file : video bitrate = $BITRATE , LAME preset = $LAMEPRESET \n"
mencoder \
-oac mp3lame -lameopts preset=$LAMEPRESET \
-ovc xvid -xvidencopts pass=1:turbo:quant_type=mpeg \
-ofps 30000/1001 \
$file.wmv -o /dev/null
mencoder \
-oac mp3lame -lameopts preset=$LAMEPRESET \
-ovc xvid -xvidencopts pass=2:bitrate=$BITRATE:quant_type=mpeg \
-ofps 30000/1001 \
$file.wmv -o $file.avi
rm divx2pass.log
done

Change bitrate, fps, LAME presets.

Also to consider are the options -mc 10 or -noskip.

quant=h263 is better for low bitrates (softer video)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s