]> git.phdru.name Git - audio-cdr-video.git/commitdiff
Fix ff_catvideo
authorOleg Broytman <phd@phdru.name>
Mon, 3 Nov 2014 02:49:54 +0000 (05:49 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 3 Nov 2014 02:49:54 +0000 (05:49 +0300)
Concatenate video files using intermediate MPEG files.
Takes a lot of time and disk space but quite reliable.

readme.txt
video/ff_catvideo

index f4746a1d4ad2989e61242b7843f1d69c89f320ec..8c9a39d474e3d79963f2c21e8161febf1e1d394d 100644 (file)
@@ -101,8 +101,8 @@ video
 -----
 
 Using ffmpeg:
-ff_encode - 1 and 2-pass encoding using different codecs.
 ff_catvideo - concatenate few video files into one.
+ff_encode - 1 and 2-pass encoding using different codecs.
 
 Using mplayer/mencoder:
 m_catvideo - concatenate few video files into one.
index 7abfbc39b8e7dc50861544f3264e67da0118c425..852a349f664d6499680481118cd4a14d2f765e1c 100755 (executable)
@@ -1,8 +1,20 @@
 #! /bin/sh
 
-if [ -z "$1" ]; then
-   echo "Usage: $0 input.avi output.avi"
+if [ -z "$2" ]; then
+   echo "Usage: $0 output.avi input1.avi [input2.avi...]"
    exit 1
 fi
 
-exec ffmpeg -i "$1" -c copy "$2"
+output="$1"
+shift
+
+i=1
+for input in "$@"; do
+   iii="`printf \"%03d\" $i`"
+   ffmpeg -i "$input" -qscale:v 1 _tmp_$iii.mpg
+   i="`expr $i + 1`"
+done &&
+
+cat _tmp_*.mpg >_tmp_all.mpg &&
+ffmpeg -i _tmp_all.mpg -qscale:v 2 "$output" &&
+exec rm _tmp_*.mpg