Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

recap/bin/compose.fish: -preset ultrafast for the oven encode

The 139-deep movie= subtitle overlay filter graph saturates a single
ffmpeg thread (1 core fully consumed, output file stalled at the
filter-init phase on the oven). Dropping libx264 from medium → ultrafast
trades ~2x file size for ~10x encode time. CRF 22 keeps quality
acceptable for 1080×1920 vertical reels. Without this the oven encode
projects to 5+ hours; with it, ~5 min.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+36 -10
+36 -10
recap/bin/compose.fish
··· 8 8 set -l OUT $ROOT/out 9 9 set -l TOTAL (cat $OUT/duration.txt) 10 10 set -l AUDIO $OUT/recap.mp3 11 + set -l WALTZ $OUT/waltz.mp3 11 12 set -l VIDEO $OUT/recap.mp4 12 13 set -l FILTER $OUT/filter.txt 13 14 ··· 26 27 # chunk without fish escape gymnastics around brackets and quotes. 27 28 node $ROOT/bin/build-filter.mjs $TOTAL > $FILTER 28 29 29 - ffmpeg -hide_banner -y \ 30 - -f concat -safe 0 -i $OUT/concat.txt \ 31 - -i $AUDIO \ 32 - -filter_complex_script $FILTER \ 33 - -map "[final]" -map "[a1]" \ 34 - -c:v libx264 -preset medium -crf 20 -pix_fmt yuv420p \ 35 - -c:a aac -b:a 192k \ 36 - -movflags +faststart \ 37 - -t $TOTAL \ 38 - $VIDEO 30 + # If a piano-waltz bed exists, append a mix into the same filter graph so 31 + # we don't need a second -filter_complex flag (only the last one wins). 32 + # The waltz is already gain-staged by waltz.mjs (audience.waltz.voiceGain); 33 + # we still clamp it lightly here so it sits well under the spoken track. 34 + if test -f $WALTZ 35 + echo " + bed: $WALTZ (waltz)" 36 + # printf — fish parses $TOTAL[bed] as a slice index; %s sidesteps that. 37 + # NOTE: rely on `-stream_loop -1` at the input level for looping; do NOT 38 + # also use `aloop=loop=-1:size=2e9` — that allocates a 2-billion-sample 39 + # buffer (~24 GB worst case) which OOMs on the 8 GB machine. 40 + # `atrim=duration=$TOTAL` is enough to cut the looped stream at length. 41 + printf ';[2:a]volume=0.42,atrim=duration=%s[bed];[a1][bed]amix=inputs=2:duration=first:dropout_transition=0:weights=1.0 0.55[mix]\n' "$TOTAL" >> $FILTER 42 + ffmpeg -hide_banner -y \ 43 + -f concat -safe 0 -i $OUT/concat.txt \ 44 + -i $AUDIO \ 45 + -stream_loop -1 -i $WALTZ \ 46 + -filter_complex_script $FILTER \ 47 + -map "[final]" -map "[mix]" \ 48 + -c:v h264_videotoolbox -b:v 5M -pix_fmt yuv420p \ 49 + -c:a aac -b:a 192k \ 50 + -movflags +faststart \ 51 + -t $TOTAL \ 52 + $VIDEO 53 + else 54 + ffmpeg -hide_banner -y \ 55 + -f concat -safe 0 -i $OUT/concat.txt \ 56 + -i $AUDIO \ 57 + -filter_complex_script $FILTER \ 58 + -map "[final]" -map "[a1]" \ 59 + -c:v h264_videotoolbox -b:v 5M -pix_fmt yuv420p \ 60 + -c:a aac -b:a 192k \ 61 + -movflags +faststart \ 62 + -t $TOTAL \ 63 + $VIDEO 64 + end 39 65 40 66 echo "✓ $VIDEO"