#!/bin/bash
input="$1"
-output="$2"
-subtitle="$3"
-if [ -z "$input" -o -z "$output" ]; then
- echo "Usage: $0 infile outfile [subtitle]"
+other="$2"
+output="$(basename "$input" .avi).mkv"
+if [ -z "$input" ]; then
+ echo "Usage: $0 infile [other]"
exit 1
fi
mplayer "$input" -dumpvideo -dumpfile tmp.video &&
mplayer "$input" -dumpaudio -dumpfile tmp.audio &&
-mkvmerge -o "$output" tmp.video tmp.audio "$subtitle" &&
+mkvmerge -o "$output" tmp.video tmp.audio $other &&
rm -f tmp.video tmp.audio &&
echo 'Done!'