summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2013-02-02 14:11:03 +0100
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2013-02-02 14:12:27 +0100
commitaf10b5809f08f3310aacad7ce71ade02fe8a87c1 (patch)
treee99ee42f75c8d60c3072be8a8f1f609afdcf439a
parente7b35c435f44018351cb972904039665783be410 (diff)
downloadadvtime-af10b5809f08f3310aacad7ce71ade02fe8a87c1.tar.gz
advtime-af10b5809f08f3310aacad7ce71ade02fe8a87c1.tar.bz2
advtime-af10b5809f08f3310aacad7ce71ade02fe8a87c1.zip
Add script to concat by given intervals
-rwxr-xr-xsrc/cutint.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/cutint.sh b/src/cutint.sh
new file mode 100755
index 0000000..72ed482
--- /dev/null
+++ b/src/cutint.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+parts=( )
+
+if [ $# -lt 5 ]; then
+ printf "usage: %s input output [start duration [start duration ...]]\n" $0 2>&1
+ exit 1
+fi
+
+input=$1
+output=$2
+shift
+shift
+
+while [ "x$1" != "x" -a "x$2" != "x" ]
+do
+ tmp=`mktemp --tmpdir=. --suffix=.mpg`
+ start=$1
+ echo $tmp
+ ffmpeg -y -i "$input" -sameq -ss "$1" -t "$2" "$tmp"
+
+ parts=( $parts $tmp )
+
+ shift
+ shift
+done
+
+ffmpeg -y -i concat:$(printf "|%s" "${parts[@]}" | sed 's/^|//') -vcodec copy -acodec copy "$output"