--- /dev/null
+#!/bin/bash
+
+INPUT=$1
+OUTPUT_DIR=$2
+
+if [ -z "$OUTPUT_DIR" ]; then
+ OUTPUT_DIR="."
+fi
+
+FILENAME=`basename ${INPUT%%.*}`
+OUTPUT="$OUTPUT_DIR/$FILENAME.avi"
+
+echo "-> Converting $INPUT to 480p downscaled $OUTPUT file"
+
+if [[ -e "$OUTPUT" ]]; then
+ echo "-E- Output file $OUTPUT already exists. Aborting..."
+ exit 1
+fi
+
+# scale=720:-2
+# profile=asp5
+
+mencoder \
+ -mc 0 \
+ -noskip \
+ -vf expand=:::::16/9,hqdn3d,harddup,scale=720:-2 \
+ -ovc xvid -oac mp3lame \
+ -xvidencopts fixed_quant=3.8:me_quality=6:noqpel:nogmc:trellis:chroma_me:chroma_opt:hq_ac:vhq=4:lumi_mask:max_key_interval=300:quant_type=mpeg:max_bframes=2:closed_gop:nopacked:autoaspect:bvhq=1:threads=4 \
+ -lameopts vbr=2:q=1:aq=2 \
+ -o $OUTPUT $INPUT
+
+echo "-> DONE!!!"
+
--- /dev/null
+#!/bin/bash
+
+# step 1: convert the mkv to mpg ; many mkv files do not directly get converted to mp4
+mencoder "$1" -ovc lavc -lavcopts vcodec=mpeg1video -aid 0 -oac pcm -o delete_me.mpg
+
+# step 2: convert the mpg file to mp4
+mencoder -of lavf -lavfopts format=mp4 -oac lavc -ovc lavc -lavcopts \
+aglobal=1:vglobal=1:acodec=libfaac:vcodec=mpeg4:abitrate=128:vbitrate=640:keyint=250:mbd=1:vqmax=10:lmax=10:turbo -af lavcresample=44100 \
+-vf harddup,scale=640:-3 "delete_me.mpg" -o "$1.mp4"
+
+# step 3: delete the temporary huge sized mpg file
+rm "delete_me.mpg"
--- /dev/null
+#!/bin/bash
+
+INPUT=$1
+START=$2
+STOP=$3
+
+if [[ -n $START ]]; then
+ START="-ss $START"
+fi
+
+if [[ -n $STOP ]]; then
+ STOP="-t $STOP"
+fi
+
+if [[ -z INPUT ]]; then
+ echo "usage: $0 <input> [<start> <stop>]"
+fi
+
+ffmpeg $START $STOP -i $INPUT -acodec libmp3lame -ab 128k $INPUT.mp3