commit 21683d03a9e2242787f96a3a505b4490812a56a6 parent 11c40e9a99e4e83ec9bb35fa8c403698f7de2a46 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Mon, 23 Mar 2020 16:04:22 +0100 Add script to combine videos with ffmpeg Diffstat:
A | .local/bin/ffmpeg-combine | | | 20 | ++++++++++++++++++++ |
1 file changed, 20 insertions(+), 0 deletions(-)
diff --git a/.local/bin/ffmpeg-combine b/.local/bin/ffmpeg-combine @@ -0,0 +1,20 @@ +#!/bin/sh +filelist="/tmp/combine.txt" +out="combined.mp4" + +if [ $# -lt 2 ]; then + echo "usage: $0 FILE1 FILE2 ..." >&2 + exit 1 +fi + +for f in "$@"; do + printf 'file \'%s\'\n' "$f" +done > "$filelist" + +if [ $? -ne 0 ]; then + echo "error building filelist" >&2 + exit 1 +fi + +ffmpeg -f concat -safe -i "$filelist" -copy "$out" +printf '%s\n' "$out"