diff --git a/docs/demo.gif b/docs/demo.gif index d270f68..89087ad 100644 Binary files a/docs/demo.gif and b/docs/demo.gif differ diff --git a/scripts/demo-record.sh b/scripts/demo-record.sh index e725a0a..68b8708 100755 --- a/scripts/demo-record.sh +++ b/scripts/demo-record.sh @@ -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)"