video-translate
它能做什么
这项技能把视频发送到 HeyGen,制作出新语言的翻译配音版本。适合希望让说其他语言的观众也能观看同一段视频的人。
适用场景
- ✓当你希望把视频配音为西班牙语或其他语言时。
- ✓当你只需要翻译音频,而不需要口型同步时。
- ✓当你已有一段视频,并希望制作多个语言版本时。
技能链接
https://github.com/calesthio/OpenMontage/blob/main/.agents/skills/video-translate/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我的产品视频翻译成西班牙语,并保持口型与台词对应。”
每周 5 个新技能,1 分钟读完。
工作原理
你提供视频链接和目标语言。智能体会启动翻译任务,等待完成,然后把翻译后视频的链接交给你。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Video Translation (HeyGen)
Translate and dub existing videos into multiple languages, preserving lip-sync and natural speech patterns. Provide a video URL or HeyGen video ID — no need to create the video on HeyGen first.
Authentication
All requests require the X-Api-Key header. Set the HEYGEN_API_KEY environment variable.
curl -X POST "https://api.heygen.com/v2/video_translate" \
-H "X-Api-Key: $HEYGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"video_url": "https://example.com/video.mp4", "output_language": "es-ES"}'
Default Workflow
- Provide a video URL or HeyGen video ID
- Call
POST /v2/video_translatewith the target language - Poll
GET /v2/video_translate/{translate_id}until status iscompleted - Download the translated video from the returned URL
Creating a Translation Job
Request Fields
| Field | Type | Req | Description |
|---|---|---|---|
video_url |
string | Y* | URL of video to translate (*or video_id) |
video_id |
string | Y* | HeyGen video ID (*or video_url) |
output_language |
string | Y | Target language code (e.g., "es-ES") |
title |
string | Name for the translated video | |
translate_audio_only |
boolean | Audio only, no lip-sync (faster) | |
speaker_num |
number | Number of speakers in video | |
callback_id |
string | Custom ID for webhook tracking | |
callback_url |
string | URL for completion notification |
Either video_url or video_id must be provided.
curl
curl -X POST "https://api.heygen.com/v2/video_translate" \
-H "X-Api-Key: $HEYGEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"video_url": "https://example.com/original-video.mp4",
"output_language": "es-ES",
"title": "Spanish Version"
}'
TypeScript
interface VideoTranslateRequest {
video_url?: string;
video_id?: string;
output_language: string;
title?: string;
translate_audio_only?: boolean;
speaker_num?: number;
callback_id?: string;
callback_url?: string;
}
interface VideoTranslateResponse {
error: null | string;
data: {
video_translate_id: string;
};
}
async function translateVideo(config: VideoTranslateRequest): Promise<string> {
const response = await fetch("https://api.heygen.com/v2/video_translate", {
method: "POST",
headers: {
"X-Api-Key": process.env.HEYGEN_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify(config),
});
const json: VideoTranslateResponse = await response.json();
if (json.error) {
throw new Error(json.error);
}
return json.data.video_translate_id;
}
Python
import requests
import os
def translate_video(config: dict) -> str:
response = requests.post(
"https://api.heygen.com/v2/video_translate",
headers={
"X-Api-Key": os.environ["HEYGEN_API_KEY"],
"Content-Type": "application/json"
},
json=config
)
data = response.json()
if data.get("error"):
raise Exception(data["error"])
return data["data"]["video_translate_id"]
Supported Languages
| Language | Code | Notes |
|---|---|---|
| English (US) | en-US | Default source |
| Spanish (Spain) | es-ES | European Spanish |
| Spanish (Mexico) | es-MX | Latin American |
| French | fr-FR | Standard French |
| German | de-DE | Standard German |
| Italian | it-IT | Standard Italian |
| Portuguese (Brazil) | pt-BR | Brazilian Portuguese |
| Japanese | ja-JP | Standard Japanese |
| Korean | ko-KR | Standard Korean |
| Chinese (Mandarin) | zh-CN | Simplified Chinese |
| Hindi | hi-IN | Standard Hindi |
| Arabic | ar-SA | Modern Standard Arabic |
Translation Options
Basic Translation (with lip-sync)
const config = {
video_url: "https://example.com/original.mp4",
output_language: "es-ES",
title: "Spanish Translation",
};
Audio-Only Translation (faster, no lip-sync)
const config = {
video_url: "https://example.com/original.mp4",
output_language: "es-ES",
translate_audio_only: true,
};
Multi-Speaker Videos
const config = {
video_url: "https://example.com/interview.mp4",
output_language: "fr-FR",
speaker_num: 2,
};
Advanced Options (v4 API)
For more control over translation:
interface VideoTranslateV4Request {
input_video_id?: string;
google_url?: stri
常见问题
视频必须先上传到 HeyGen 吗?
不需要。这项技能说明,你可以提供视频 URL,或已有的 HeyGen 视频 ID。
如果我只想更换声音呢?
这项技能列出了一个仅音频选项,它会跳过口型同步,运行速度更快。
需要做哪些设置?
需要在 HEYGEN_API_KEY 设置中保存 HeyGen API 密钥。
详情
作者的原始描述
Translate and dub existing videos into multiple languages using HeyGen. Use when: (1) Translating a video into another language, (2) Dubbing video content with lip-sync, (3) Creating multi-language versions of existing videos, (4) Audio-only translation without lip-sync, (5) Working with HeyGen's /v2/video_translate endpoint.
repo: calesthio/OpenMontage
热度
- GitHub 星标
- 75k
- 排名
- #2699
- 许可证
- AGPL-3.0
- 更新时间
- 2026/10/28
评论
- …