#!/bin/sh
# mp4 is slightly smaller than flv and its way more reliable to cut

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

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

basenm=`basename $flv .flv`
if [ "$basenm" = "$flv" ] ; then
  basenm=`basename $flv .mpg`
  if [ "$basenm" = "$flv" ] ; then
     echo "$flv does not feature extention .flv"
     exit 1
  fi
fi

set -x
##  -metadata TITLE="Futter.  Streng verdaulich"
ffmpeg -i "$flv"  -c:v copy -y "$basenm".mp4
