Update slated_output.bash

This commit is contained in:
2025-09-01 00:47:57 +00:00
parent 8e552499b0
commit d50f48c782

View File

@@ -10,6 +10,8 @@
# The INPUT_FILE is expected as argument 1 on the command line, the idea being you might make a copy
# of this script for each project and customise the thumbnail positions, client and title, while the
# movie always changes
#
# The output file will be name INPUT_FILE_slated.
PROJECT_TITLE="\"PROJECT TITLE HERE\""
@@ -18,13 +20,24 @@ CONTACT="Jamie Hardt / SQUAD 51 / jamie@squad51.us / (310) 874-5620"
MESSAGE="Sound Review $(date +%m/%d)"
INPUT_FILE="$1"
THUMB1_TIME="00:02:56"
THUMB2_TIME="00:36:01"
THUMB3_TIME="01:11:56"
# Set this to "-to 20" while you're testing your script out, once it looks
# right then set it to ""
OUTPUT_LENGTH_ARG="-to 20"
# Set this to a positive number to move the lower-third and "file" field in
# the slate up/north, to avoid covering burnins
BOTTOM_Y_NUDGE="90"
### DON'T EDIT BELOW THIS LINE ###
INPUT_BASENAME=$(basename "$INPUT_FILE")
INPUT_BASENAME=$(basename -- "$INPUT_FILE")
OUTPUT_FILE=$(dirname -- "$INPUT_FILE")/"${INPUT_BASENAME%.*}_slated.mov"
ffmpeg -y \
-f lavfi -i "color=c=black:s=1920x1080:d=5" \
@@ -45,13 +58,13 @@ ffmpeg -y \
[slate_raw]drawtext=text='$PROJECT_TITLE':fontcolor=white:fontsize=72:x=(w-text_w)/2:y=(h/2-100)[s1];
[s1]drawtext=text='Client\: $CLIENT':fontcolor=white:fontsize=48:x=(w-text_w)/2:y=(h/2)[s2];
[s2]drawtext=text='$CONTACT':fontcolor=white:fontsize=24:x=(w-text_w)/2:y=(h/2+100)[s3];
[s3]drawtext=text='File\: $INPUT_BASENAME':expansion=normal:fontcolor=gray:fontsize=28:x=(w-text_w)/2:y=(h-140)[slate];
[s3]drawtext=text='File\: $INPUT_BASENAME':expansion=normal:fontcolor=gray:fontsize=28:x=(w-text_w)/2:y=(h-(140+$BOTTOM_Y_NUDGE))[slate];
[4:v]scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2:black[v1];
[4:a]aresample=48000,aformat=sample_fmts=s32:channel_layouts=stereo[a1];
[slate][5:a][v1][a1]concat=n=2:v=1:a=1[vcat][acat];
[vcat]drawtext=text='$MESSAGE':fontcolor=white:box=1:boxcolor=black:boxborderw=10:fontsize=42:x=(w-text_w)/2:y=h-100[outv]
[vcat]drawtext=text='$MESSAGE':fontcolor=white:box=1:boxcolor=black:boxborderw=10:fontsize=42:x=(w-text_w)/2:y=h-(100+$BOTTOM_Y_NUDGE)[outv]
" \
-map "[outv]" -map "[acat]" \
-c:v libx264 -pix_fmt yuv420p -c:a pcm_s24le -movflags +faststart -to 20 output.mov
-c:v libx264 -pix_fmt yuv420p -c:a pcm_s24le -movflags +faststart $OUTPUT_LENGTH_ARG "$OUTPUT_FILE"