How to remove an audio track from an avi file

If you want to remove an unwanted audio track from a dual audio avi movie file, you can use the following command with Mencoder:

mencoder original_dual_audio_file.avi -o target_file.avi -oac copy -ovc copy -aid 2

or with Ffmpeg:

ffmpeg -i original_dual_audio_file.avi -vcodec copy -map 0:0 -acodec copy -map 0:2 target_file.avi

These will create a file named target_file.avi retaining only the second audio track (aid 2).

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)