Pass output as a parameter; default is output.avi. Allow to pass many
input files like *.vob.
#! /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
#! /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
#! /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
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