I put this in my nautilus scripts for converting mkv files into xvid, so they can play in XBMC for XBOX
#!/bin/bash
FILEIN=`zenity --file-selection --title="Select mkv file..."`
zenity --info --title="file selected for conversion" --text="OUTPUTFILE = $FILEIN.avi"
xterm -e mencoder $FILEIN -channels 6 -ovc xvid -xvidencopts fixed_quant=4 -vf harddup -oac mp3lame -lameopts cbr:br=160 -o $FILEIN.avi