#!/bin/sh

if [ $# -lt 1 ] ; then
    echo "Usage: `basename $0` <mts video file>"
    exit 1
fi

mts=$1
if [ ! -e $mts ] ; then
    echo "File $mts is missing"
    exit 1
fi

mp4=`echo $mts | tr [A-Z] [a-z]`
mp4=`dirname $mts`/`basename $mp4 .mts`.mp4

avconv -i $mts -c:a copy -c:v copy -y $mp4
