voxcpm-chinese-dubbing

🎯 **唯一使用VoxCPM的中文配音技能** - 外语视频一键中文配音,支持硬字幕检测、断点续传、智能BGM。触发场景:(1) 用户需要给外语视频配音 (2) 视频翻译需求 (3) 多语言内容本地化

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "voxcpm-chinese-dubbing" with this command: npx skills add newaiguy/video-dubbing

🎬 VoxCPM中文视频配音

唯一使用VoxCPM开源模型的中文配音技能

生产环境验证 ✅ | 断点续传 ✅ | 智能BGM ✅

🌟 核心卖点

特性说明
🎯 VoxCPM独家唯一集成VoxCPM开源TTS模型的中文配音技能
生产验证已在B站成功发布4个视频
🔄 断点续传中断后可继续,无需重新生成
🔍 硬字幕检测AI自动检测并覆盖原字幕
🎵 智能BGM自动循环、交叉淡入淡出

📋 完整流程

1. Whisper转写    → medium模型转写 + 时间戳
2. AI翻译        → 腾讯混元MT翻译模型
3. 分组TTS       → VoxCPM配音(按组生成,保持连贯)
4. 音频匹配      → 智能拉伸/加静音
5. 硬字幕检测    → AI自动检测是否需要遮盖
6. 字幕生成      → 中文字幕(自动换行)
7. 视频合并      → GPU加速编码

🚀 快速开始

1. 安装依赖

# Python依赖
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install openai-whisper soundfile scipy librosa requests

# VoxCPM(从官方获取)
git clone https://github.com/modelscope/VoxCPM.git

2. 配置

复制配置模板:

cp config.example.json config.json

编辑 config.json

{
  "work_dir": "./workspace",
  "voxcpm_dir": "./VoxCPM",
  "ffmpeg_path": "ffmpeg",
  "translate": {
    "api_url": "https://api.siliconflow.cn/v1/chat/completions",
    "api_key": "YOUR_API_KEY",
    "model": "tencent/Hunyuan-MT-7B"
  },
  "vision": {
    "api_url": "https://api.siliconflow.cn/v1/chat/completions",
    "model": "Qwen/Qwen2.5-VL-72B-Instruct"
  },
  "tts": {
    "reference_audio": "./reference_audio/speaker.wav",
    "reference_text": "参考音频对应的文本"
  }
}

注意: 所有配置项均可通过环境变量覆盖,优先级:环境变量 > config.json > 默认值


### 3. 运行

```bash
python scripts/dubbing.py your_video.mp4

输出:

  • workspace/output/your_video_dubbed.mp4 - 配音视频
  • workspace/output/your_video.srt - 字幕文件

⚙️ 参数说明

Whisper参数

参数默认值说明
whisper.modelmediumWhisper模型大小
whisper.languageen源语言

TTS参数

参数默认值说明
tts.max_group_duration15.0每组最大时长(秒)
tts.inference_timesteps10推理步数
tts.cfg_value2.0CFG值

字幕参数

参数默认值说明
subtitle.fontsize16字体大小
subtitle.fontnameSimHei字体名称
subtitle.outline2描边宽度

🎵 BGM添加

python scripts/add_bgm.py <视频> [BGM文件] [输出文件]

特性:

  • BGM自动循环(交叉淡入淡出3秒)
  • 音量控制(默认12%)
  • 自动淡入淡出

🔧 高级用法

测试模式

只处理前30秒:

python scripts/dubbing.py video.mp4 --test 30

指定输出名

python scripts/dubbing.py video.mp4 --output my_video

自定义配置

python scripts/dubbing.py video.mp4 --config my_config.json

📁 文件结构

video-dubbing/
├── SKILL.md              # 本文档
├── config.example.json   # 配置模板
├── scripts/
│   ├── dubbing.py       # 主流程脚本
│   ├── add_bgm.py       # BGM添加
│   └── upload_bilibili.py # B站上传
└── reference_audio/      # TTS参考音频
    └── speaker.wav

🔑 环境变量

变量说明默认值
TRANSLATE_API_KEY翻译API密钥(必需)-
VOXCPM_DIRVoxCPM目录./VoxCPM
WORK_DIR工作目录./workspace
REFERENCE_AUDIOTTS参考音频路径./reference_audio/speaker.wav
REFERENCE_TEXT参考音频对应文本-
TRANSLATE_API_URL翻译API端点SiliconFlow
TRANSLATE_MODEL翻译模型tencent/Hunyuan-MT-7B
VISION_API_URL硬字幕检测API端点SiliconFlow
VISION_MODELVision模型Qwen/Qwen2.5-VL-72B-Instruct
WHISPER_MODELWhisper模型medium
WHISPER_LANGUAGE源语言en
FFMPEG_PATHffmpeg路径ffmpeg

📊 音频匹配质量

ratio范围方法质量
< 0.85加静音✅ 无损
0.85-1.15resample✅ 轻微调整
> 1.15librosa加速⚠️ 轻微失真

实测:60%+组无损音质

⚠️ 注意事项

AV1编码视频

AV1编码视频需要重新编码:

# 使用GPU编码
-c:v h264_nvenc

# 或CPU编码
-c:v libx264

VoxCPM模型

需要从ModelScope获取VoxCPM模型:

# 下载模型到指定目录
modelscope download --model modelscope/VoxCPM --local_dir ./VoxCPM

📜 许可证

MIT License

🙏 致谢


🎯 选择VoxCPM中文配音的理由:

  1. 开源免费,无商业限制
  2. 中文效果最佳,自然流畅
  3. 支持声音克隆(参考音频)
  4. 本地运行,数据安全

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

MCBAI Douyin Dubber

Auto-dub Douyin/TikTok videos into any language using a fully local pipeline: download with Playwright Chromium + Douyin cookie → transcribe with Whisper → t...

Registry SourceRecently Updated
850Profile unavailable
General

Gettr Transcribe

Download audio from a GETTR post or streaming page and transcribe it locally with MLX Whisper on Apple Silicon (with timestamps via VTT). Use when given a GE...

Registry SourceRecently Updated
4990Profile unavailable
General

Omnicast

A local multi-modal podcast pipeline. Ingests media, drafts scripts, synthesizes audio, renders cover art, and uploads to YouTube.

Registry SourceRecently Updated
2401Profile unavailable
General

Chinese Voice Detective Mystery Game

中文语音侦探推理游戏。适用于用户想玩一场沉浸式推理探案的场景:由 LLM 生成包含嫌疑人、线索和真凶的完整案件,玩家通过审讯嫌疑人(支持 ASR 语音或文本输入)、勘察现场、收集证据,最终提出指控并获得评分。支持多音色 TTS 为不同嫌疑人配音,审讯历史自动压缩防止上下文溢出,案件生成后自动验证逻辑自洽性。支持存...

Registry SourceRecently Updated
2401Profile unavailable