+FILENAME=`basename ${INPUT%%.*}`
+OUTPUT="$OUTPUT_DIR/$FILENAME.mp4"
+
+echo "-> Converting $INPUT to $OUTPUT file"
+
+if [[ -e "$OUTPUT" ]]; then
+ echo "-E- Output file $OUTPUT already exists. Aborting..."
+ exit 1
+fi
+
+# 720p
+# HandBrakeCLI -d -b 3000 -q 0.8 -w 1280 -i /naspool/videos/HomeVideos/2011/2011-12-01.000.mkv -o 2011-12-01.mp4
+
+ffmpeg -i $INPUT \
+ -b:v 3000k \
+ -vcodec libx264 \
+ -acodec copy \
+ -coder 1 \
+ -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 \
+ -subq 5 \
+ -me_range 16 \
+ -g 250 \
+ -keyint_min 25 \
+ -sc_threshold 40 \
+ -i_qfactor 0.71 \
+ -threads 2 \
+ $OUTPUT