#!/bin/sh
# flv2mkv.sh
# 2015-07-06
# by Gernot Walzl
FILENAME="$1"
if [ ! -r "$FILENAME" ]; then
exit 1
fi
EXT=$(echo "$FILENAME" | rev | cut -d . -f 1 | rev)
if [ "$EXT" != "flv" ]; then
exit 1
fi
BASE=$(echo "$FILENAME" | rev | cut -d . -f 2- | rev)
ffmpeg -i "$FILENAME" -vcodec copy -acodec copy "${BASE}.mkv"