Communitygithub.com

delorenj/技能集

使用 ElevenLabs AI 生成專業配音。當用戶需要為影片、音頻旁白或文字轉語音內容創建配音時使用。支援多種語音及角色預設(旁白、銷售員、專家),提供自然的演繹效果。包括單一場景重新生成功能,便於微調。

技能集 是什麼?

這個技能提供了一套完整的基於 ElevenLabs API 的專業配音生成工具,主要用於 Remotion 影片製作流程。它將配音生成劃分為多個可控的場景(scene),支援批次生成和單一場景的重新生成,極大提升了配音與畫面的同步精度和迭代效率。該技能支援多種角色預設(如旁白、銷售員、專家),能根據內容風格自動調整語調,避免機械化的文字朗讀。其核心功能包括:基於 JSON 場景檔的批次生成、使用 ElevenLabs 請求拼接(request stitching)技術保持場景間語調一致、自動使用 ffprobe 進行時長與靜音檢測的驗證,以及將縮圖嵌入 MP4 影片的功能。這些功能特別適合需要高品質、多角色且與畫面精準同步的專業影片製作,如解說影片、廣告和教學內容。它支援通過 CLI 參數(如 `--scene`、`--new-text`、`--character`)對單一場景進行精細調整,並自動更新相關的元數據檔案(info.json),讓 Remotion 合成能即時獲取實際音頻時長以實現精確同步。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/delorenj/skills/tree/HEAD/elevenlabs-remotion

在你喜歡的 AI 中提問

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

說明文件

ElevenLabs 配音生成

使用 ElevenLabs API 為 Remotion 影片生成專業 AI 配音。

先決條件

  • 在 .env.local 中設定 ELEVEN_API_KEY

快速開始

# 從文字生成配音
node ~/.agents/skills/elevenlabs-remotion/generate.js --text "您的文字內容" --output public/audio/voiceover.mp3

# 使用旁白風格生成(更自然)
node ~/.agents/skills/elevenlabs-remotion/generate.js --text "您的文字" --character narrator --output voiceover.mp3

# 使用請求拼接生成多個場景
node ~/.agents/skills/elevenlabs-remotion/generate.js --scenes remotion/scenes.json --output-dir public/audio/project/

# 重新生成單一場景
node ~/.agents/skills/elevenlabs-remotion/generate.js --scenes scenes.json --scene scene2 --new-text "更新後的文字"

# 列出可用語音和角色預設
node ~/.agents/skills/elevenlabs-remotion/generate.js --list-voices
node ~/.agents/skills/elevenlabs-remotion/generate.js --list-characters

角色預設

使用角色預設可以獲得更自然的配音效果,而非直接照本宣科地朗讀螢幕文字:

角色描述最佳用途
literal完全照文字朗讀螢幕文字、引言
narrator專業說書人,流暢迷人解說、紀錄片
salesperson熱情、有說服力、充滿活力行銷、廣告
expert權威、自信、知識淵博法律內容、教學
conversational隨意、友好、自然社交媒體、休閒內容
dramatic強烈、情感豐富、衝擊力強鉤子、問題陳述
calm安撫、堅定、溫和建立信任、結論
# 全域使用旁白風格
node ~/.agents/skills/elevenlabs-remotion/generate.js --scenes scenes.json --character narrator --output-dir public/audio/

# 或在 scenes.json 中按場景設定
{
  "scenes": [
    { "id": "scene1", "text": "問題陳述", "character": "dramatic" },
    { "id": "scene2", "text": "解決方案", "character": "calm" }
  ]
}

基於場景的生成與請求拼接

使用 ElevenLabs 的請求拼接功能,生成具有一致語調的多個場景:

scenes.json 格式

{
  "name": "product-demo",
  "voice": "George",
  "character": "narrator",
  "scenes": [
    {
      "id": "scene1",
      "text": "通用的文字轉語音聽起來很機械。您的品牌值得更好的。",
      "duration": 4.5,
      "character": "dramatic"
    },
    {
      "id": "scene2",
      "text": "透過語音複製,您可以使用自己的聲音創建無限的內容。",
      "duration": 5.5
    },
    {
      "id": "scene3",
      "text": "錄製一個短樣本。複製它。在幾分鐘內創建專業的配音。",
      "duration": 6,
      "delay": 0.3
    }
  ]
}

生成所有場景

node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/product-demo-scenes.json \
  --output-dir public/audio/product-demo/

這將創建:

  • product-demo-scene1.mp3 到 sceneN.mp3
  • product-demo-combined.mp3(所有場景拼接)
  • product-demo-info.json(包含時長的元數據)

單一場景重新生成

如果某個場景開始過早、時間點不對,或需要不同的文字:

# 使用新文字重新生成 scene2
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/scenes.json \
  --scene scene2 \
  --new-text "更新後的場景2文字" \
  --output-dir public/audio/project/

# 使用不同角色重新生成 scene3
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/scenes.json \
  --scene scene3 \
  --character salesperson \
  --output-dir public/audio/project/

# 僅重新生成(相同文字、相同角色)
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/scenes.json \
  --scene scene1 \
  --output-dir public/audio/project/

# 將縮圖嵌入 MP4 影片
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --embed-thumbnail public/videos/my-video.mp4 \
  --thumbnail public/videos/my-thumbnail.png \
  --output public/videos/my-video-with-thumb.mp4

此工具會自動:

  • 使用先前場景的請求拼接,以保持一致的語調
  • 使用新的元數據更新 info.json 檔案
  • 如果提供了 --new-text,則更新 scenes.json

縮圖嵌入

將縮圖圖片嵌入 MP4 影片,以便 Twitter、YouTube 和影片播放器等平台顯示您自訂的縮圖,而非影片的第一幀。

將縮圖嵌入影片

# 基本用法 - 輸出到 video-thumb.mp4
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --embed-thumbnail public/videos/promo.mp4 \
  --thumbnail public/videos/thumbnail.png

# 自訂輸出路徑
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --embed-thumbnail public/videos/promo.mp4 \
  --thumbnail public/videos/thumbnail.png \
  --output public/videos/promo-final.mp4

與 Remotion 結合的工作流程

# 1. 渲染您的影片
npx remotion render MyVideo public/videos/my-video.mp4

# 2. 渲染您的縮圖(使用 Still composition)
npx remotion still MyVideoThumbnail public/videos/my-thumbnail.png

# 3. 嵌入縮圖
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --embed-thumbnail public/videos/my-video.mp4 \
  --thumbnail public/videos/my-thumbnail.png \
  --output public/videos/my-video-final.mp4

支援的格式

  • 影片: MP4 (H.264/H.265)
  • 縮圖: PNG, JPG, JPEG

此嵌入過程使用 ffmpeg 的 -disposition:v:1 attached_pic 標誌,將縮圖設定為附加圖片,大多數影片播放器和平台都能識別。

時間驗證

該技能在生成後會自動使用 ffprobe 驗證時間:

檢查項目

檢查項目閾值描述
時長不匹配>15%如果實際時長與預期時長差異過大,則發出警告
開頭靜音>200ms音頻開始過晚(配音延遲)
結尾靜音>500ms結尾有不必要的靜音
語速2-4.5 wps最佳約 3 字詞/秒

驗證現有音頻

# 驗證專案中的所有場景
node ~/.agents/skills/elevenlabs-remotion/generate.js --validate public/audio/product-demo/

輸出範例:

🔍 正在驗證 product-demo(6 個場景)

❌ scene1: 3.00秒(預期: 4.5秒)
   ❌ 音頻比預期短 1.50秒
   👍 8 個字詞 @ 3.1 字詞/秒
⚠️ scene2: 6.35秒(預期: 5.5秒)
   ⚠️ 開頭靜音: 235ms(可能開始過晚)
   🐢 10 個字詞 @ 1.8 字詞/秒
✅ scene4: 4.36秒(預期: 4秒)
   👍 9 個字詞 @ 2.3 字詞/秒

📊 總時長: 30.80秒(預期: 30.00秒)

更新的 info.json

驗證後,info.json 會包含實際測量值:

{
  "scenes": [
    {
      "id": "scene1",
      "duration": 4.5,
      "actualDuration": 3.0,
      "leadingSilence": 0.05,
      "wordsPerSecond": 3.1
    }
  ]
}

在您的 Remotion 合成中使用 actualDuration 以實現精確同步。

選項

選項描述預設值
--text, -t要轉換為語音的文字必要(或 --file/--scenes)
--file, -f從檔案讀取文字-
--output, -o輸出檔案路徑output.mp3
--output-dir場景的輸出目錄public/audio
--voice, -v語音名稱或 IDGeorge
--model, -m模型 IDeleven_multilingual_v2
--character, -c角色預設literal
--scenes包含場景的 JSON 檔案-
--scene重新生成單一場景 ID-
--new-text場景重新生成的新文字-
--validate驗證現有音頻目錄-
--skip-validation跳過自動驗證false
--embed-thumbnail要嵌入縮圖的影片檔案-
--thumbnail縮圖圖片檔案(PNG/JPG)-
--stability語音穩定性(0-1)因角色而異
--similarity語音相似度(0-1)因角色而異
--style風格誇張程度(0-1)因角色而異
--no-combined跳過合併檔案false

推薦語音

語音風格最佳用途
George溫暖、迷人的英式發音旁白、解說
Antoni專業、溫暖法律內容、教學
Arnold權威、低沉企業、嚴肅話題
Josh友好、健談行銷、休閒內容

與 Remotion 整合

生成場景配音後,在您的 composition 中使用它們:

import { Audio, Sequence, staticFile } from "remotion";

// 使用單個場景音頻檔案以實現精確同步
const SCENE_DURATIONS = {
  scene1: 4.5,  // 從 info.json 取得
  scene2: 5.5,
  scene3: 8.0,
};

export const VideoWithVoiceover: React.FC = () => {
  const { fps } = useVideoConfig();

  const scene1Frames = Math.round(SCENE_DURATIONS.scene1 * fps);
  const scene2Frames = Math.round(SCENE_DURATIONS.scene2 * fps);

  return (
    <>
      <Sequence from={0} durationInFrames={scene1Frames}>
        <Audio src={staticFile("audio/project/project-scene1.mp3")} />
        <Scene1Visual />
      </Sequence>

      <Sequence from={scene1Frames} durationInFrames={scene2Frames}>
        <Audio src={staticFile("audio/project/project-scene2.mp3")} />
        <Scene2Visual />
      </Sequence>
    </>
  );
};

最佳效果提示

  1. 使用角色預設:不要直接照本宣科地朗讀螢幕文字,使用 narrator 或 expert 以獲得自然流暢的效果
  2. 標點符號很重要:使用句號表示停頓,逗號表示短暫停頓
  3. 數字:為了自然發音,請拼寫出數字("五百" 而非 "500")
  4. 縮寫:寫出完整詞語("二十四小時" 而非 "24h")
  5. 逐場景處理:不同的場景可以使用不同的角色(戲劇性的開場,平靜的行動呼籲)
  6. 微調:使用 --scene 重新生成個別場景,無需重做所有工作
  7. 請求拼接:保持所有場景的語音一致

工作流程範例

# 1. 使用您的劇本創建 scenes.json
# 2. 使用旁白風格生成所有場景
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/my-video-scenes.json \
  --character narrator \
  --output-dir public/audio/my-video/

# 3. 在 Remotion 中預覽,發現 scene2 開始過早
# 4. 使用更新的文字重新生成 scene2
node ~/.agents/skills/elevenlabs-remotion/generate.js \
  --scenes remotion/my-video-scenes.json \
  --scene scene2 \
  --new-text "稍微長一點的文字以填滿視覺時間" \
  --output-dir public/audio/my-video/

# 5. 使用 info.json 中的新時長更新影片 composition
# 6. 重複直到時間點完美

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

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

Asset preprocessing for HyperFrames compositions — text-to-speech narration (Kokoro), audio/video transcription (Whisper), and background removal for transparent overlays (u2net). Use when generating voiceover from text, transcribing speech for captions, removing the background from a video or image to use as a transparent overlay, choosing a TTS voice or whisper model, or chaining these (TTS → transcribe → captions). Each command downloads its own model on first run.

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.

相關技能