Communitygithub.com

libz-renlab-ai/TeamBrain

HyperFrames 媒體前置處理:文字轉語音 (Kokoro)、語音/影片轉錄 (Whisper) 及背景移除 (u2net),用於製作透明疊加層。

TeamBrain 是什麼?

這個技能提供三個 CLI 指令,用於 HyperFrames 組合的資產前置處理:`tts` 使用 Kokoro-82M 模型在本地生成語音,無需 API 金鑰;`transcribe` 使用 Whisper 產生具備逐字時間戳記的 `transcript.json`;`remove-background` 則利用 u2net_human_seg 模型移除影片或圖片的背景,輸出透明疊加層。每個指令首次執行時會自動下載並快取模型至 `~/.cache/hyperframes/` 目錄。`tts` 支援 54 種語音與多語言(含美式/英式英語、西班牙語、法語、日語等),透過語音 ID 前綴自動偵測語言;`transcribe` 強烈建議非英語內容使用不含 `.en` 後綴的模型以避免誤譯;`remove-background` 輸出支援 VP9 Alpha WebM(Chrome 原生支援)、ProRes 4444 及 PNG 格式。使用者可將這些指令鏈接,例如先 `tts` 生成語音,再 `transcribe` 產生字幕時間碼。

相容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/libz-renlab-ai/TeamBrain/tree/HEAD/.agents/skills/hyperframes-media

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

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 avatar.mp4 -o transparent.webm  # 預設:VP9 Alpha WebM
npx hyperframes remove-background avatar.mp4 -o transparent.mov   # ProRes 4444(剪輯用)
npx hyperframes remove-background portrait.jpg -o cutout.png      # 單張圖片去背
npx hyperframes remove-background avatar.mp4 -o transparent.webm --device cpu
npx hyperframes remove-background --info                          # 顯示已偵測到的提供者

使用 u2net_human_seg(MIT 授權)。首次執行會下載約 168 MB 的權重至 ~/.cache/hyperframes/background-removal/models/ 目錄。

輸出格式

格式使用時機
.webm(VP9 + Alpha)預設。組合可直接透過 <video> 播放。
.mov(ProRes 4444)在 DaVinci/Premiere/FCP 中編輯。檔案較大。
.png單張圖片去背(靜態主體,疊加在背景上)。

Chrome 原生解碼 VP9 Alpha,因此 .webm 可以像其他靜音自動播放影片一樣直接插入組合——請參閱 hyperframes 技能中 <video> 影軌的慣例。

TTS → 轉錄 → 字幕

當沒有預先錄製的旁白時,可以先產生旁白再轉錄回來,以取得用於字幕的逐字時間戳記:

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

Whisper 會從生成的音訊中提取精確的單字邊界,因此字幕時間軸能與語音完美匹配,無需手動調整。

Individual skills in this repo

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

libz-renlab-ai/TeamBrain

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.

libz-renlab-ai/TeamBrain

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 CLI commands (init, lint, preview, render, transcribe, tts) see the hyperframes-cli skill.

libz-renlab-ai/TeamBrain

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 — for example "port my Remotion project to HyperFrames", "convert this Remotion code to HyperFrames", "migrate from Remotion", "translate this Remotion comp", or "rewrite this as HyperFrames HTML". Do NOT use when (a) the user is authoring a NEW HyperFrames composition, even if they have or are A/B-testing a similar Remotion video; (b) the user mentions Remotion in passing without asking for migration; (c) the user shares Remotion code as reference material rather than asking for a translation; (d) the user asks for "the same video as my Remotion one" without explicitly asking to migrate the source — treat that as a fresh HyperFrames build. When in doubt, default to authoring a native HyperFrames composition with the `hyperframes` skill instead. Skill detects unsupported patterns (use...

libz-renlab-ai/TeamBrain

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.

libz-renlab-ai/TeamBrain

HyperFrames CLI tool — hyperframes init, lint, inspect, preview, render, transcribe, tts, doctor, browser, info, upgrade, compositions, docs, benchmark. Use when scaffolding a project, linting, validating, inspecting visual layout in compositions, previewing in the studio, rendering to video, transcribing audio, generating TTS, or troubleshooting the HyperFrames environment.

相關技能