Multilingual video dubbing

From XuShuwenn/RedAct · View interactive version

Multilingual video dubbing is an AI agent skill from the GitHub repository XuShuwenn/RedAct. Create multilingual video dubbing with TTS, audio normalization to ITU-R BS.1770-4, and synced video output.

How to use this skill

Skill file

Multilingual Video Dubbing

When to Use

When to Use

Task-Specific Runtime Protocol

Critical Requirement

Input Files

Required Workflow

  1. Choose a TTS path only after confirming it works with local assets already present.
  2. Before writing a full generation script, verify the actual local TTS API and assets: import the package or run its CLI help, list available voices or languages if possible, and complete one minimal synthesis call with the exact voice, language, and settings you plan to use. Do not guess parameter names, language codes, or voice IDs from filenames, help text, or cache contents alone.
  3. Use /root/reference_target_text.srt as the TTS text source for dubbed speech; use /root/source_text.srt only for source-language understanding and context, not as text to translate again during dubbing.
  4. Run a tiny smoke test first using the actual delivery path: synthesize one very short utterance from the provided target-language content and prove you can produce /outputs/tts_segments/seg_0.wav as a readable 48000 Hz mono WAV.
  5. Do not write orchestration scripts or launch a full multi-segment run until that smoke test has executed successfully and the file has been probed as readable.
  6. The smoke-tested path must include all core stages on one short sample: synthesize target-language speech, convert or resample to 48 kHz mono WAV if needed, place it at the subtitle start time, mux a playable /outputs/dubbed.mp4, run a real loudness measurement, and generate a schema-valid /outputs/report.json.
  7. Validate that minimal end-to-end path before scaling up.
  8. As soon as one acceptable TTS path works, stop retrying alternative engines unless the result is unusable.
  9. Treat a readable target-language segment WAV as the pivot point: immediately complete resample or mono conversion, timeline placement, loudness normalization, muxing, and /outputs/report.json before attempting any optional engine comparison.
  10. If a synthesis command times out, hangs, writes an empty file, produces an unreadable file, or cannot quickly list voices, load models, or produce a short sample, do not rerun the same path unchanged more than once. Make one meaningful mitigation first or switch to a materially different proven local method.
  11. If a candidate fallback is known to be robotic, synthetic, or otherwise below human-level quality, do not use it for final deliverables; stop and report the blocker instead of shipping non-compliant dubbed audio.
  12. Prefer direct available CLI or tool workflows for the first pass; add wrappers or broader automation only after the full pipeline is confirmed.
  13. If a tool is visibly available, try the simplest direct synthesis invocation for one short utterance before writing a Python wrapper around it.
  14. Inspect generated shell commands, ffmpeg invocations, and helper scripts before execution. If a command or file write looks truncated, malformed, or partially emitted, rewrite it before running.
  15. If any synthesis, ffmpeg, ffprobe, or loudness command returns an error, warning, or visibly truncated output, stop and verify the expected artifact immediately with test -s, ffprobe, or a readable parse before using it downstream.
  16. Fit each segment to its subtitle window using rate_adjust, pad_silence, or trim, then normalize and mux the final dubbed audio.
  17. Build the dubbed track on an absolute timeline from /root/segments.srt using silence insertion or offset-based mixing, not default sequential concat.
  18. After any duration-changing step on a segment or final mix, re-probe the written file and update all downstream timing from that probe before continuing.
  19. Use one verified timing basis throughout: subtitle windows from /root/segments.srt for target placement, and final probed delivered artifacts for actual placed_*, drift_sec, and duration values in /outputs/report.json.
  20. After any regeneration of /outputs/tts_segments/seg_0.wav, /outputs/dubbed.mp4, or /outputs/report.json, rerun final verification on those exact saved paths before finishing.
  21. Keep debugging bounded: every TTS investigation should either prove a working short sample quickly or be abandoned so the full delivery pipeline can continue.
  22. Do not stop at intermediate artifacts; finish all listed outputs.

Required Preflight

Required Preflight

Output Files

  1. /outputs/tts_segments/seg_0.wav: TTS audio (48000 Hz, Mono, human quality)
  2. /outputs/dubbed.mp4: Video with dubbed audio
  3. /outputs/report.json: Dubbing report

Execution Guardrails

Execution Guardrails

Audio Requirements

Timing Constraints

report.json Fields

{
  "source_language": "en",
  "target_language": "ja",
  "audio_sample_rate_hz": 48000,
  "audio_channels": 1,
  "original_duration_sec": 12.34,
  "new_duration_sec": 12.34,
  "measured_lufs": -23.0,
  "speech_segments": [...]
}

Use this top-level schema exactly. Do not replace it with custom keys such as workflow_metadata, video_info, audio_info, or segments.

Final Validation

Final Validation

Before declaring success, verify the delivered final files /outputs/dubbed.mp4 and /outputs/report.json, not intermediate renders.

Tips

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.