From b89fbc61c89662537876300d386fb56e62af9fb5 Mon Sep 17 00:00:00 2001 From: Jan Koppe Date: Thu, 31 Oct 2024 07:26:28 +0100 Subject: [PATCH] dhcp24: renderscript v1 --- dhcp2024/render.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 dhcp2024/render.sh diff --git a/dhcp2024/render.sh b/dhcp2024/render.sh new file mode 100644 index 0000000..334175e --- /dev/null +++ b/dhcp2024/render.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -euxo pipefail + +INTRO="$1" +RECORDING="$2" +OUTRO="${3:-intros/outro_ccbysa.mkv}" + +START_SECONDS="$3" +STOP_SECONDS="$4" + +DURATION_SECONDS=$(($STOP_SECONDS - $START_SECONDS)) +FADEOUT_SECONDS=$(($DURATION_SECONDS - 1)) + +ffmpeg -i "$INTRO" \ + -ss $START_SECONDS -t $DURATION_SECONDS -i "$RECORDING" \ + -i "$OUTRO" -filter_complex \ + "[1:v:0]fade=t=in:st=0:d=0.2[x];[x]fade=t=out:st=$FADEOUT_SECONDS:d=1.0[y];\ + [1:a:0]afade=t=in:st=0:d=0.2[a];[a]afade=t=out:st=$FADEOUT_SECONDS:d=1.0[b];\ + [b]dynaudnorm[bd];\ + [0:v:0][0:a:0]\ + [y][bd]\ + [2:v:0][2:a:0]\ + concat=n=3:v=1:a=1\ + [v][a0]" \ + -map '[v]' -map '[a0]' \ + -c:a aac -b:a 192k \ + -c:v libx264 -threads 0 -pix_fmt yuv420p -crf 18 -profile:v high -level 4.1 -disposition default \ + -metadata:s:a:0 language=native \ + "rendered_recordings/$(basename -s .mp4 ${INTRO})_$(basename -s .mkv ${RECORDING})_COMBINED.mkv"