#!/bin/sh
# File from video recorder to mp3

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

set -x
mp3=`echo "$mts" | tr [A-Z] [a-z]`
mp3=`echo "$mp3" | sed 's/\.[^.]\+$/.mp3/'`

##  -metadata TITLE="Futter.  Streng verdaulich"
ffmpeg -i "$mts" -acodec libmp3lame "$mp3"
