Update ts-to-mkv.sh

This commit is contained in:
Cody Cook 2019-05-31 15:53:21 -07:00
commit 9c814327f9

View file

@ -60,7 +60,7 @@ version="2"
## Start ##
echo "[info] $0 -- v$version"
while getopts d:p:fnhkq OPT; do
while getopts d:p:fnXhkq OPT; do
case "$OPT" in
d)
if [[ -e "$OPTARG" ]]; then
@ -79,6 +79,7 @@ while getopts d:p:fnhkq OPT; do
echo "[help] -k, keep the original ts file"
echo "[help] -q, disable output from ffmpeg (default: info)"
echo "[help] -p, custom path to scan recursively (default: $WORKPATH)"
echo "[help] -X, dry run"
exit 0 ;;
k)
echo "[debug] keeping the original file"
@ -96,6 +97,9 @@ while getopts d:p:fnhkq OPT; do
q)
loglevel="quiet"
echo "[debug] disabling ffmpeg output" ;;
X)
dryrun="1"
echo "[debug] dry run enabled";;
esac
done
@ -108,7 +112,12 @@ if [[ "$filelist" ]]; then
echo "[info] working on $i"
INFILE="$i"
echo "[debug] Infile: $INFILE"
OUTFILE="${i//.ts/.mkv}"
if [[ "$dryrun" == "1" ]]; then
OUTFILE="/dev/null"
echo "[debug] overriding OUTFILE to $OUTFILE"
else
OUTFILE="${i//.ts/.mkv}"
fi
echo "[debug] Outfile: $OUTFILE"
sleep 2
INFILE2="${INFILE//\'/\'\\\\\\\'\'}"