explaingit

zbjincheng/openclaw-skill-videotranslate

13PythonAudience · developerComplexity · 3/5Setup · moderate

TLDR

An OpenClaw plugin that translates video subtitles and optionally dubs the audio track into a target language, with a smart scheduler that handles API rate limits automatically for long videos.

Mindmap

mindmap
  root((repo))
    What It Does
      Video subtitle translation
      Audio dubbing option
      Multi-language output
    Two Modes
      Subtitle only mode
      Full dubbing mode
    Smart Scheduling
      3D Adaptive Scheduler
      Rate limit backoff
      Batch size control
    Output Format
      MKV lossless container
      Two audio tracks
      Two subtitle tracks
    Tech Stack
      Python
      ffmpeg
      LLM translation API
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Translate a video's subtitle file from one language to another and embed both the original and translated tracks in the output video.

USE CASE 2

Add a dubbed audio track to a video by generating timed speech from the translated subtitles, packaged with the original audio as a second track.

USE CASE 3

Process long videos through translation and text-to-speech APIs without job failures caused by rate limits, using the built-in adaptive scheduler.

Tech stack

PythonffmpegOpenClawpytestMKV

Getting it running

Difficulty · moderate Time to first run · 30min

Requires ffmpeg installed on your system plus API credentials for a translation service and a text-to-speech service.

In plain English

This is a plugin for OpenClaw, an AI workflow framework, that translates video subtitles and optionally replaces the audio track with a dubbed version in the target language. It is written in Python and requires ffmpeg to be installed on your system. The plugin has two modes. In subtitle-only mode, it translates the subtitle file from the source language to the target language, embeds both the original and translated subtitle tracks in the output video, and writes a standalone subtitle file. In the default dubbing mode, it also generates spoken audio in the target language by calling a text-to-speech service, stretches or compresses each audio clip so it fits within the timing of the original subtitle, and packages everything into a single video file with two audio tracks and two subtitle tracks, defaulting to the translated versions. Because translating and generating speech for a long video involves sending many requests to AI and speech APIs, the plugin includes a scheduling system it calls the 3D Adaptive Scheduler. This system monitors three things at once: how many subtitle lines to group into each request, how much text to include per request in terms of token or character count, and how many requests to send at the same time. When an API responds with a rate limit error, the scheduler backs off and retries with smaller batches. This avoids failing the whole job because of temporary API limits. You configure the plugin through a manifest file where you specify the video file, the source and target languages, which translation service and text-to-speech service to use, and the API credentials for those services. Both LLM-based endpoints and conventional web API endpoints are supported for translation and speech synthesis. The video output is a lossless MKV container that preserves the original video quality. Tests use pytest and a property-based testing library called hypothesis.

Copy-paste prompts

Prompt 1
I have an MP4 with Chinese subtitles and want to add English subtitles and a dubbed English audio track. Walk me through configuring the openclaw-skill-videotranslate manifest file with the right translation service and text-to-speech API credentials.
Prompt 2
My video translation job is failing partway through a long video because of API rate limit errors. How does the 3D Adaptive Scheduler detect a rate limit and adjust batch size and concurrency to recover without restarting the whole job?
Prompt 3
I want to produce subtitle-only output without dubbing for a short documentary. What manifest settings do I change to switch the plugin to subtitle-only mode, and what does the output MKV contain?
Open on GitHub → Explain another repo

← zbjincheng on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.