docs(demo): decimate dead time; bake the pass into demo-record.sh
VHS records in real time, so the GIF spent ~30s of its 82s on static frames (bottle launch wait, command-output wait between probes). Run mpdecimate to drop duplicate consecutive frames and re-time at 12 fps; tpad clones the final frame for 4s so the gitleaks rejection holds long enough to read on each GIF loop. Result: 25.8s, 1.87 MB. scripts/demo-record.sh now does the decimation pass automatically after vhs, so re-records stay compressed without manual ffmpeg. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 1.8 MiB |
@@ -16,7 +16,30 @@ if [ -z "${CLAUDE_BOTTLE_OAUTH_TOKEN:-}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v ffmpeg >/dev/null 2>&1; then
|
||||
echo "demo-record: ffmpeg not found on PATH (brew install ffmpeg) — needed for decimation pass" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
bash scripts/demo-setup.sh
|
||||
trap 'bash scripts/demo-teardown.sh' EXIT
|
||||
|
||||
vhs docs/demo.tape
|
||||
|
||||
# VHS records in real time, which leaves long static stretches while
|
||||
# the bottle launches and commands wait for output. Run mpdecimate to
|
||||
# drop duplicate consecutive frames (TUI dead time) and re-time at
|
||||
# 12 fps. tpad clones the final frame for 4s so the gitleaks
|
||||
# rejection on the last beat dwells long enough to read on each GIF
|
||||
# loop. Re-encode through a 64-color palette to keep the file small.
|
||||
tmp=$(mktemp -d)
|
||||
trap 'bash scripts/demo-teardown.sh; rm -rf "$tmp"' EXIT
|
||||
cp docs/demo.gif "$tmp/raw.gif"
|
||||
ffmpeg -y -i "$tmp/raw.gif" \
|
||||
-vf "mpdecimate,setpts=N/12/TB,tpad=stop_duration=4:stop_mode=clone,scale=960:-1:flags=lanczos,palettegen=max_colors=64" \
|
||||
"$tmp/palette.png" -loglevel error
|
||||
ffmpeg -y -i "$tmp/raw.gif" -i "$tmp/palette.png" \
|
||||
-lavfi "mpdecimate,setpts=N/12/TB,tpad=stop_duration=4:stop_mode=clone,scale=960:-1:flags=lanczos[x];[x][1:v]paletteuse=dither=bayer:bayer_scale=5" \
|
||||
docs/demo.gif -loglevel error
|
||||
|
||||
echo "demo-record: wrote $(ls -lh docs/demo.gif | awk '{print $5}') ($(ffprobe -v error -show_entries stream=duration -of default=nk=1:nw=1 docs/demo.gif | cut -d. -f1)s)"
|
||||
|
||||
Reference in New Issue
Block a user