Lingsheng Workshop Video Dubbing: Running a TTS Voiceover and Subtitle Synthesis Pipeline with Agents

Introduction

Common pain points for instructional videos and operational demos include: segmenting voiceovers to match the visuals, aligning speech speed with shot pacing, avoiding cluttered full-screen subtitles, and switching between “AI Dubbing” and “Original Audio Demo.” Manually aligning tracks in video editing software involves numerous steps and frequent rework.

Below, we introduce Smart Dubbing Studio (smart-dubbing-studio) available on SkillHub. It operates on a workflow defined by the standard SKILL.md convention: the Agent interacts via dialogue to collect asset paths, detect the local environment, and select a TTS engine, then executes pipeline.py with a single click to output a finished video with subtitles. SkillHub categorizes it under design-media; community ratings are approximately 98768 with around 782 downloads (subject to SkillHub display). The Skill package version is 1.0.7, and the author listed on the Skill page is Shengtong Education - Zhang Wei.

What is this

Smart Dubbing Studio is an intelligent dubbing and subtitle synchronization Skill designed for “Source Video + Timeline Dubbing Templates.” The official summary highlights: Support for TTS voice generation, adaptive speech rate acceleration, automatic identification and filling of silent segments, sentence-level subtitle precision, and one-click output of the final video.

It is maintained and distributed on SkillHub; the identifier for store retrieval is @indiv-zhangwei/smart-dubbing-studio (some page links may still use the user_a5827f21 path). The pipeline within the documentation refers to itself as Video Subtitle Synthesis V3.7.x, which exists alongside the SkillHub package version 1.0.7; treat these as separate fields.

Core Functions

The following capabilities are derived from the SKILL.md and scripts/ pipeline within the skill package and can be reproduced step-by-step.

Fixed Program + Dialogue Guidance

Upon loading the skill, the Agent follows the documentation to confirm the Source Video Path and Subtitle/Dubbing Template Path (.md) with the user. If no template is available, the built-in template can be copied:

python <skill_directory>/scripts/copy_template.py --to-dir <user_project_directory>

Six-Step Pipeline

The Agent copies scripts/ to the user’s project directory as _scripts/, generates a job.yaml, and executes:

python _scripts/pipeline.py --job job.yaml

The sequence is: 01_check (Parse Template) → 02_cut (Split Video) → 03_tts (Dubbing) → 04_align (Alignment, including silence filling and video acceleration if necessary) → 05_merge (Audio-Visual Composition) → 06_finalize (Inject Subtitles). If it fails, you can:

python _scripts/pipeline.py --job job.yaml --resume-from <step_name>

To redo only the subtitles:

python _scripts/pipeline.py --job job.yaml --resume-from 06_finalize

TTS Engines

  • iFlytek Spark (spark): Requires APPID, APIKey, APISecret, and a Spark WS URL, written to local tts_config.json (documentation suggests adding this to .gitignore).
  • edge-tts: Free backup option; pip install edge-tts==7.2.8; optional voices such as zh-CN-XiaoxiaoNeural are available.

Templates and Segment Types

The template is a Markdown table: | Start Time | End Time | Text Content |. Time formats support MM:SS, MM:SS,FF (SMPTE frames), and MM:SS.mmm.

  • Normal Text: AI TTS Dubbing.
  • Blank Row: filler, retains original video audio.
  • (Silence) / [Silence] / (Silence): filler_silent, generates silence.

Supports backticks ` to control TTS phrasing and {tts:...} to override the spoken text without altering the subtitle display; the iFlytek path supports sentence-level SRT (relies on word-level timestamps).

Subtitle Template Editor

The skill includes tools/subtitle-editor.html: Drag a video into the browser, paste numbered copy, use the F key to mark the timeline (clapper), and export a .md template with one click. This is ideal for users who prefer not to write timecodes manually.

Environment Dependencies

env_check.py checks for ffmpeg, Python 3.7+, etc.; selecting iFlytek requires websocket-client==1.8.0. Refer to the comparison table in SKILL.md for handling missing items.

Installation and Activation

Please read the official SkillHub instructions before installing: skillhub.cn/install/skillhub.md.

1. Install SkillHub CLI (If not installed)

command -v skillhub && skillhub --version

If not installed, run the full installation script (recommended by documentation):

curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash

2. Install this Skill

It is mandatory to use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ and may not be recognized.

skillhub search smart-dubbing
skillhub install smart-dubbing-studio --namespace indiv-zhangwei --dir <skills_directory>

Common path examples (depending on your client):

  • Cursor: ~/.cursor/skills/
  • Claude Code: ~/.claude/skills/
  • Codex: ~/.codex/skills/ or .agents/skills/ under the project

The SkillHub page also provides “Installation Tips for AI”: Install @user_a5827f21/smart-dubbing-studio via skillhub.cn/install/skillhub.md. If the webpage shows the Skill as offline, you can still install using @indiv-zhangwei/smart-dubbing-studio found via CLI search (verified working via skillhub install on 2026-10-21).

Restart or reload the Agent after installation to activate SKILL.md.

Typical Usage

With the installation complete, you can operate directly via dialogue following the skill documentation. Below is a reproducible main path (commands are executed by the Agent; the user mainly provides paths and TTS selection).

  1. User provides source video and template, e.g., demo.mp4 and script.md.
  2. Agent runs environment detection:
python _scripts/env_check.py --output env.json
  1. After the user selects the engine and voice, the Agent generates job.yaml (sample structure):
video: "/path/to/demo.mp4"
template: "/path/to/script.md"
voice: "x5_lingxiaotang_flow"
engine: "spark"
output_root: "output"
env_file: "env.json"
tts_config: "tts_config.json"

If using edge-tts, set engine to edge and omit or clear tts_config.

  1. Agent executes the pipeline and reports progress; the final product path looks like:
output/{task_id}/06_final/final_with_subs_xxx.mp4

Template table example (excerpted from skill documentation):

| Start Time | End Time | Text Content |
|----------|----------|----------|
| 00:00 | 00:02 | This video will explain how to make an advanced pen holder. |
| 00:02 | 00:03,17 | First, make the base by selecting a cylinder. |

Applicable Scenarios and Notes

Target Audience: Teams or individuals needing to batch produce Chinese narration videos, micro-courses, or software demo voiceovers; those who want the Agent to run ffmpeg + TTS scripts to reduce manual track alignment.

Limitations and Notes:

  • Depends on local ffmpeg and Python environment; the iFlytek solution requires you to activate and secure credentials at console.xfyun.cn.
  • tts_config.json contains keys; do not commit to public repositories.
  • Under edge-tts, “sentence-level SRT” may fall back to segment-level subtitles (documentation notes that word-level timestamps primarily come from iFlytek).
  • The official API page https://api.skillhub.cn/user_a5827f21/smart-dubbing-studio returns 405 for GET requests; some SkillHub web detail pages may show “Offline”. Use the SKILL.md inside the CLI-fetched package for installation and documentation.

Conclusion

Smart Dubbing Studio consolidates “Splitting, TTS, Alignment, Composition, and Subtitles” into an Agent-executable pipeline, complete with a clapper-style template editor, making it ideal for handing repetitive tasks over to conversational automation. To view the store entry or installation guide, visit the official SkillHub address: https://api.skillhub.cn/user_a5827f21/smart-dubbing-studio, and complete installation with https://skillhub.cn/install/skillhub.md.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye