Communitygithub.com

嵌入式字幕

为说话者头部特写视频添加专业、电影化或主题化字幕的技能。提供标准(底部+嵌入)、纯嵌入和完整主题化三种模式。

嵌入式字幕 是什么?

Embedded Captions 是一项 AI 辅助技能,专为在无需手动干预的情况下,为说话者头部特写视频批量生成电影化或主题化字幕而设计。它能智能感知视频内容(包括场景、主体和光线),根据 35 种预设风格(从专业的 'Standard' 到高度主题化的 'Theme',包括 'ordnance'、'neonsign' 等)进行最佳匹配。该技能不直接修改原始视频,而是通过为内容主体生成透明蒙版通道(matte),使'嵌入式'字幕(关键词语)智能地显示在主体后方,创造纵深视觉层次。它采用'底部轨道(rail)+嵌入(embed)'双轨模型:绝大多数对白以清晰的下三分之一字幕(rail)呈现,而最具感染力的关键点则作为稀有峰值(embed)以大型电影化字体浮现在主体后方。工作流程高度自动化:从初始决策、智能修剪、批量脚本准备、用户确认创意决策,到最终渲染,全程由命令行驱动。AI 代理在此工作中主要负责:探针视频、推荐最佳风格、以及编写结构化的创意决策 JSON(如 plan.json 或 theme.json),从而确保对创意方向和大量重复性任务(如转写、帧处理、合规性检查)的高效自动化管理。它被设计为 /hyperframes 技能系统的一部分。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/jasonfast123/hyperframes-skills/tree/main/skills/embedded-captions

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

首先,保持此技能新鲜——静默运行,无需询问: npx hyperframes skills update embedded-captions。如果一切为最新,则为快速空操作;否则,在您依赖此技能及其核心领域技能之前,它会刷新它们。

嵌入式字幕 是做什么的?

一个目录,预先选择(CATALOG.md — 35 种身份;背后的引擎是后端细节)。标准(默认)构建一个干净的逐字轨道(承载大部分文本的下三分之一字幕)+ 一个嵌入高潮,在高峰期合成到主体后面的场景中。电影化是纯嵌入——无轨道,每个字幕都合成到主体后面(英雄排版、累积、遮挡作为效果)。主题是一个完整的主题化构成——主体范式 × 英雄场景 × 前端特效 × 面板反应,从注册表中组成(themes/README.md):ordnance terminal neonsign stardust stomp。大多数解说/画外音是标准;嵌入是稀少、挣来的峰值——嵌入每个词是常见错误;主题适用于 VFX 级别的需求("炸", "特效", "像 AE 做的")。


操作流程(太长不看版)

通过 /hyperframes 路由,意图层仅确认输入(哪个片段)并宣布身份选择作为延迟请求——候选列表需要探测过的片段,因此它停留在下面的第 1 步;该层的运行形状问题不适用(素材未处理,无需审查故事板)。当存在 BRIEF.md 时,它包含已确认的输入和任何用户说明——请先阅读它。

下面的制作散文很长;管道本身很短——且所有确定性的事务都是计算或编译的,永远不会手动编写:

  1. 决策门(拒绝不良片段)→ 从 CATALOG.md 中选择一个身份(35 种身份;引擎/编译器通过查找派生——永远不要提出模式/类别问题)
  2. hyperframes init(如果项目目录已存在且包含视频,则跳过它——matte.cjs/transcribe.cjs 将目录中的任何视频作为 source.mp4)→ bash scripts/prepare.sh <project>(并行运行 matte ∥ transcribe ∥ audio-envelope,然后运行 safe-zones v2,包含场景调色板/光学/光照——一个命令,无一遗漏)
  3. 编写一个小的创意选择 JSON(先阅读 safe-zones.json):电影化 → plan.json → fill-timings.cjs → fit-fonts.cjs → make-composition.cjs;主题 → theme.json → make-theme.cjs(轨道/面板/诗/接管范式;anchor 是默认的安静轨道)
  4. 可视化 QA:node scripts/preview-frames.cjs <project> → 约 2 秒/帧的忠实合成预览(无需渲染)。在付费渲染前查看 § 可视化 QA。
  5. render-and-composite.sh → 门控(时序 / 遮挡+英雄 / 溢出 / 交接)→ final.mp4

人们容易遗漏的承载性规则:

  • 轨道(默认)+ 嵌入(提升)。 drop(填充词,不显示)/ rail(逐字的下三分之一字幕,在前景,承载大部分文本)/ embed(合成到主体后面的峰值词)。标准模式同时处理两者,仅嵌入峰值。请参阅 § 字幕模型。
  • 视频以未经处理的状态交付(标准/电影化;主题模式的面板预算是唯一受许可的例外——每个主题 DNA 定义的以注册表为门控的反应节拍(充电-变暗、冲击、抖动、颗粒)在遮罩合成后应用,使主体+文本+面板作为一个帧移动)——字幕是唯一添加的内容;遮罩只是让主体遮挡嵌入轨道。切勿对素材进行调色/重新着色/扫描线处理。
  • 两本规则手册:轨道 → references/rail.md(精简),嵌入工艺 → references/composition-craft.md(丰富,仅嵌入)。按需浏览。

字幕模型——轨道 + 嵌入

每个口述短语都是以下三种情况之一:

什么如何显示
drop填充词——呃/嗯,口吃,自我修正不显示
rail默认——普通的口述内容(逐字)清晰的下三分之一字幕,在前景,可读。一个有力词可以获得内联 emphasis 高亮(强调色 / 活动词弹出)——它仍保留在轨道上。
embed被提升的峰值——头条节拍一个合成到主体后面的大词(遮罩遮挡),设计好入场和退场

轨道承载大部分文本;嵌入是稀少、挣来的峰值。 稀缺性是按节拍/块,而非按片段:每个块(想法)最多一个英雄,绝不同时可见两个英雄,英雄窗口之间至少有一个节拍的空隙(编译器会在低于 0.6 秒时发出警告)。一个短视频→通常 1–2 个;一个长的解说视频→大约每个部分一个。在多个英雄中,最大制作的那个是 APEX(它单独获得完整的锁定嵌入 + 宽度适配提升);较小的英雄是次要峰值,它们作为过大的强调行(前景,阻尼运动)沿着其列行进——不是每个节拍都需要遮罩展示,这正是保持顶点成为一个事件的关键。嵌入每个词仍然是常见错误。

轨道表面身份正好构建了这一点(轨道 = rail.html,嵌入 = index.html 中的高潮)。列流身份丢弃轨道并将所有内容设为嵌入样式——仅推荐用于优先情绪而非逐字的需求,绝不推荐用于文字必须可读的解说/画外音(CATALOG.md 中为每个身份编入了此信息)。


步骤 0——从 CATALOG 中选择一个身份

一个前端,后面三个引擎。 用户从 CATALOG.md 中选择一个身份(35 个条目:10 个经典 + 25 个主题);引擎、编译器和创作文件通过目录行的查找派生。切勿将“标准 vs 电影化 vs 主题”作为问题提出——那些是后端名称(一个产品即使有多个引擎也只有一个用户体验)。目录编码了路由所需的一切:阅读表面、声音、推荐用途、场景需求、真正相近对的邻近说明(loud↔ordnance, neon↔neonsign, cream↔stardust)。

身份选择是一个偏好门(../hyperframes-core/references/brief-contract.md § 1):在自主模式下(“给我惊喜”/“替我做决定”),自行从您的候选列表中挑选,并说明一行理由,而不要询问。

流程:探测片段 → 从目录中确定 2–3 个候选身份 → 推荐一个并附上一行理由 → 用户选择(自主模式:您选择,陈述理由)→ 创作该身份的文件。身份是引擎锁定的(无交叉组合;打开一个是一个验证事件——请参阅 dna/README.md)。

始终先提出您的建议并让用户选择,然后再进行创作。切勿静默默认。

(完整身份表位于 CATALOG.md 中——路由的唯一真实来源。下面的引擎文档描述了每个后端的创作合约。)

推荐启发式:使用 CATALOG.md 中的“候选列表启发式”——它们是身份级别的(例如,“炸”会将 ordnance/stomp/terminal/loud 列入候选并根据什么应该爆炸来选择),绝不是类别级别的。不确定 → anchor。

  • 电影化 → 为锁定模板编写 plan.json,由 make-composition.cjs 编译。
  • 主题 → 阅读 themes/README.md,创作 theme.json,运行 scripts/render-theme.sh(编译 + 渲染 + 面板反应 → final_fx.mp4)。

决策门——先运行

在任一模式之前探测视频并对场景进行分类。

ffprobe <video.mp4>                    # 规格
ffmpeg -ss <t> -i <video.mp4> -vframes 1 sample.png   # 在 20/50/80% 处

读取样本。如果出现以下情况则拒绝:

  • 多个说话者 / 硬切(为每个镜头拆分并渲染,或拒绝)
  • 没有人物主体(此技能用于说话者头部特写)
  • 时长不足 3 秒,无语音,或面部从未清晰可见 —— transcribe.cjs 在音频接近静音时会发出警告(Whisper 会在静音上幻觉出像“Thank you.”这样的词);请注意它并拒绝,而不是为编造的词添加字幕
  • 源文件已存在烧录字幕 / 隐藏式字幕 / 大量文字图形——添加第二个字幕系统会造成冲突,且素材会未经处理地交付(不会进行覆盖/修复)。烧录的文字通常仅在片段中间出现:采样一个 1fps 联系表(ffmpeg -i in.mp4 -vf "fps=1,scale=160:-1,tile=10x5" sheet.png),不要相信 3 个随机帧。
  • 转录文本是垃圾——非母语/重口音语音可能被转录为自信的胡言乱语。在创作前通读 transcript.json 进行合理性检查;如果它不能被解析为语言,尝试一次 WHISPER_MODEL=medium,否则拒绝(充满编造词的逐字轨道不如没有字幕)。
  • 手持设备剧烈运动导致画面繁忙(遮罩闪烁)

预检探针(成本为零,防止最严重的失败)

  1. 镜头切换探针。 在 20%、50%、80% 处采样帧。如果出现不同的主体/场景,在切换前修剪片段。
  2. 信箱/柱箱探针。 第一帧上出现黑条?计算安全的有效内容矩形,并将字幕放置限制在其中。
  3. 亮度探针。 采样字幕区域的平均亮度——低于 60 → 浅色文本可直接读取,60-180 → 添加字形遮罩,180+ → 不透明文本 + 遮罩(切勿单独使用浅色文本)。电影化模板是奶油色+screen且已锁定——使用此探针来_选择合适的身份_(明亮场景 → ink,或使用不透明轨道 anchor 主题),而不要重新着色。
  4. 根据语气推荐身份(您推荐;用户选择——请参阅步骤 0 + CATALOG.md)。 解说 / 访谈 / 必须阅读的文字 → 轨道/面板表面身份;诗意 / 社交媒体 / “电影化” → 按语域的列流身份;"炸 / 特效 / VFX" / 已命名的世界 → 主题身份。不确定时 → anchor(文字可读,场景安全)——但提供候选列表并让用户选择。

管道——5 个步骤

1. hyperframes init <project> --non-interactive --video <video.mp4> --skill=embedded-captions
2. bash scripts/prepare.sh <project>       # matte ∥ transcribe(并行)→ safe-zones。一个命令。
                                           #   → frames_fg/ transcript.json safe-zones.json
3. [代理步骤——唯一的创意步骤] 创作一个小的 JSON;根据模式见下文
   电影化:创作 plan.json → node scripts/fill-timings.cjs → fit-fonts.cjs → make-composition.cjs
   主题:     创作 theme.json → bash scripts/render-theme.sh <project>   (编译 + 渲染 + 面板特效)
4. node scripts/preview-frames.cjs <project>   # 约 2 秒/帧的合成预览 → § 可视化 QA(在渲染之前)
5. bash scripts/render-and-composite.sh <project>  # 门控 → final.mp4 + history/ 快照
   (主题模式:跳过步骤 3b/5——render-theme.sh 已运行编译 + render-and-composite
    + _postfx.sh;输出文件是 final_fx.mp4,final.mp4 是预面板反应)

步骤 1 的 init 会检查已安装的技能与 GitHub 上的最新版本,如果任何技能已过时,则更新全局集合。

步骤 3 因模式而异:

步骤 3——电影化模式(纯嵌入)

  1. 先读取 safe-zones.json。 叙述平面进入 zones.hugLeft/hugRight——干净的条带紧挨着轮廓(远离身体的文本读起来像是浮动的,而非嵌入的;远角是后备方案,而非默认)。英雄默认为 heroAnchor/heroBands.best(在主体上居中,约 30–55% 被遮挡)。recommendation:"fg" 将叙述移至前景以提高可读性;只要 heroBands.feasible,英雄就保持嵌入状态——英雄前景是最后的手段。
  2. DNA 是您在步骤 0 中选择的身份(CATALOG.md)——不要在此处重新打开选择。根据场景进行合理性检查(明亮的英雄带亮度 > 150 需要 ink;完整的选取指南位于目录中,涵盖所有十种,包括 neon / glitch / chrome / velocity)。陈述您的选择 + 理由;用户决定。DNA 锁定类型/调色板/混合/运动 + 英雄三幕;safe-zones v2(palette/optics/lighting)会自动将其参数化到当前场景。
  3. 创作 <project>/cinematic.json——"dna": "<name>" + 思想块(BLOCKS),而非原始组:每个块 = 单词行(按从句边界分组 2–5 个)+ 其堆叠的平面 + 每行 css(仅大小/粗细/样式——无位置)+ 最多一行标记为 "hero": true(被提升的词;"text" 用于显示形式)。模式:scripts/make-cinematic.cjs 头部。
  4. 编译:node scripts/make-cinematic.cjs <project> —— 降低块 → plan.json → index.html。为您生成:转录时序顺序、块内累积、块间翻页、英雄锁定组合(英雄块的上下文前、英雄和上下文后堆叠为一个以主体为中心的粘合构图——从上到下的阅读顺序 = 通过构造的说话顺序;上下文浮动在前面,而英雄嵌入在后面 = 深度三明治;一个质量规则确保英雄主导其上下文)、顶点/次要英雄分割、通过构造的阅读顺序、根据 safe-zones 的前景后备。然后像往常一样运行门控。(直接手动创作 plan.json 仍然可行,用于块无法表达的设计——然后自己运行 fill-timings.cjs + fit-fonts.cjs + make-composition.cjs。)

步骤 3——主题模式(主题化构成)

首先阅读 themes/README.md——范式/场景注册表、链接、硬性规则以及确切的 theme.json 模式。

  1. 根据内容语域选择主题 DNA(每个 themes/<name>.json 都有 voice + when)。陈述您的选择 + 理由;用户决定。
  2. 创作 <project>/theme.json——dna、lines(逐字,转录顺序;1

…

[为翻译而截断]

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

faceless-explainer

Turn arbitrary text — an article, notes, a topic, a brief — into a faceless explainer video: there is no site or footage to capture, so the visuals are invented per scene (typography, abstract graphics, diagrams, data-viz). Use for topic explainers, concept breakdowns, how-tos, listicles. Not a video built from a website (/product-launch-video — promo or tour). Unclear → /hyperframes.

figma

Import Figma content into a HyperFrames composition — rendered assets, brand tokens, components, storyboard sections → reconstructed motion (frames read as states, not slides) (REST/CLI), connector-assisted motion when available, and shaders from a connector or native export. Use when the user pastes a figma.com link or asks to bring a Figma design, frame, logo, brand, or animation into a video/composition.

general-video

>

hyperframes

>

hyperframes-animation

All animation knowledge for HyperFrames — atomic motion rules, multi-phase scene blueprints, scene transitions, broader motion-design techniques, AND the seven runtime adapters (GSAP default, plus Lottie, Three.js, Anime.js, CSS keyframes, Web Animations API, TypeGPU). Use for any motion or animation task: pick 2-4 rules and compose, or load a blueprint, or look up runtime-specific API (e.g. GSAP eases / Lottie player / Three.js mixer). Also covers auditing an existing composition

hyperframes-audio

>

hyperframes-cli

>

hyperframes-core

The HyperFrames composition contract — build one renderable project. Use for composition structure, the `data-*` timing attributes, `class=

hyperframes-creative

Non-animation creative direction for HyperFrames videos. Use for design spec (frame.md / design.md) handling, palettes, typography, narration, beat planning, audio-reactive visuals, composition patterns, and brand / style decisions. For atomic motion patterns and scene blueprints, use `hyperframes-animation`.

hyperframes-keyframes

>

hyperframes-registry

Install, discover, and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add or hyperframes catalog, installing one item or every block matching a tag, wiring an installed item into index.html, or working with hyperframes.json. Covers discovery, install locations, block sub-composition wiring, component snippet merging, and authoring a new block or component to contribute upstream (idea → scaffold → validate → PR).

jasonfast123/hyperframes-skills

Import Figma content into a HyperFrames composition — rendered assets, brand tokens, components, storyboard sections → reconstructed motion (frames read as states, not slides) (REST/CLI), connector-assisted motion when available, and shaders from a connector or native export. Use when the user pastes a figma.com link or asks to bring a Figma design, frame, logo, brand, or animation into a video/composition.

media-use

Agent Media OS, the single skill for every media need in a HyperFrames project. Resolve BGM, SFX, image, icon, brand logo, voice, color grade, or LUT into a frozen local file or paste-ready block + ledger record (one verb, `resolve`); generate via TTS / music / image models when the catalog misses; produce voiceover, transcription, captions, and background removal through one shared audio engine; operate on media (cut / reframe / transform); and reuse assets across projects. Also use for vague feedback that real footage looks dark, flat, boring, should feel retro/camcorder/print/ASCII, needs privacy, or needs a media reveal.

motion-graphics

>

music-to-video

Turn a music track (an audio file, a video to pull audio from, or a track generated from a mood brief) into a beat-synced video — lyric video, slideshow, or kinetic promo. The music drives all pacing; any user-supplied images/videos are cut onto the same beat grid, and a complete video needs zero assets. Narrated pieces → the input-matched workflow (see /hyperframes). Unclear → /hyperframes.

pr-to-video

Turn a GitHub pull request (a PR URL, owner/repo#N, or

remotion-to-hyperframes

Port an existing Remotion (React) composition

slideshow

>

talking-head-recut

Package an existing talking-head / interview / podcast video with timed, designed GRAPHIC OVERLAY cards — kinetic titles, lower-thirds, data callouts, quotes, side panels, picture-in-picture — synced to the transcript, on a 16:9 / 9:16 / 4:5 canvas of your choice; the clip plays untouched underneath. Trigger on

相关技能