]> code.delx.au - transcoding/commitdiff
Subtitle support in tomkv.sh
authorJames Bunton <jamesbunton@fastmail.fm>
Sun, 16 Mar 2008 13:57:49 +0000 (00:57 +1100)
committerJames Bunton <jamesbunton@fastmail.fm>
Sun, 16 Mar 2008 13:57:49 +0000 (00:57 +1100)
tomkv.sh

index db6ceed5de5c3a95b77d8fba097d04b857cd19c8..1697806a5e40af56de3e35440fba0b330a37958a 100755 (executable)
--- a/tomkv.sh
+++ b/tomkv.sh
@@ -2,14 +2,15 @@
 
 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!'