#!/bin/bash XRES=320 YRES=240 BITRATE=200 mplayer "$1" -ao pcm:fast:file=tmp.wav -vc null -vo null oggenc -q1 tmp.wav mencoder "$1" -nosound -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=$BITRATE -vf scale=$XRES:$YRES -sws 1 -ffourcc DIVX -o tmp.avi mkvmerge -o "$2" tmp.avi tmp.ogg