]> code.delx.au - transcoding/commitdiff
Improved tomkv.sh
authorJames Bunton <jamesbunton@fastmail.fm>
Tue, 18 Mar 2008 00:54:51 +0000 (11:54 +1100)
committerJames Bunton <jamesbunton@fastmail.fm>
Tue, 18 Mar 2008 00:54:51 +0000 (11:54 +1100)
tomkv.sh

index 1697806a5e40af56de3e35440fba0b330a37958a..7e55d15723e3c0454c403e018342995e73adca11 100755 (executable)
--- a/tomkv.sh
+++ b/tomkv.sh
@@ -1,16 +1,16 @@
 #!/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!'