diff options
author | Ole Kristian Lien <ole.k.lien@gmail.com> | 2009-11-30 09:38:39 +0000 |
---|---|---|
committer | Ole Kristian Lien <ole.k.lien@gmail.com> | 2009-11-30 09:38:39 +0000 |
commit | 4326a42534d68f2dc62ce4d2a19c5df1dd902758 (patch) | |
tree | d4ab2851d51ab294a7f79a7458d260630a04ba1d | |
parent | f456dc4ca0c9d6aaca6b15d313b8f044e29e491b (diff) |
Now accepts multi. files
-rw-r--r-- | tools/join_video | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/tools/join_video b/tools/join_video index ceb4d7f..6053948 100644 --- a/tools/join_video +++ b/tools/join_video @@ -4,16 +4,25 @@ # Author: Ole Kristian Lien # License: GNU General Public License # -# Joins together two video-files +# Joins together two or more video-files if [ -z "$3" ]; then - echo "Usage: $0 <video-file> <video-file> <new-file>" + echo "Usage: $0 <new-file> <video-file> <video-file> [<video-file>]" exit 1 fi +array=() + +for arg in $*; do + array[${#array[*]}]=$arg +done + +# remove first entry +unset array[0] + # todo: Concatenating works with MPEG-1, MPEG-2 PS and DV if [ ! -f "$basename.dv" ] ; then - cat $1 $2 > $3 + cat ${array[*]} > $1 else - mencoder -oac copy -ovc copy -idx -o $3 $1 $2 + mencoder -oac copy -ovc copy -idx -o ${array[*]} fi |