SuperAPI AI Directory

chengfeng-visual-talking-head

Frontend & websites

View repository

Updated 10-15 16:42

About this skill

Visuals (storyboard)

This is one thing, not a stage of a pipeline. Do it whenever the user calls for it; after editing changes you can come back and do it again.

There are only two prerequisites:The ledger and subtitles already exist(layers are placed by subtitle screen, and time is computed from the ledger).

需要   edit-list.json、transcript.json、subtitles.json
产出   visuals.json + modules/<序号-名字>/index.html

Stop when done,do not direct the user's next step。

First read and execute the business Skill's stage contract. For the hard rules of module authoring, see Module Contract, for judgment rules see Visual Judgment。

0. Always run the Runtime precheck first

Get the chengfeng-videocut exact source.path。 SKILL_DIR from Codex's enabled Plugin list. It is not a variable Codex guarantees to inject; do not rely on it, hardcode dev machine paths, or use find to guess the install directory:

PLUGIN_ROOT="$(codex plugin list --json | node -e 'let s=""; process.stdin.on("data", c => s += c); process.stdin.on("end", () => { const rows = JSON.parse(s).installed || []; const hit = rows.filter(x => x.enabled && x.name === "chengfeng-videocut" && x.source && x.source.path); if (hit.length !== 1) process.exit(1); process.stdout.write(hit[0].source.path); });')"
test -n "$PLUGIN_ROOT" && test -f "$PLUGIN_ROOT/.codex-plugin/plugin.json" || { echo "chengfeng-videocut enabled plugin root unavailable" >&2; exit 1; }
ENSURE="$PLUGIN_ROOT/scripts/ensure-runtime.cjs"
VC="$PLUGIN_ROOT/scripts/videocut-cli.cjs"

node "$ENSURE" --install-if-missing --json
  • ready: continue this Skill.
  • missing: the script prompts only once "Installing from GitHub Release", and after validation completes it automatically resumes.
  • runtime_unhealthy, installation failure, or post-install doctor failure: report structured diagnostics and stop.
  • During the precheck phase, do not start services, open Studio, or create projects.

For the detailed protocol see Runtime and Product Contract。

Command

node "$VC" visual get   <project> --json
node "$VC" visual frame <project> --cues sub-0004,sub-0005 --count 12 --out <dir> --json
node "$VC" visual add   <project> --module modules/01-xx/index.html \
  --cues sub-0004,sub-0005 [--zoom x,y,w,h] [--id vis-0001] --json
node "$VC" visual remove <project> --id vis-0001 --json

Layer bindingsubtitle screen(--cues), the product converts it into word ids itself—a layer can never be bound to a word nobody said, and when the edit changes the layer moves with it.Do not store seconds.

Four steps, not one skipped

① 文字定任务    读 subtitles.json,按语义分段,每段回答:
               教程/演示/证明,还是概念/逻辑/过渡?
② 抽帧看画面    visual frame 抽 8-12 帧,真的用眼睛看。
               实测 12 段里有 2 段被画面推翻文字预判 —— 这步不是走形式
③ 量运动窗口    相邻帧做像素差,找出滚动/切换/操作的时刻。
               层只盖稳定窗口,圈在画面开始动之前退场
④ 做层放层     写模块 → visual add → 在预览里逐层核对

the judgment rules of ②

画面正是他说的东西     → 标注:圈住、说到哪个词圈哪里。真证据不许盖
画面弱相关/空白       → 小黑动画:整屏白底,从风格库做
画面自身足够清楚      → 不动。这是最常见的正确答案(实测 13 段里 4 段不动)

the deliverable of ③ is numbers, not feelings

圈的坐标      像素统计量出来(灰度扫描找文字行),不许目测 —— 目测差过 50px
互动时刻      逐帧像素差找突变(实测一次从 4 跳到 335),圈在它之前 0.2s 退完
稳定窗口      开头常有滚动(他在找内容),层从停稳那屏的 cue 开始绑

before using push-in (zoom), think

默认不推近。   960x720 的录屏放大就糊,用户会立刻看出来
非推不可时     ≤1.6 倍、区域取 62.5% 见方居中 —— 构图完整 > 读清小字
字太小读不清   用圈引导视线就够了;真要读清,答案是高分辨率重录,不是放大

Review loop

Use module directories named withordinal numbers(01-daily-report、05-anim-task-split), the timeline track shows the directory name; when the user reports a number you change that layer and leave the rest alone.

Two layer-editing disciplines, each corresponding to a real incident:

改层必查模块     层收窄/延长后,模块里写死的相对时刻不会跟着变 ——
                圈的出场时刻可能落到层结束之后,永远不出现
验收看像素      截图看画面,不查 DOM 属性。「可见性翻转正确」的 iframe
                曾经物理上不在画面里 —— 属性全对、屏幕全空

What is not allowed

  • Do not skip frame extraction and motion windows and do it directly (each of the two mistakes has been made once: covering up real evidence, circling hanging on scrolling)
  • Do not do something for every segment—filling everything is not the goal, and doing nothing is a common answer
  • Do not store seconds, do not eyeball coordinates, do not add darkening on white-background pages
  • Do not pad with placeholder images when there is no real content
  • Styles must be chosen from the registry; do not invent them out of thin air
  • Brand icons must use the official glyphs; do not hand-draw substitutes(X was drawn with two crossing strokes and the user caught it). If the local index does not have it, take the monochrome official glyph from simple-icons (which happens to match the black-and-white style), store the original svg in the module directory for reference; within the same video, the same brand may only look one way