From 18c16103f655eb3e4d0d5b77f46a26b89baab3d7 Mon Sep 17 00:00:00 2001 From: pvincent Date: Fri, 20 Sep 2019 12:02:40 +0400 Subject: [PATCH] video_concat --- tools/video_concat | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 tools/video_concat diff --git a/tools/video_concat b/tools/video_concat new file mode 100755 index 0000000..5cac282 --- /dev/null +++ b/tools/video_concat @@ -0,0 +1,16 @@ +#!/bin/bash + +# should be run through output pipe, exit otherwise +[ -t 1 ] && echo "ERROR: should declare output as a pipe, ie > output.mp4" && exit -1 + +# detect current dir +DIR=$(pwd) + +# build temporary file which contains all the files to append +tempfile=$(mktemp) +for i in $@; do + echo file $DIR/$i >> $tempfile +done + +# output as matroska file +ffmpeg -safe 0 -f concat -i $tempfile -c copy -f matroska -