Design & media

Video Subtitle Translation & Dubbing

Try it

Multi-language video subtitle translation and automatic dubbing skill (supports English, Chinese, Japanese, Spanish, French, German, Korean, etc.).

What it does

Multi-language video subtitle translation and automatic dubbing skill (supports English, Chinese, Japanese, Spanish, French, German, Korean, etc.).

The skill document

video-subtitle-translation-dubbing

[English] | 简体中文

OpenClaw Skill — Multi-language video subtitle translation and automatic dubbing, producing high-quality multi-track, multi-subtitle videos on demand.

  • Name: video-subtitle-translation-dubbing
  • Version: 0.1.3
  • Entrypoint: translation_dubbing_skill.run
  • Manifest: manifest.yaml

Overview

This skill processes input videos (via external subtitles or by auto-extracting embedded subtitle tracks) and produces:

  • An independent translated target-language subtitle file (UTF-8 SRT/VTT)
  • A muxed .mkv video file

Callers select one of two processing modes via processing_mode:

Processing ModeTTSAudio TrackSubtitle Tracks
subtitle_onlySkippedSource audio track only (default)Target subtitle (default) + Source subtitle
subtitle_and_dubbing (default)Synthesizes target voiceoverTarget dubbing (default) + Source audioTarget subtitle (default) + Source subtitle

Quick Start

from translation_dubbing_skill import parse_manifest, run

params = parse_manifest({
    "video_path": "/path/to/input.mp4",
    "subtitle_path": "/path/to/input.en.srt",   # Optional
    "source_language": "en",
    "target_language": "zh-CN",
    "processing_mode": "subtitle_and_dubbing",
    "translation_provider": "llm",
    "translation_endpoint": "https://api.example.com/v1/chat/completions",
    "translation_credential": "sk-...",
    "translation_config": {"model_name": "gpt-4o-mini"},
    "tts_provider": "edge",
    "tts_endpoint": "none",
    "tts_credential": "none",
})

result = await run(params)
print(result.output_video_path, result.output_subtitle_path)

Inputs

FieldTypeRequiredDescription
video_pathpathYesInput video file path (extension must be in supported_video_formats)
subtitle_pathpathNoExternal subtitle file (.srt / .vtt); extracts embedded track if omitted
source_languagestringYesSource video/subtitle language code (default en)
target_languagestringYesTarget translation/TTS language code (default zh-CN)
processing_modeenumYessubtitle_only | subtitle_and_dubbing (default)
voice_idstringNoTTS voice identifier; ignored in subtitle_only mode
translation_providerenumYesllm | web
translation_endpointstringYesHTTP endpoint for translation service
translation_credentialsecretYesAPI key / credential (desensitized as *** in logs/errors)
translation_configobjectNoCustom translation provider configuration
translation_rate_limitobjectNoAdaptive scheduler configuration (batch/payload/concurrency)
tts_providerenumConditionalllm | web | edge; required when mode is subtitle_and_dubbing
tts_endpointstringConditionalHTTP endpoint for TTS service
tts_credentialsecretConditionalAPI key / credential for TTS service
tts_configobjectNoCustom TTS provider configuration
tts_rate_limitobjectNoAdaptive scheduler configuration for TTS

For full parameter definitions and defaults, see manifest.yaml.

Outputs

FieldTypeDescription
output_video_pathpathPath to the synthesized .mkv video
output_subtitle_pathpathPath to the translated target-language UTF-8 subtitle file

Output Video Track Structure

subtitle_and_dubbing mode:

streams:
  video:  video  (codec copy, preserving resolution/fps/encoding)
  audio:  target (AAC, language=target, default=1, title="Target Dubbing")
          source (copy, language=source, default=0, title="Original Audio")
  subs:   target (SRT, language=target, default=1, title="Target Subtitle")
          source (SRT, language=source, default=0, title="Original Subtitle")

subtitle_only mode:

streams:
  video:  video  (codec copy)
  audio:  source (copy, language=source, default=1)
  subs:   target (SRT, language=target, default=1)
          source (SRT, language=source, default=0)

Progress Reporting

The skill reports progress stage-by-stage via the progress callback injected by the OpenClaw runtime:

parsing → translating → [tts] → muxing → done
  • translating stage includes completed / total counts (monotonic non-decreasing)
  • tts stage occurs only in subtitle_and_dubbing mode and also reports progress counts
  • done stage returns output_video_path / output_subtitle_path in extra

Pluggable Providers

Built-in providers (auto-registered via @register upon module loading):

KindProvider TypeDescription
translationllmInvokes LLM chat completion endpoints with batch JSON payloads
translationwebInvokes 3rd-party translation REST APIs
ttsllmInvokes LLM TTS endpoints (supports batching)
ttswebInvokes 3rd-party TTS REST APIs (single item)
ttsedgeInvokes built-in Microsoft Edge Read-Aloud TTS service

New providers can be added by implementing the protocol under translation_dubbing_skill.providers.{translation,tts} and decorating with @register(kind, provider_type). No caller code changes required.

Adaptive Scheduler

Translation and TTS requests are driven by AdaptiveScheduler, featuring 3D adaptive tuning:

  • Batch Size (batch_size): Number of entries per request
  • Payload Size (payload_size): Text length measured in tokens or characters
  • Concurrency (concurrency): Number of simultaneous in-flight requests

Uses AIMD strategy: scales up on consecutive successes; scales down on 429 (RateLimitError) with exponential backoff; reduces payload_size and re-slices without penalty on 413 / context window overflow (PayloadTooLargeError); retries with backoff on 5xx / timeouts (TransientError).

Default parameters are specified in manifest.yaml under translation_rate_limit / tts_rate_limit.default.

Error Handling

All exceptions inherit from SkillError, carrying a stage / code / reason / context tuple. Sensitive keys (credential / api_key / authorization) are automatically masked as *** during to_dict() serialization.

Prerequisites

  • Python ≥ 3.11
  • ffmpeg / ffprobe: Must be available in PATH. Used for subtitle extraction, audio time-stretching, video muxing, and media probing.
  • httpx: HTTP client
  • pydub: Audio segment manipulation and peak normalization
  • PyYAML: Manifest parsing

License

See LICENSE and pyproject.toml in the repository root.

Related skills

Use when user asks to translate videos, dub video content, or localize videos into other languages. Translate videos with AI-powered dubbing using iFlytek (X...

3 installs

Create multilingual voice-over audio from prepared scripts for videos, product launches, e-learning, training libraries, creator content, and international campaigns. This AI multilingual dubbing workflow organizes every market and segment, helps choose a locale-ready voice, pilots pronunciation and timing, and delivers reviewable narration by language. Use it for AI video dubbing audio, AI video translation audio, video localization voice-over, training video localization, global marketing narration, text to speech in multiple languages, or Chinese, English, and Japanese dubbing. Receive narration tracks organized by language, market, and segment, ready for localization editing, lip-sync production, training libraries, and campaign assembly.

Use when the user needs video/audio/subtitle translation, material and task management, script editing, or export via VMEG in an AI coding assistant or OpenClaw agent. Requires VMEG Remote MCP (OAuth or vmeg_sk API Key). Tool usage follows MCP server instructions.

1 installs2 stars

Download a foreign-language movie/video (or take a local file), transcribe and translate it to English with WhisperX, and recreate the video with English subtitles. Use on requests like "get English subs for this", "translate this movie", "subtitle this YouTube film". Fully local: yt-dlp → WhisperX → ffmpeg.

video translation, video dubbing, subtitle translation, translate video to Chinese, add subtitles to video, AI dubbing, srt translation, 视频翻译, 视频配音, 字幕翻译 — transcribes a video with word-level timings, translates the subtitles, then burns them in and optionally lays down a fitted dub track. Composes the dlazy fun-asr, LLM and TTS tools with ffmpeg locally; delivers a finished mp4 plus srt files, not a script.

Transcribe audio and video with the DaDaScribe AI service (YouTube URLs, direct links, or local files). Supports 100+ languages, speaker diarization with named speakers, translation to up to 5 languages, and returns .txt transcripts plus .srt subtitles. Use whenever the user asks to transcribe, capt