1仕組みと動作原理
「単語レベルのタイムスタンプ」を妥協不可のルールとして定め、最も一般的な手抜き手法(文の長さから単語の表示時間を均等割りすること)を明確に禁止する。
1. **Word-level timing, not line-level.** Karaoke reads as magic only when each word lands on the syllable. Always transcribe to word timestamps; never fake them by splitting a line evenly over its duration — drift is instantly visible.
パイプラインを6段階の表(文字起こし→正規化→ページ分割→アニメーション→配置→エクスポート)に固定し、各段階で具体的なツールを指定してエージェントの自由な即興実装を防ぐ。
| Transcribe | Audio → word-level timestamps | Whisper (`@remotion/install-whisper-cpp`), AssemblyAI |
全工程を通じてデータ構造を `{text, startMs, endMs}` の1つに統一し、あらゆるソース(Whisper / SRT / クラウドAPI)をこの形式に正規化する。
type Token = { text: string; startMs: number; endMs: number };
各単語のポップアニメーションを自身のstartMsに固定し、Remotion springのオーバーシュートを用いて生き生きとした動きを演出する。
const enter = (token.startMs / 1000) * fps; // word's own entrance frame
ページ分割ルール:1ページあたり1〜4単語とし、combineTokensWithinMillisecondsを用いて2段階のリズム感を切り替える。
and tune `combineTokensWithinMilliseconds`: ~200–500ms for true word-by-word, ~1000–1500ms for short readable phrases.
可読性とセーフエリアを形容詞ではなく具体的な数値表(フォントサイズ56〜80px、ストローク、中央配置帯62〜70%、下部約280pxの回避)として規定する。
| Size | 56–80px (≈8% of frame height), min 45px | Legible muted on a phone |
納品規律:ソーシャルプラットフォーム向けに字幕を焼き込むと同時に、アクセシビリティ要件を満たすため同一のtokenからSRT/VTTをエクスポートする。
Emit both: burn the animated captions for social, and write a plain SRT/VTT from the same tokens for accessible/SEO playback.
検証ループ(deliver-and-verify)は単なるテスト実行ではなく「静止画を出力して人間が目視確認した後にエンコードする」方式を採用:フレーム単位のチェック項目で「90フレーム目でハイライトされている単語は [startMs, endMs] に含まれる単語でなければならない」と明記。
the word highlighted at frame 90 is the word whose [startMs,endMs] contains 90/fps (no drift)
referenceにてエンドツーエンドで実行可能なコード(Whisperのインストール、SRT解析、ページ分割、SRT/VTTエクスポート、プラットフォーム別セーフエリア、フォント仕様)を網羅する。
# Word-Timed Captions — End-to-End Build
文字起こしに関してオフラインとクラウドの2つの選択肢を用意する(クラウドはreference内に代替案として1行記載されるのみ)。
npx @remotion/install-whisper-cpp # one-time: installs whisper.cpp + a model
2コア機能
3外部依存関係
| Kind | Dependency / Endpoint |
|---|---|
| cli | npx remotion still / render / compositions |
| package | @remotion/captions(createTikTokStyleCaptions / Caption 类型) |
| cli | npx @remotion/install-whisper-cpp(一次性装 whisper.cpp + 模型) |
| api | AssemblyAI / Deepgram / OpenAI Whisper API(可选云转写替代,非默认路径) |
| cli | scripts/contact-sheet.sh + scripts/probe-mp4.sh(仓库根共享验证工具箱) |
| package | ffmpeg / ffprobe(系统依赖) |
4推奨統制措置と判定根拠
- scripts/: ローカルスクリプトまたはコマンドの実行: `npx @remotion/install-whisper-cpp`:プロジェクトディレクトリへのwhisper.cppおよびモデルファイルの一括インストール(オフライン文字起こしパス)
- 网络端点: 外部ネットワークアクセスの宣言: (オプション・非デフォルト)AssemblyAI / Deepgram / OpenAI Whisper APIを選択した場合、ユーザーの音声素材がサードパーティの文字起こしサービスに送信される。re
- 本地工作目录: ファイルの読み書きと成果物の出力: 本スキルに基づきエージェントが構築するRemotionプロジェクト(src/、Root/Composition、zodスキーマ)および out/capti
5二重目の独立検証
- [ok] skill 目录内是否真的没有可执行代码(档位判定的关键证据) — `find iart-tiktok-video-skills/skills/caption-animation -type f` 只列出 SKILL.md / references/word-timed-captions.md / README.md;目录内没有 .mjs/.sh/.ts 等可执行文件。SKILL.md 引用的 scripts/*.sh 实际位于**仓库根**(三仓库各一份),并非 skill 目录内资产——本报告按「SKILL.md 明列的使用路径」把它们计入 scripts_executed,但档位判定仍以 skill 目录内行为为主,两者结论一致(蓝)。
- [ok] 全部外链是否只是文档链接而非运行时端点 — 对 skills/ 全域 grep `https?://`(排除 iart.ai)零命中;唯二命中是 reference 与 README 末尾的 `https://iart.ai/?utm_source=github&utm_medium=…` 营销/引流链接,以及 skill 内代码里的 `file://`? 无。因此不存在「执行期外发」。
- [ok] 云转写替代路径是否构成现实风险(要不要升橙) — reference §2 原文只有一行:`- Cloud alternatives (AssemblyAI, Deepgram, OpenAI Whisper API) also return word timing — map their words[] into Token the same way.`,SKILL.md 管线表也只在工具列把 AssemblyAI 与 Whisper 并列。源码未规定任何 endpoint、key 读取方式或上传动作;默认路径是本地 whisper.cpp。按批4 细则2(可选的替代方案不判级)维持蓝档,但已在 risks 写明触发条件。
- [ok] 验收断言的措辞是否与 reference 的实现一致(防第一遍想当然) — SKILL.md 要求「第 90 帧高亮的词必须是覆盖 90/fps 的 token」;reference §5 的窗口组件正是 `active={now >= t.startMs && now < t.endMs}`(now = frame/fps×1000 系);两侧同一判据,无漂移空间。
- [unlocatable] 性能声明「Whisper medium.en ≈ 2x faster than large」是否有据可查 — 仓库内无基准脚本、无数据文件、无引用来源;本次为只读侦查且不得运行转写,故不验证该倍数,仅作为文档声明记录,不作为结论。
- [discrepancy] light tier(seek-shot.sh + `?t=N` harness)对本 skill 是否可用 — scripts/README.md 把 seek-shot.sh 标为 Light tier(驱动页面的 `?t=N` seek harness),但 caption-animation 的 Web/CSS 路径(reference §6 的 renderTrack)只做 track 渲染,**没有提供 seek harness**;本 skill 的「Packaged helper」行也只点名 contact-sheet.sh 与 probe-mp4.sh(Heavy tier),未提 seek-shot.sh。结论:该脚本对本 skill 属仓库级通用件而非本 skill 承诺的能力,读者不应假定 light tier 可用——这是对 pin commit 有效的真实出入(非错误声明,因 SKILL.md 从未承诺)。
- [ok] 三仓库共享脚本是否同内容(跨包一致性) — 三仓库 scripts/ 逐字节相同:contact-sheet.sh b7dcc28034c9bf8fda5d48683e54d8b5、probe-mp4.sh 167b7977c50f492014e1a6fef8c9ed12、seek-shot.sh 24a4130cd1e64874154429b0b4af12da
6結論
1b958f9e09758504…