Analysis half of the pipeline in docs/roto-puppet.md. Stabilises a face out of a clip via a similarity fit on rigid landmarks, reduces the lip contour to a fixed vertex budget, selects sparse keys on velocity minima, and previews the result as flat indexed fills so timing can be judged without an Animator Pro render. - landmarks.js ordered lip/oval rings; slot position is vertex identity - mathutil.js closed-form 2D similarity, Procrustes mean, transform smoothing - pipeline.js stabilise -> subsample -> key-select - raster.js indexed scanline fill, no antialiasing - take.js take-file writer - selftest.js 29 assertions, incl. ring simplicity at every vertex budget Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
17 lines
665 B
Bash
Executable file
17 lines
665 B
Bash
Executable file
#!/usr/bin/env bash
|
|
# Extract a clip to a PNG sequence for the take builder.
|
|
#
|
|
# Frames are pre-extracted rather than decoded in the page on purpose: browser
|
|
# video seeking by currentTime is approximate and requestVideoFrameCallback only
|
|
# delivers frames at playback speed, so neither gives a deterministic per-frame
|
|
# pass. A PNG sequence is exact, instantly seekable, and reproducible.
|
|
set -euo pipefail
|
|
|
|
src="${1:?usage: ./extract.sh CLIP [FPS] [OUTDIR]}"
|
|
fps="${2:-24}"
|
|
out="${3:-frames}"
|
|
|
|
rm -rf "$out"
|
|
mkdir -p "$out"
|
|
ffmpeg -hide_banner -loglevel warning -i "$src" -vf "fps=$fps" "$out/%04d.png"
|
|
echo "$(ls -1 "$out" | wc -l) frames at ${fps}fps -> $out/"
|