Files
wizwar6e/deploy/clips-publish.sh
T
Eric WagonerandClaude Fable 5.1 8488e9a8d1 Clips unfurl: share cards, faststart video, a share button
Each clip page already carried its own title, blurb, poster and
og:video — but the assets behind the tags let the unfurl down. The mp4s
were tail-indexed, so previewers in iMessage, Discord, Slack and
Facebook gave up before finding a player; the tags carried no video
dimensions, without which those same sites refuse to embed one; and the
poster was a 736x578 screenshot of the workshop chrome, cropped to
nothing by any share sheet.

deploy/clips-prep.mjs fixes the set before clips-publish.sh ships it:
a lossless faststart remux of every take, a 1200x630 card per clip cut
from the poster's first-person viewport with the title set over it (an
HTML card screenshot through the harness's chromium — ffmpeg here has
no drawtext), and the fpv frame size stamped into clips.json. The page
emits the card with its dimensions, og:video:width/height, and a Share
button that opens the phone's share sheet or copies the link.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jm2auWk6RP71CjaAb4FMoG
2026-09-02 11:26:27 -04:00

15 lines
823 B
Bash
Executable File

#!/usr/bin/env bash
# Publish showcase clips to the droplet's clip vault (/var/lib/wizwar/clips).
# Run deploy/clips-prep.mjs on the directory first: it remuxes the video
# for streaming, cuts the share cards, and stamps frame sizes into clips.json.
# The gallery at /clips serves whatever this ships: <slug>-fpv.mp4,
# <slug>-board.mp4, <slug>.jpg, <slug>-card.jpg per clip, described by clips.json.
set -euo pipefail
host=${1:?usage: clips-publish.sh <host> <clips-dir>}
dir=${2:?usage: clips-publish.sh <host> <clips-dir>}
test -f "$dir/clips.json" || { echo "no clips.json in $dir" >&2; exit 1; }
ssh "root@$host" 'mkdir -p /var/lib/wizwar/clips'
scp "$dir"/*.mp4 "$dir"/*.jpg "$dir/clips.json" "root@$host:/var/lib/wizwar/clips/"
count=$(ls "$dir"/*-fpv.mp4 | wc -l | tr -d ' ')
echo "published $count clips to $host"