]> git.phdru.name Git - audio-cdr-video.git/commitdiff
Pass output as a parameter; allow to pass many input files
authorOleg Broytman <phd@phdru.name>
Tue, 4 Nov 2014 23:00:40 +0000 (02:00 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 4 Nov 2014 23:00:40 +0000 (02:00 +0300)
Pass output as a parameter; default is output.avi. Allow to pass many
input files like *.vob.

video/ff_catvideo
video/ff_cropdetect
video/ff_encode

index 852a349f664d6499680481118cd4a14d2f765e1c..34aafd2f7617457e2271be9ca6e98d333469198e 100755 (executable)
@@ -1,12 +1,13 @@
 #! /bin/sh
 
-if [ -z "$2" ]; then
-   echo "Usage: $0 output.avi input1.avi [input2.avi...]"
+if [ -z "$1" ]; then
+   echo "Usage: [output=output.avi] $0 input1 [input2...]"
    exit 1
 fi
 
-output="$1"
-shift
+if [ -z "$output" ]; then
+   output=output.avi
+fi
 
 i=1
 for input in "$@"; do
index 59a2c40ad882a133a4f16de7de1300548e5244f8..97032980cf2bdca5753343b12610820ca3c2c3d4 100755 (executable)
@@ -1,8 +1,14 @@
 #! /bin/sh
 
 if [ -z "$1" ]; then
-   echo "Usage: $0 input.avi"
+   echo "Usage: $0 input1 [input2...]"
    exit 1
 fi
 
-exec ffmpeg -i "$1" -vf cropdetect -an -f rawvideo -y /dev/null
+if [ $# -eq 1 ]; then
+   input="$1"
+else
+   input=concat:"`echo \"$@\" | sed 's/ /|/g'`"
+fi
+
+exec ffmpeg -i "$input" -vf cropdetect -an -f rawvideo -y /dev/null
index befff9db4fac7554034ae54982a5eca0d3765984..c265ecde07a98f07c4ddbc6b2cd937ea588200ac 100755 (executable)
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 if [ -z "$1" ]; then
-   echo "Usage: [vcodec=s] [vbitrate=n] [vscale=s] [acodec=s] [abitrate=n] [ascale=s] [pass=n] [input_opts=input_opts] [output_opts=output_opts] $0 input [output]"
+   echo "Usage: [vcodec=s] [vbitrate=n] [vscale=s] [acodec=s] [abitrate=n] [ascale=s] [pass=n] [input_opts=input_opts] [output_opts=output_opts] [output=output.avi] $0 input1 [input2...]"
    exit 1
 fi
 
@@ -29,13 +29,13 @@ if [ -z "$pass" ]; then
    pass=1
 fi
 
-input="$1"
-shift
-
-if [ -n "$1" ]; then
-   output="$1"
-   shift
+if [ $# -eq 1 ]; then
+   input="$1"
 else
+   input=concat:"`echo \"$@\" | sed 's/ /|/g'`"
+fi
+
+if [ -z "$output" ]; then
    output=output.avi
 fi