Add slated_output.bash

This commit is contained in:
2025-09-01 00:16:50 +00:00
commit e6f4f9a0e7

52
slated_output.bash Normal file
View File

@@ -0,0 +1,52 @@
#!/bin/bash
# This will add:
# - a five-second slate to the beginning of the input movie
# - Three thumbnails taken from pre-selected times in the input movie will be on the slate
# - A lower-third text will be printed to the entire length of the outpu
# - Then entire output will be standardized to 1920x1080
# - Audio output is 48000 pcm_s24le
PROJECT_TITLE="\"PROJECT TITLE HERE\""
CLIENT="Client"
CONTACT="Jamie Hardt / SQUAD 51 / jamie@squad51.us / (310) 874-5620"
MESSAGE="LOWER THIRD"
INPUT_FILE="/path/to/input/file.mov"
THUMB1_TIME="00:02:56"
THUMB2_TIME="00:36:01"
THUMB3_TIME="01:11:56"
### DON'T EDIT BELOW THIS LINE ###
INPUT_BASENAME=$(basename "$INPUT_FILE")
ffmpeg -y \
-f lavfi -i "color=c=black:s=1920x1080:d=5" \
-ss $THUMB1_TIME -i "$INPUT_FILE" \
-ss $THUMB2_TIME -i "$INPUT_FILE" \
-ss $THUMB3_TIME -i "$INPUT_FILE" \
-i "$INPUT_FILE" \
-f lavfi -t 5 -i "anullsrc=r=48000:cl=stereo, aformat=sample_fmts=s32:channel_layouts=stereo" \
-filter_complex "
[1:v]trim=duration=0.04,setpts=PTS-STARTPTS,scale=560:-1,tpad=stop_mode=clone:stop_duration=5[thumb1];
[2:v]trim=duration=0.04,setpts=PTS-STARTPTS,scale=560:-1,tpad=stop_mode=clone:stop_duration=5[thumb2];
[3:v]trim=duration=0.04,setpts=PTS-STARTPTS,scale=560:-1,tpad=stop_mode=clone:stop_duration=5[thumb3];
[0:v][thumb1]overlay=100:100[tmp1];
[tmp1][thumb2]overlay=690:100[tmp2];
[tmp2][thumb3]overlay=1280:100[slate_raw];
[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];
[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:fontsize=42:x=(w-text_w)/2:y=h-100[outv]
" \
-map "[outv]" -map "[acat]" \
-c:v libx264 -pix_fmt yuv420p -c:a pcm_s24le -movflags +faststart -to 20 output.mov