Communitygithub.com

delorenj/skills

HyperFrames 组合的资产预处理——文本转语音旁白(Kokoro)、音频/视频转录(Whisper)以及用于透明叠加层的背景移除(u2net)。在需要从文本生成配音、为字幕转录语音、为透明叠加层去除视频或图像背景、选择 TTS 语音或 Whisper 模型,或串联这些操作(TTS → 转录 → 字幕)时使用。每条命令首次运行时都会下载其模型。

skills 是什么?

此技能为 HyperFrames 组合提供三条 CLI 命令:`tts`(文本转语音)、`transcribe`(转录)和 `remove-background`(背景移除)。它使用本地模型(Kokoro-82M、Whisper、u2net_human_seg),无需 API 密钥,模型在首次运行时自动下载并缓存至 `~/.cache/hyperframes/`。`tts` 支持 54 种语音、多种语言自动检测以及速度调节;`transcribe` 生成带词级时间戳的 `transcript.json`,并强调 `.en` 模型会静默翻译非英语音频,需谨慎使用;`remove-background` 可分离视频或图像中的前景主体,并支持通过 `--background-output` 生成背景层(挖空版),用于在主体后插入文本或图形。这些命令的输出可直接用于 HyperFrames 组合 HTML,配合 `hyperframes` 技能中的音视频元素约定。该技能在 Cursor、Claude Code 等支持 CLI 工具的开发者平台中有效。

兼容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/delorenj/skills/tree/HEAD/hyperframes-media

在你喜欢的 AI 中提问

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

预览

来自技能 README

文档

HyperFrames 媒体预处理

产生合资产出的三条 CLI 命令:tts(语音)、transcribe(时间戳)和 remove-background(透明视频)。每一条在首次运行时下载模型并缓存到 ~/.cache/hyperframes/ 下。将输出放入项目,然后从组合 HTML 中引用——请参阅 hyperframes 技能了解音视频元素约定。

文本转语音 (tts)

使用 Kokoro-82M 在本地生成语音音频。无需 API 密钥。

npx hyperframes tts "这里的文本" --voice af_nova --output narration.wav
npx hyperframes tts script.txt --voice bf_emma --output narration.wav
npx hyperframes tts --list                       # 全部 54 种语音

语音选择

将语音与内容匹配。默认为 af_heart。

内容类型语音原因
产品演示af_heart/af_nova温暖、专业
教程/指导am_adam/bf_emma中性、易于跟随
营销/推广af_sky/am_michael充满活力或权威
文档bf_emma/bm_george清晰的英式英语、正式
休闲/社交af_heart/af_sky亲切、自然

多语言

语音 ID 通过首字母编码语言:a=美式英语,b=英式英语,e=西班牙语,f=法语,h=印地语,i=意大利语,j=日语,p=巴西葡萄牙语,z=普通话。CLI 会自动从前缀检测音素化语言环境——当语音与文本匹配时无需 --lang。

npx hyperframes tts "La reunión empieza a las nueve" --voice ef_dora --output es.wav
npx hyperframes tts "今日はいい天気ですね" --voice jf_alpha --output ja.wav

仅当需要覆盖自动检测(用于风格化口音)时才使用 --lang。有效代码:en-us、en-gb、es、fr-fr、hi、it、pt-br、ja、zh。非英语音素化需要系统范围内安装 espeak-ng(brew install espeak-ng / apt-get install espeak-ng)。

语速

  • 0.7-0.8 —— 教程、复杂内容、无障碍
  • 1.0 —— 自然语速(默认)
  • 1.1-1.2 —— 介绍、过渡、轻快内容
  • 1.5+ —— 很少适用;请仔细测试

长脚本

对于超过几段的内容,请写入 .txt 文件并传入路径。超过约 5 分钟的语音输入可能需要拆分为段落。

要求

Python 3.8+,并安装 kokoro-onnx 和 soundfile(pip install kokoro-onnx soundfile)。模型在首次使用时下载(约 311 MB + 约 27 MB 语音,缓存于 ~/.cache/hyperframes/tts/)。

转录 (transcribe)

生成带有词级时间戳的规范化 transcript.json。

npx hyperframes transcribe audio.mp3
npx hyperframes transcribe video.mp4 --model small --language es
npx hyperframes transcribe subtitles.srt          # 导入现有字幕
npx hyperframes transcribe subtitles.vtt
npx hyperframes transcribe openai-response.json

语言规则(无商量余地)

除非用户明确说明音频是英语,否则切勿使用 .en 模型。 .en 模型(small.en、medium.en)会将非英语音频翻译成英语而非转录。这会在静默中破坏原始语言。

  1. 已知语言且非英语 → --model small --language <code>(无 .en 后缀)
  2. 已知语言且为英语 → --model small.en
  3. 未知语言 → --model small(无 .en,无 --language)—— whisper 自动检测

默认模型是 small,而不是 small.en。

模型大小

模型大小速度使用时机
tiny75 MB最快快速预览、测试流程
base142 MB快短片段、清晰音频
small466 MB中等默认——大多数内容
medium1.5 GB慢重要内容、嘈杂音频、音乐
large-v33.1 GB最慢生产质量

含人声的音乐:至少从 medium 开始;成品曲目通常需要手动导入 SRT/VTT。关于字幕质量检查(每次转录后必须执行)、清理 JS、重试规则以及 OpenAI/Groq API 导入路径,请参阅 hyperframes/references/transcript-guide.md。

输出形状

组合消费一个扁平的单词对象数组。id 字段(w0、w1、...)在规范化过程中添加,用于字幕覆盖的稳定引用;为向后兼容为可选。

[
  { "id": "w0", "text": "Hello", "start": 0.0, "end": 0.5 },
  { "id": "w1", "text": "world.", "start": 0.6, "end": 1.2 }
]

背景移除 (remove-background)

从视频或图像中移除背景,使主体(通常是人——头像、演示者、说话者头像)作为组合中的透明叠加层。

npx hyperframes remove-background subject.mp4 -o transparent.webm  # 默认:VP9 透明 WebM
npx hyperframes remove-background subject.mp4 -o transparent.mov   # ProRes 4444(编辑用)
npx hyperframes remove-background portrait.jpg -o cutout.png       # 单张图像抠图
npx hyperframes remove-background subject.mp4 -o subject.webm \
  --background-output plate.webm                                   # 一次处理两个图层
npx hyperframes remove-background subject.mp4 -o transparent.webm --device cpu
npx hyperframes remove-background --info                           # 检测到的提供商

使用 u2net_human_seg(MIT 许可证)。首次运行将约 168 MB 的权重下载到 ~/.cache/hyperframes/background-removal/models/。

图层分离 (--background-output)

传递 --background-output(或 -b)以在抠图旁输出第二个透明视频:相同的源 RGB,但 alpha 是 255 − mask 而不是 mask。抠图是主体,背景透明;底板是原始环境,主体所在位置有一个透明空洞。

文件Alpha 是…用途
-o subject.webm遮罩——主体不透明,背景透明前景图层,放在顶部
--background-output plate.webm反转——环境不透明,主体区域透明底层图层;将文本或图形放在此图层与主体之间

两个输出共享相同的 --quality 预设,并且从单次推理运行中生成——编码成本大约翻倍,分割成本保持不变。仅适用于视频输入和 .webm/.mov 输出。

挖空底板,而非修复后的清洁底板。 plate.webm 中的主体区域是完全透明的——在它下面组合一些不透明的东西来填充空洞。判断 --background-output 是否是正确工具的唯一测试:在主体原本所在的位置,是否有任何内容会通过主体的轮廓可见?

使用场景正确工具
文本/图形位于抠图和底板之间(此命令存在的理由)挖空(--background-output)
主体放到不相关的场景中仅使用 subject.webm;忽略底板
在没有人的情况下单独显示房间,不叠加其他内容清洁底板——需要修复工具(LaMa、ProPainter、E2FGVI)。不是此命令。
用不同主体替换现有主体清洁底板——同上

如果用户要求“移除人物后的房间”并且打算单独显示,请不要使用 --background-output。告诉他们需要修复工具。

典型的层级组合(典型挖孔用例):

<!-- z=1 反转 alpha 底板填充除主体区域外的所有内容 -->
<video
  src="plate.webm"
  data-start="0"
  data-duration="6"
  data-track-index="0"
  muted
  playsinline
></video>

<!-- z=2 图形/文本位于两个图层之间 -->
<h1 id="headline" style="z-index:2; ...">用 HYPERFRAMES 制作</h1>

<!-- z=3 抠图将主体重新浮于标题之上 -->
<div class="cutout-wrap" style="position:absolute;inset:0;z-index:3">
  <video
    src="subject.webm"
    data-start="0"
    data-duration="6"
    data-track-index="1"
    muted
    playsinline
  ></video>
</div>

这功能上等同于下面的文字在主体之后的模式,但你不需要在项目中保留原始的 presenter.mp4——底板替代了它。当你只想提供两个透明图层并让用户在其间放置任意内容时非常有用。

输出格式

格式使用时机
.webm(VP9 + 透明通道)默认。组合通过 <video> 直接播放。
.mov(ProRes 4444)在 DaVinci/Premiere/FCP 中编辑。文件较大。
.png单张图像抠图(静态主体,层叠在背景之上)。

Chrome 原生解码 VP9 透明通道,因此 .webm 可以像任何其他静音自动播放视频一样插入组合——请参阅 hyperframes 技能了解 <video> 轨道约定。

质量预设

--quality fast|balanced|best 仅控制 VP9 编码器的 CRF——分割质量是固定的。

预设CRF使用时机
fast30迭代中,文件更小,颜色匹配较松散
balanced18默认。大多数使用场景下视觉上相同
best12母版/最终交付。文件最大,匹配最紧密

合成模式——选择正确的模式

抠图 webm 是源 mp4 RGB 的重编码副本。该选择根据你放在它后面的内容产生不同结果:

模式抠图后面是什么结果
抠图放在不同场景上(最常见)静态图像、渐变或不相关视频效果很好。抠图的 RGB 是主体的唯一来源——无重复,无边缘光晕。这就是 remove-background 的设计目的。
抠图放在自身源 mp4 上(文字在主体之后)生成抠图所用的同一 mp4同一个人有两个 RGB 来源。在默认 --quality balanced(crf 18)下,重复几乎不可见;在 --quality fast(crf 30)下你会看到微弱的颜色偏移/边缘光晕。母版使用 --quality best(crf 12)。
抠图放在同一个人物的_不同_次拍摄上同一主体的不同素材看起来像两个不同的人重叠。不要这样做。

文字在主体之后(标题位于演示者之后):

<video
  src="presenter.mp4"
  id="bg"
  data-start="0"
  data-duration="6"
  data-track-index="0"
  muted
  playsinline
></video>
<h1 id="headline" style="z-index:2; ...">用 HYPERFRAMES 制作</h1>
<div class="cutout-wrap" style="position:absolute;inset:0;z-index:3;opacity:0">
  <video
    src="presenter.webm"
    data-start="0"
    data-duration="6"
    data-track-index="1"
    muted
    playsinline
  ></video>
</div>

两个关键规则:

  1. 将抠图视频包裹在非计时 <div> 中并动画化包裹层的透明度,而非视频元素本身。框架会强制活动剪辑(任何带有 data-start/data-duration 的元素)的透明度为 1,因此直接动画化视频的透明度会被静默覆盖。包裹层没有 data-* 属性,因此由你的 CSS/GSAP 控制。
  2. 两个视频都使用 data-start="0" 和 data-media-start="0",以便框架从 t=0 开始同步解码它们。延迟挂载抠图(data-start=3.3)会导致 seek 和预热,使一帧偏离基础 mp4——在剪切处可见为一帧错位。

然后通过 GSAP 在剪切处翻转包裹层的透明度:tl.set(cutoutWrap, { opacity: 1 }, 3.3)。

TTS → 转录 → 字幕

当没有预先录制的配音时,生成一个并重新转录以获得词级时间戳用于字幕:

npx hyperframes tts script.txt --voice af_heart --output narration.wav
npx hyperframes transcribe narration.wav   # → transcript.json

Individual skills in this repo

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

delorenj/skills

Plan and generate terminal ASCII animations/screensaver-style output (FPS, refresh rules, loop policy, low-flicker guidance), with a static poster frame and an optional local demo script.

delorenj/skills

ASCII video: convert video/audio to colored ASCII MP4/GIF.

delorenj/skills

Plan, build and quality-check a premium short commercial for a real business (roofing, property, ecommerce, B2B software) using AI-generated footage, code-built motion (HTML/GSAP), selective Three.js and an independent-critic "Gauntlet" loop. Use when asked to make a launch-style / SaaS-style video, business ad, explainer, sample reel or pitch video, or to review and improve one. Encodes motion principles distilled from 28 professional launch films, a quality bar, audio rules and a business-offer playbook.

delorenj/skills

CSS animation adapter patterns for HyperFrames. Use when authoring CSS keyframes, animation-delay based timing, animation-fill-mode, animation-play-state, or CSS-only motion that HyperFrames must seek deterministically during preview and rendering.

delorenj/skills

Generate professional voiceovers using ElevenLabs AI. Use when the user needs to create voiceovers for videos, audio narration, or text-to-speech content. Supports multiple voices with character presets (narrator, salesperson, expert) for natural delivery. Includes single scene regeneration for fine-tuning.

delorenj/skills

HyperFrames CLI dev loop — `npx hyperframes` for scaffolding (init), validation (lint, inspect), preview, render, and environment troubleshooting (doctor, browser, info, upgrade). Use when running any of these commands or troubleshooting the HyperFrames build/render environment. For asset preprocessing commands (`tts`, `transcribe`, `remove-background`), invoke the `hyperframes-media` skill instead.

delorenj/skills

Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, and registry discovery.

delorenj/skills

Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML. Use when asked to build any HTML-based video content, add captions or subtitles synced to audio, generate text-to-speech narration, create audio-reactive animation (beat sync, glow, pulse driven by music), add animated text highlighting (marker sweeps, hand-drawn circles, burst lines, scribble, sketchout), or add transitions between scenes (crossfades, wipes, reveals, shader transitions). Covers composition authoring, timing, media, and the full video production workflow. For dev-loop CLI commands (init, lint, inspect, preview, render) see the hyperframes-cli skill; for asset preprocessing commands (tts, transcribe, remove-background) see the hyperframes-media skill.

delorenj/skills

Manim CE animations: 3Blue1Brown math/algo videos.

delorenj/skills

Join a Google Meet or Zoom call as a video meeting agent via PikaStreaming. Trigger: user drops a Google Meet or Zoom link, or asks to join a meeting.

delorenj/skills

Translate an existing Remotion (React-based) video composition into a HyperFrames HTML composition. Use ONLY when the user explicitly asks to port, convert, migrate, translate, or rewrite a Remotion composition as HyperFrames (e.g. "port my Remotion project to HyperFrames"). Do NOT use when (a) authoring a NEW HyperFrames composition (even if A/B-testing a Remotion video); (b) Remotion is mentioned in passing; (c) Remotion code is shared as reference, not for translation; (d) the user wants "the same video as my Remotion one" without explicitly asking to migrate the source — treat as a fresh HyperFrames build. When in doubt, default to the `hyperframes` skill. Detects unsupported patterns (useState, useEffect side effects, async calculateMetadata, third-party React component libraries, `@remotion/lambda`) and recommends the runtime interop escape hatch instead of a lossy translation.

delorenj/skills

Generate speech using the self-hosted voxxy (vox) TTS service at https://vox.delo.sh. Use when the user asks to speak, say, narrate, synthesize speech, clone a voice, create a voice, add or register a voice, pipe TTS, or control voice qualities by description (e.g. "a young woman with a cheerful voice"). Handles HTTP API usage, voice profile management, description-based voice design, cloning, MCP registration, and integration patterns for new platforms.

delorenj/skills

Capture a website and create a HyperFrames video from it. Use when: (1) a user provides a URL and wants a video, (2) someone says "capture this site", "turn this into a video", "make a promo from my site", (3) the user wants a social ad, product tour, or any video based on an existing website, (4) the user shares a link and asks for any kind of video content. Even if the user just pastes a URL — this is the skill to use.

delorenj/skills

YouTube transcripts to summaries, threads, blogs.

相关技能