Communitygithub.com

长视频配音

为已审批的视频脚本创建旁白和角色语音。首先判断视频是否需要配音,征得用户确认后,构建配音阵容,生成样音供用户批准,最后为每句台词生成独立的音频文件。

长视频配音 是什么?

该技能是长视频工作流的第七阶段,负责将已审批的视频脚本转化为配音音频。它首先根据视频的说话模式(旁白、角色或混合)、脚本中台词数量以及配置文件中的语音来源,自主判断视频是否需要配音,并向用户提出明确的建议。获得确认后,技能会基于 `film-style.md` 和 `visual-bible.md` 中的描述构建配音阵容(包括旁白和所有对白角色),并利用 ElevenLabs MCP 或其他文本转语音工具为每个角色生成短样音,确保用户对声音满意后才开始正式生成。在正式生成阶段,技能会按场景顺序为每句台词生成音频文件(以场景号和说话者命名),并校验其时长是否匹配(最长10秒)。如果遇到时长不匹配的台词,技能会提供加速、延长场景或拆分台词等选项,但绝不会擅自更改脚本原文。该技能支持多种语音生成方式:使用用户提供的 TTS 工具、本地 TTS、或为用户准备好剧本脚本供其自行录音,并能与 `long-video-sound` 无缝衔接。它严格遵守安全规则:不创建未经确认的声音、不重复扣费的生成调用、不要求输入 API 密钥或密码。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/samanfirouzi/long-video-skill/tree/HEAD/skills/long-video-voice

在你喜欢的 AI 中提问

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

文档

长视频配音 是做什么的?

长视频工作流的阶段 7。输出:一个音频文件目录,每句台词一个文件,按场景和说话者命名。或者决定视频无需语音。

场景 指脚本的一个镜头(一个镜头,最多 10 秒),在视频中按顺序编号,与之前阶段相同。

开始前

  1. 在 ~/.long-video/projects/<slug>/ 中找到项目。要求存在 status: approved 的 video-script.md 和 film-style.md。
  2. 加载项目配置:语言、画外音来源和提供商 (audio.voiceover)、providers.tts、审批级别、预算。
  3. 从 film-style.md 中读取说话模式和声音描述。
  4. 如果 audio/ 或 voice-scripts/ 已存在,请询问:继续(列举已完成的部分),还是重新开始。

步骤 1:视频是否需要语音?

在询问之前先自行判断。检查:

  • film-style.md 中的说话模式(旁白、角色、混合),
  • 配置中的 audio.voiceover.source(none、self-recorded、cloud-tts、local-tts),
  • 脚本中有多少句旁白或对白台词,分布在多少个场景中。

然后给出带理由的建议,并请求确认。示例:“脚本在 104 个场景中的 96 个里有 142 句旁白台词,且配置使用云端文本转语音。我推荐使用旁白视频。您希望我为其创建声音吗?”

  • 如果脚本没有台词,或配置指定无画外音:建议跳过,并说明理由。
  • 已批准。 继续步骤 2。
  • 不需要。 在 project.json 中设置 "voice_mode": "none" 和 "stage": "voice-skipped"。说明后续阶段将仅使用音乐和音效。停止。
  • 不同意建议。 遵循用户的意见。如果语音原是 none 而用户现在想要,则更新配置备注。

未经用户确认,绝不创建任何声音。

步骤 2:构建配音阵容

  1. 列出每一位说话者:旁白(如有)和每个有对白的角色。统计每个人的台词数量。
  2. 对于每位说话者,从 film-style.md 获取声音描述(年龄、语气、口音、语速)。如果描述缺失,根据 visual-bible.md 中的角色描述提出一个描述,并标记为“提议”。
  3. 以表格形式展示阵容:说话者、ID、台词数量、声音描述。要求用户确认或编辑。
  4. 说话者 ID:narrator,或去掉 char- 前缀的角色ID(例如 char-mara 变为 mara)。这些 ID 将用于文件名。

步骤 3:选择音频制作方式

询问:“应由 Claude 生成声音,还是您自行制作(录音或使用自己的工具)?”

  • Claude 生成。 转到步骤 4。
  • 我自行制作。 转到步骤 6。
  • 两者都做。 编写声音脚本(步骤 6)并同时生成(步骤 4)。
  • 如果 audio.voiceover.source 是 self-recorded,直接转到步骤 6。

步骤 4:寻找语音工具并制作样音

阅读 references/voice-generation.md。简而言之:

  1. 如果配置中有保存的方法 (providers.tts),则使用该方法。先测试。
  2. 查找当前会话中连接的可生成语音的工具(ElevenLabs MCP 或类似工具,或具有语音工具的技能)。
  3. 检查设备上的 API 密钥环境变量。仅打印“已设置”或“未设置”。
  4. 检查本地文本转语音工具。
  5. 如果未找到任何工具,询问用户是否有 API 密钥(作为环境变量,切勿粘贴在聊天中)、要连接的 MCP 服务器,或浏览器中的语音网站。或者转到步骤 6。

先制作声音样本。未经用户批准角色声音,切勿生成完整音频。

  1. 为每位说话者选择符合描述的声音。列出工具的声音库并从中选择。切勿从记忆中使用声音 ID。如果工具能根据描述设计新声音,为难匹配的声音提供此选项。
  2. 为每位说话者制作一个短样本(5 到 15 秒)。使用该说话者在脚本中的真实台词,语言与配置语言一致。对于旁白,使用开场白。如果台词有演绎说明,请包含在内。
  3. 将样本保存到 audio/samples/,文件名为 sample_<speaker>.mp3。
  4. 呈现每个样本,附带说话者、声音名称和台词。要求用户批准,或要求更换其他声音。如果用户要求另一种声音,则制作一个新样本(一次一个,绝不批量重试)。重复直到每位说话者都获批。
  5. 在 voice-cast.md 中记录已批准的声音(说话者、声音名称、声音 ID、设置、样本文件)。更新 film-style.md 中的声音列表以匹配。

不要重复生成调用来重试。每次调用都可能再次计费。

步骤 5:生成台词

  1. 阅读 references/voice-script-format.md。根据脚本构建台词列表:每句台词一个条目,按场景顺序排列。
  2. 告知用户台词数量、总语音时长和大致成本。开始前询问。提供从某个范围开始的选项,例如场景 1 到 10。
  3. 测试场景。 生成第一个有语音的场景。播放或报告其时长。询问演绎效果是否合适。先调整设置。
  4. 按场景顺序使用已批准的声音进行生成。应用演绎说明。使用台词列表中的发音提示。
  5. 将每句台词保存为 audio/lines/scene-<NNN>_<speaker>_<NN>.<ext>。未经询问绝不覆盖已存在的文件。
  6. 每个文件生成后,使用 ffprobe 测量其时长。与脚本中该场景的时长(见格式参考的适配规则)比较。记录结果。
  7. 如果某句台词不适合其场景,不要更改文字。提供选项:稍快语速(最多 10%)、延长场景(仍在 10 秒限制内),或在征得用户同意后将台词拆分到两个场景。
  8. 一次性全部处理还是逐一处理:询问用户。逐一处理将播放每句台词的结果,等待批准或重做请求。
  9. 如果工具在视频片段内部制作了自己的音频(唇形同步),询问是保留该音频还是使用这些文件。将答案记录在 audio/status.md 中。

如果生成失败或用户拒绝,对于剩余场景回退到步骤 6。

步骤 6:为用户提供声音脚本

  1. 为完成的音频文件创建 audio/lines/,为台词列表创建 voice-scripts/。显示完整路径。
  2. 按照格式参考,编写每批 20 个场景的批次文件 (scenes-001-020.md) 和 voice-scripts/index.md。每句台词包含:
    • 要保存的文件名:audio/lines/scene-007_narrator_01.mp3
    • 说话者和声音描述
    • 准确文本、演绎说明和发音提示
    • 场景时长,以便检查音频是否适配
  3. 询问:一次性全部提供,还是逐一提供。
    • 一次性全部提供。 展示文件夹路径和一个示例。用户自行处理批次文件。
    • 逐一提供。 展示第一句台词及其文件名。等待用户确认已保存。检查文件是否存在且名称正确,并测量其时长。然后展示下一句台词。
  4. 随时提供检查文件夹的选项:将文件与索引比较,列出缺失、命名错误或音频过长的文件。

步骤 7:状态与完成

  1. 使用格式参考中的表格保持 audio/status.md 为最新。状态值:pending, done, needs-manual, skipped。
  2. 更新 project.json:台词列表保存后设置 "stage": "voice-prompts-done",每句台词都有音频文件且用户批准集后设置 "stage": "voice-done"。
  3. 告知用户 audio/ 和 voice-scripts/ 的路径、总语音时长与视频时长的对比,以及缺失或过长的内容。
  4. 提供将工作中使用的工具保存到配置 (providers.tts) 的选项,仅保存方法和名称。
  5. 提供继续处理 long-video-sound(音效、环境声和背景音乐)的选项。仅当用户同意时才启动。除非用户要求且该阶段存在,否则不要启动任何其他后续阶段。

规则

  • 未经用户在步骤 1 确认,绝不创建声音。
  • 未经声音样本获批,绝不生成完整音频。
  • 绝不更改脚本文字。如果台词不匹配,先询问。
  • 绝不使用非来自工具自身声音库或用户提供的声音 ID。
  • 绝不在聊天中索要 API 密钥。绝不在浏览器中输入密码或解决验证码。
  • 绝不静默重复生成调用来重试。每次调用都可能再次计费。
  • 台词列表获批后,绝不重命名文件。
  • 保持聊天信息简短。将完整的台词列表放在文件中。

Individual skills in this repo

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

long-video-assets

Video and animation skill. Build the visual foundation for a long video from an approved story. Extracts the recurring characters, environments and key objects, helps the user choose one art style from suggested options (10 at a time, more on request), then writes image generation prompts for every character (portrait plus character sheet), environment and object, all sharing one locked style. Can also generate the images (installed tool, API, MCP or browser) or hand the user a folder and file names to fill. Use after lon

long-video-director

Turn an approved story into a shot-by-shot video script, acting as the director. Asks whether the video uses a narrator or characters who speak (or both), suggests professional filming choices (camera type, lenses, camera movement, lighting, color, pacing), saves them as a separate film style file, then writes a script that matches the project config. Outputs film-style.md and video-script.md. Use after long-video-story (and long-video-assets) are done, or when the user asks for the video script, shot list, camera style or lighting plan.

long-video-keyframes

Create the start and end frame image for every scene (clip) of the approved video script. Writes one image prompt per frame with a fixed file name that holds the scene number and start or end, makes a folder for the images, and can generate the images with an available image tool, or hand the prompts to the user all at once or one by one. Use after long-video-director, or when the user asks for start frames, end frames, keyframes or scene images.

long-video-render

Assemble the finished video and run the review loop. Builds the edit from the clips (or images with camera moves), voice, sound stems and captions, renders a low quality review version with scene numbers and time burned in so a client can review it, collects and applies changes (re-rendering reviews as often as needed), and when the user approves, renders the high quality final video. Uses a video editor with a CLI or MCP (FilmCraft, EffectCraft or another) if one is available and the user wants it, otherwise the bundled ffmpeg renderer. Use after long-video-sound, or when the user asks to render, assemble, export, preview or finalize the video.

long-video-sound

Video and animation skill. Create the sound effects, ambience and background music for the video and place them on the timeline. Plans the sound design from the approved script, sources or makes each sound (Openverse for openly licensed recordings and music, Earshot to make sounds from words and to listen to and judge sounds, Clipwing real-sfx to place real sounds on exact frames), records licences and credits, and mixes separate stems (effects, ambience, music) with the music ducked under speech. Or gives the user a fold

long-video-story

Agree on the story for a long video. The user either supplies a story or asks Claude to write one. When Claude writes, it first asks which story style to use (for example niche discovery, or a provocative-questions narration), runs that style's skill, and revises until the user approves. Use after long-video-setup, or when the user says "story for my video", "give me an idea", or wants to change an unapproved story. Ends only when the user explicitly approves the story.

相关技能