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