Something went wrong. Try again.
Something went wrong. Try again.
12345678910111213141516171819202122232425#!/bin/bash# Generate the branded interstitial card played between films (encoded/ params# must match encode.sh exactly, since the loop concats with -c copy).# Uses assets/card.png if present, else renders a simple text card.set -eucd "$(dirname "$0")/.."mkdir -p encoded
DUR=6if [[ -f assets/card.png ]]; then VIN=(-loop 1 -i assets/card.png) VF="scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2,setsar=1,fps=30"else VIN=(-f lavfi -i "color=c=0x14100e:s=1280x720:r=30") VF="drawtext=text='laugh.town':fontcolor=0xF5E9D7:fontsize=96:x=(w-text_w)/2:y=(h-text_h)/2-40:font='Georgia',drawtext=text='public domain comedy, around the clock':fontcolor=0xC9B8A0:fontsize=34:x=(w-text_w)/2:y=(h-text_h)/2+80:font='Georgia',setsar=1"fi
ffmpeg -hide_banner -loglevel error -y "${VIN[@]}" \ -f lavfi -i "anullsrc=r=48000:cl=stereo" \ -t "$DUR" -vf "$VF" \ -c:v h264_videotoolbox -b:v 2500k -maxrate 3000k -bufsize 6000k -profile:v high -g 60 \ -c:a aac -ar 48000 -ac 2 -b:a 128k -movflags +faststart \ _card.mp4echo "card written to _card.mp4 (kept out of encoded/ so it is inserted, not shuffled)"