From 8cc578725ff396ce6fc3790f1079a36c6c08468e Mon Sep 17 00:00:00 2001 From: mattmcw Date: Sun, 9 May 2021 13:24:38 -0400 Subject: [PATCH] Re-add video concatenate example --- .gitignore | 3 ++- ffmpeg/basic/concat.sh | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 ffmpeg/basic/concat.sh diff --git a/.gitignore b/.gitignore index 924e43f..388775d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ videos output frames node/node_modules -*.pth \ No newline at end of file +*.pth +videos.txt \ No newline at end of file diff --git a/ffmpeg/basic/concat.sh b/ffmpeg/basic/concat.sh new file mode 100644 index 0000000..0129386 --- /dev/null +++ b/ffmpeg/basic/concat.sh @@ -0,0 +1,34 @@ +#!/bin/bash -e + +##################################################### +# +# This script will concatenate two videos in order +# and output the new video as ProRes file. +# +# Usage: bash ffmpeg/basic/concat.sh +# +##################################################### + +INPUT_1=`realpath "${1}"` +INPUT_2=`realpath "${2}"` +OUTPUT="${3}" + +# Check if output file extension is .mov +if [[ "${OUTPUT}" != *".mov" ]]; then + echo "Please use an .mov extension on your output file argument" + exit 2 +fi + +echo "file '${INPUT_1}'" > videos.txt +echo "file '${INPUT_2}'" >> videos.txt + +ffmpeg -f concat \ + -safe 0 \ + -i videos.txt \ + -c:v prores_ks \ + -profile:v 3 \ + -c:a aac \ + "${OUTPUT}" + +# cleanup file list +rm -f videos.txt \ No newline at end of file