#!/bin/sh# credit to Joe_Linux on iAudiophile.net for the original script that I edited.# cd to folder that contains all (and only) the files needing conversion.echo "Bash batch video convertor script using Mencoder by Goop and Joe_Linux."echo "Where are the files that need converting? (for example /home/foo/bar)"read -e IDIRECTORYcd $IDIRECTORYecho "Where is the output folder? (for example /home/foo/bar/output)"echo "*** Don't include a / at the end of it (so instead of /home/ do /home ) ***"read -e ODIRECTORY# for i in $(ls); dofor i in *; doecho $iecho "What filename-extension do the files you want to convert have?"read -e FILESo=$ODIRECTORY/${i%.$FILES}-S9.aviecho "protip: don't bother with bitrates above the original file's bitrate."echo "What audio bitrate?"read -e ABITRATEecho "What video bitrate?"read -e VBITRATEecho "How many frames per second?"read -e FPSmencoder "$i" -oac mp3lame -lameopts cbr:mode=2:br=$ABITRATE -af resample=44100 -srate 44100 -ofps $FPS -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:cbp:trell:vbitrate=$VBITRATE -vf scale=480:272 -ffourcc XVID -o "$o"echo "Done."exit