1仕組みと動作原理
実際の選定インターフェースは35行のアイデンティティカタログ(10のクラシックDNA + 25のテーマ)であり、エンジンとオーサリングファイルはテーブル参照から導出されます。SKILL.mdはバックエンドエンジン名をユーザーへの質問として提示することを明示的に禁止しています。
**Never surface "Standard vs Cinematic vs Theme" as a question** — those are backend names (a product has one UX even with several engines). The catalog encodes everything routing needs: reading surface, voice, recommend-for, scene needs, adjacency notes for the genuinely-close pairs (loud↔ordnance, neon↔neonsign, cream↔stardust).
字幕は3つのステートとしてモデル化されます:drop(つなぎ言葉、非表示)/ rail(画面下部1/3に表示される逐語的字幕、手前側で大半のテキストを担う)/ embed(昇格された強調ワード、被写体の背面に合成されマット処理による遮蔽が発生)。embedは希少な要素として定義されます。
| **rail** | the default — ordinary spoken content (verbatim) | clean lower-third subtitle, **in front**, readable. A punch word can get an inline `emphasis` highlight (accent colour / active-word pop) — it stays on the rail. | | **embed** | a promoted peak — the headline beat | one big word composited **behind the subject** (matte occlusion), designed entrance + exit |
前処理は1本の並列コマンドで実行されます:マット処理 ∥ 文字起こし ∥ 音声エンベロープ の3系統を同時に走らせ、その後に直列で safe-zones を計算します。「手作業の3ステップによる漏れ」を単一の呼び出しに集約しています。
# matte.cjs (CPU-heavy ONNX) ∥ transcribe.cjs (whisper) → then safe-zones.cjs # (matte and transcribe are independent; safe-zones needs the matte's frames_fg.) # Replaces hand-running steps 2 / 3 / 3b — one call, nothing forgotten, ~the cost # of the slower of the two instead of their sum.
文字起こしはローカルの WhisperX(uvx経由、バージョン固定)を使用し、wav2vec2 による強制アライメントで単語レベルのタイムスタンプを取得します。これは後段のゲートが80msの厳格なアライメントを要求するためです。失敗した場合は本リポジトリの whisper.cpp にフォールバックします。
// Pin whisperx so `uvx` fetches a reproducible build instead of resolving // "latest" on every run (a supply-chain + determinism foot-gun). Override // with $WHISPERX_VERSION if you've validated a different release. const whisperxSpec = `whisperx==${process.env.WHISPERX_VERSION || "3.8.6"}`;
マット処理はモデルの重みを内包せず、本リポジトリCLIの remove-background(u2net_human_seg)をシェル経由で実行します。初回実行時に約168MBがユーザーのキャッシュディレクトリにダウンロードされます。VFR(可変フレームレート)のソースはマット処理前にCFR(固定フレームレート)へ正規化されます。
const r = cp.spawnSync("node", [hfCli(), "remove-background", matteSrc, "-o", mov], { stdio: ["ignore", "pipe", "pipe"], encoding: "utf8", });
合成フェーズでは ffmpeg を使いマットを遮蔽レイヤーとして扱います。embed は「背景+字幕を先にレンダリングし、人物アルファでオーバーレイ」、rail は「透明WebMとしてレンダリングし、最前面にオーバーレイ」します。フレームアライメント維持のため、フレームレートは matte.fps を唯一の基準とします。
# FPS: matte.fps (written by matte.cjs at the source's NATIVE rate) is authoritative # so the matte overlay stays frame-aligned with the render. Falls back to plan.fps / # frame-count inference / 24. Warn if plan.json fps disagrees with the matte.
幾何学的ゲートは、ヘッドレス Chromium の DOM 矩形 × マットアルファ によるピクセル単位の判定(遮蔽、枠外はみ出し、rail/climax の衝突)を行い、--strict オプションで80msの時間アライメントを検証します。約2秒/フレームのプレビューフレームを先に出力し、高コストな本レンダリング前にレイアウト破綻を発見させます。
`node scripts/preview-frames.cjs <project> [t…]` composites **faithful preview frames in ~2s each** (caption layers screenshotted at seek-time + real video frame + matte occlusion + rail overlay = what the final composite will look like at that moment).
2コア機能
3外部依存関係
| Kind | Dependency / Endpoint |
|---|---|
| cli | ffmpeg / ffprobe(系统) |
| cli | hyperframes CLI(init / remove-background / render / lint / check / snapshot / preview) |
| cli | uvx(Python 运行器,按需拉取 whisperx==3.8.6) |
| network | 抠像权重下载(u2net_human_seg.onnx,约 168MB,仅首次) |
| network | GSAP CDN(仅示例渲染与引擎模板 HTML 里引用) |
| package | sharp(图像/alpha 数学)与 puppeteer(版面度量、截图) |
| package | python3(Theme 的 drawon setpiece 在编译期调用 gen-stroke-path.py) |
| cli | hyperframes skills update(自刷新,需网络) |
4推奨統制措置と判定根拠
- scripts/: ローカルスクリプトまたはコマンドの実行: bash scripts/prepare.sh <project>(node matte.cjs / transcribe.cjs / aud を並列起動)
- 网络端点: 外部ネットワークアクセスの宣言: uvx が必要に応じて PyPI から whisperx==3.8.6 およびその依存関係を取得(「latest」指定による再現性低下を防ぐためバージョン固定)
- 本地工作目录: ファイルの読み書きと成果物の出力: <project>/frames_fg/、frames_bg/、matte.fps、audio.mp3、_wx_audio.wav、_wx_out/(
5二重目の独立検証
- [ok] 是否隐藏凭证读取(与同批 HeyGen 系 skill 的差异) — 对整目录 grep `\.heygen|HEYGEN|api[_-]?key|TOKEN|SECRET|keychain|Bearer|Authorization` → 0 命中;process.env 命中 12 处全部是 HYPERFRAMES_ROOT / WHISPER_MODEL / WHISPER_LANG / TRANSCRIBE_ENGINE / WHISPERX_VERSION 等行为开关。『全本地、无凭证』成立。
- [ok] 网络外发是否全部可预期 — 逐条回查:uvx 拉 whisperx(版本钉死 3.8.6,注释明说是为防供应链与不可复现);模型下载由 hyperframes CLI 自管且路径固定在 ~/.cache/hyperframes/;CDN 引用仅在 engine.html / example-renders / _archive 模板内;无其它域名。未发现隐藏上报或遥测。
- [ok] 实现原理与功能声明是否相符 — 'runs locally end to end, including transcription and subject matting' 成立(本地 WhisperX + 本地 ONNX 抠像);'without editing the footage' 成立(Standard/Cinematic 只叠加,脚本注释与 SKILL.md 均强调不调色/不覆盖);唯一被允许改原片的是 Theme 的 PLATE 反应预算,SKILL.md 已显式标注为例外。
- [discrepancy] SKILL.md 的三引擎描述与脚本实际状态不一致(文档漂移) — SKILL.md 开篇仍把 Standard 描述为默认模式('**Standard** (default) builds a clean verbatim **rail** … + an **embed** climax'),并在多处按 rail.html + index.html 描述两轨产出;但同 commit 的 scripts/render-and-composite.sh 第 35-37 行写着 'Standard mode retired 2026-06-12 — rail-surface needs are served by theme DNAs like "anchor"',dna/README.md 第 15-16 行同样写 'Standard/rail mode was retired 2026-06-12',make-composition.cjs 第 253-257 行则在检测到 standard 派生的 plan.json 时直接报错退出。然而 scripts/ 下仍保留完整的 STANDARD 合成分支(第 392 行起 'STANDARD mode (rail + embed) — detected by rail.html')、modes/standard/ 目录与 44 个字体仍在包内。结论:**rail + peak embed 的实现仍在,但文档层(SKILL.md)已落后于引擎层(dna/README、render 脚本注释)**,两处关于『默认模式』的说法互相矛盾。这是对 pin commit 有效的真实出入,非第一遍误读。
- [ok] 『35 身份』等数量声明的准确性 — 实测 CATALOG.md 身份行 = 35;dna/*.json = 10(chrome/cream/documentary/editorial/glitch/ink/keynote/loud/neon/velocity);themes/*.json = 25;references/*.md = 14。与 SKILL.md 自述一致。
- [ok] 门禁是否真的会执行(而非只写在文档里) — render-and-composite.sh 内确实依次调用 check-timing(plan+transcript 存在时)、measure-layout + check-occlusion(plan + frames_fg 存在时)、check-overflow(无 plan 的 custom 模式告警)、check-rail-climax(rail.html 存在时,支持 RAIL_CLIMAX_SKIP=1 覆盖),并把结果汇总进 _gates.txt;与 SKILL.md 的门禁描述对应。
6結論
9cdab9186d817c12…