Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计通过

video-subtitle-generator视频字幕生成器

Agent Skill

用于辅助视频生成、动画合成、脚本化剪辑或 Remotion 等视频项目开发。它适合让 Agent 组织镜头、生成素材说明、维护合成代码或排查渲染问题。使用时需要确认分辨率、时长、素材路径和导出格式;涉及外部素材、人物肖像或商业发布时,应先核对版权授权和内容审核要求。

总安装

9,102

周安装

387

GitHub Stars

1

下载量

3,189
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:video-subtitle-generator(视频字幕生成器)
来源仓库:https://github.com/jianhua-cui/video-subtitle-generator
安装命令:
openclaw skills install video-subtitle-generator
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install video-subtitle-generator

简介

结合 WhisperX 与 LLM 实现字幕生成与多语种翻译。

  • 适用于外语视频本地化与跨语言传播需求。video-subtitle-generator 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 上传视频,选择目标语言,输出 .srt 格式字幕文件。
  • 支持中英日韩等主要语种互译与时间轴对齐。
  • 翻译质量依赖源语言清晰度,模糊音频可能影响准确率。

SKILL.md

name
video-subtitle-generator
description
Generate and translate video subtitles using WhisperX and LLM translation. Use when processing video files to create .srt subtitle files. Supports multilingual transcription (auto-detect source language), translation to any target language, and bilingual subtitle generation.

Video Subtitle Generator

Multilingual video subtitle generation and translation toolkit built on WhisperX.

Features

  • Speech transcription: Extract audio from video and transcribe it into subtitles with automatic source language detection
  • Multilingual translation: Translate subtitles from any source language into a configurable target language
  • Bilingual subtitles: Generate source + target bilingual subtitles

Prerequisites

  • Python 3.9+
  • ffmpeg (required by WhisperX for audio extraction)
# macOS
brew install ffmpeg

# Ubuntu / Debian
sudo apt install ffmpeg

# Windows (Chocolatey)
choco install ffmpeg

# Windows (Scoop)
scoop install ffmpeg

Resource requirements

Before running, confirm the user is aware of the following costs:

ResourceDetails
Diskffmpeg ~80 MB; Python packages (torch, whisperx, etc.) 2–5 GB; Whisper model weights 39 MB – 1.5 GB depending on model size
CPU / GPUWhisperX runs model inference locally. A CUDA GPU is strongly recommended for medium and large models. CPU and Apple MPS also work but are significantly slower
Network / APITranslation step calls a remote LLM API and incurs token-based charges. No network is needed for the transcription step once the model is downloaded

Always confirm with the user before installing packages or downloading models, as these operations consume storage and bandwidth.

Translation requires an LLM API and will incur costs. Before executing the translation step:

  1. Ask the user for the API provider, key, and base URL — or present any auto-discovered configuration for review
  2. Inform the user that translation calls a remote LLM and will consume tokens (i.e. real money)
  3. Do NOT proceed with translation until the user explicitly confirms the provider and acknowledges the cost

Usage

1. Environment setup

# Install dependencies (requires ~2–5 GB disk space for PyTorch and WhisperX)
pip install -r requirements.txt

# Set the API key (used for translation)
# macOS / Linux
export OPENAI_API_KEY="your-api-key"
export OPENAI_BASE_URL="https://openrouter.ai/api/v1"  # Optional, defaults to OpenRouter

# Windows (PowerShell)
$env:OPENAI_API_KEY="your-api-key"
$env:OPENAI_BASE_URL="https://openrouter.ai/api/v1"
On Windows, use python instead of python3 in all commands below.

2. Transcribe video (auto-detect language)

python3 scripts/transcribe.py "/path/to/video.mp4" -o ./output -m small

Output: video.{detected_lang}.srt (e.g. video.en.srt, video.ja.srt)

Arguments:

  • -o: Output directory
  • -m: Model size (tiny, base, small, medium, large)
  • -d: Device (cuda, cpu, mps), auto-detected by default
  • -l: Force source language code (e.g. en, ja, zh). Auto-detect if omitted

3. Batch-process a directory

python3 scripts/transcribe.py "/path/to/video/folder" -o ./output -m small

4. Translate subtitles

Cost warning: This step calls a remote LLM API. Ensure the user has confirmed the API provider, key, and billing awareness before running.
# Translate to Chinese (default)
python3 scripts/translate.py ./output -o ./translated

# Translate to Japanese
python3 scripts/translate.py ./output -o ./translated -t ja

# Only generate bilingual subtitles
python3 scripts/translate.py ./output -o ./translated --bilingual

Arguments:

  • -t, --target-lang: Target language code (default: zh)
  • --bilingual: Generate bilingual (source + target) subtitles
  • --target-only: Generate target-language-only subtitles
  • --model: Translation model (default: google/gemini-3-flash-preview)
  • --batch-size: Batch size (default: 10)

When neither --bilingual nor --target-only is specified, both are generated.

5. Run the full pipeline

python3 scripts/run.py

# Customize via environment variables
VIDEO_DIR="/path/to/videos" TARGET_LANG=en python3 scripts/run.py

Environment variables for run.py:

  • VIDEO_DIR: Video source directory (default: ./videos)
  • OUTPUT_DIR: Transcription output directory (default: ./output)
  • TRANSLATED_DIR: Translation output directory (default: ./translated)
  • TARGET_LANG: Target language code (default: zh)
  • WHISPER_MODEL: Whisper model size (default: medium)

Model selection

ModelSizeSpeedAccuracyBest for
tiny39 MBFastestFairQuick tests
base74 MBFastGoodReal-time usage
small244 MBMediumGoodRecommended
medium769 MBSlowerVery goodHigher quality
large1550 MBSlowBestProfessional use

Output files

For each video, the tool generates:

  • *.{lang}.srt - Source-language subtitles (language auto-detected, e.g. video.en.srt)
  • *.json - Full transcription data with timestamps
  • *.bilingual.srt - Bilingual subtitles (source + target) after translation
  • *.{target}.srt - Target-language-only subtitles after translation (e.g. video.zh.srt)

Script overview

scripts/transcribe.py

Uses WhisperX for transcription and supports:

  • Automatic source language detection (or manual override via -l)
  • Timestamp alignment
  • Batch processing with model reuse across files

scripts/translate.py

Uses an LLM API to translate subtitles and supports:

  • Configurable target language (-t)
  • Batch translation for better efficiency
  • Bilingual or target-language-only output
  • Custom models and API endpoints
  • Automatic retry with exponential backoff on API failures

scripts/run.py

Cross-platform one-command runner that executes the transcription and translation pipeline automatically. Paths, target language, and model size are configurable via environment variables.

适合场景

01

调用多模型

02

代码和文本生成

03

Agent 推理流程

04

OpenRouter 模型接入

能力概览

能力 1

统一调用多种 LLM

能力 2

支持 Claude、Gemini、Kimi 等模型

能力 3

适合聊天、代码和推理任务

能力 4

可作为 Agent 模型调用入口

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

97.03%
按下载量换算3,094

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills