#! /bin/bash
# AVCHD to MP4 converter
-# ffmpeg cmdline taken from http://pvdm.xs4all.nl/wiki/index.php/Convert_an_AVCHD_/_MTS_file_to_MP4_using_ffmpeg
+# ffmpeg arguments taken from http://pvdm.xs4all.nl/wiki/index.php/Convert_an_AVCHD_/_MTS_file_to_MP4_using_ffmpeg
OPTIND=1
dest=""
verbose=0
+if (( $# < 2 ))
+ then
+ printf "\n\x1b[31mWrong number of arguments\x1b[0m\n\n"
+ printf "Usage: avchdtomp4 -s SOURCE -d DESTINATION [-v]\n where SOURCE is the source file, or a directory scanned for *.MTS files\n DESTINATION is the output directory relative to working directory\n [-v] enables verbose mode in ffmpeg"
+ exit 1
+fi
+
+
while getopts s:d:v option; do
case "$opt" in
s)