It requires you have ffmpeg installed on your mac (change the path to match wherever you installed ffmpeg):
NAME=`echo $1| rev | cut -d. -f2- |rev`
/opt/local/binary_downloads/ffmpeg -i $1 -vcodec copy -acodec copy $NAME.m4v
Example usage would be, "./convert-2-m4v.sh my-movie.mkv".
That would produce a file named my-movie.m4v .