
pyVideoTrans
CLI视频翻译与配音一站式工具:串起语音识别、字幕翻译、多角色 AI 配音与音画合成,可接 Faster-Whisper、DeepSeek、Edge-TTS 等本地或在线模型;cli.py 支持无界面批处理。需要 FFmpeg。
pyVideoTrans
Sponsors Recall.ai Meeting Transcription API If you’re looking for a transcription API for meetings, consider checking out Recall.ai , an API that works with Zoom, Google Meet, Microsoft Teams, and more OfoxAI: Text, speech, image and video model APIs Access GPT, Claude, Gemini and DeepSeek text models, ElevenLabs speech models, and image and video generation models with one API key—choose the models that fit your creative needs. infistar - 160+ 模型,一个 Key infistar 是 OpenAI 兼容中转,一个 Key 随时切 160+ 模型,挑出翻得最准又最省的那个
A Powerful Open Source Video Translation / Audio Transcription / AI Dubbing / Subtitle Translation Tool
pyVideoTrans is dedicated to seamlessly converting videos from one language to another, offering a complete workflow that includes speech recognition, subtitle translation, multi-role dubbing, and audio-video synchronization. It supports both local offline deployment and a wide variety of mainstream online APIs.
Core Features
- Fully Automatic Video Translation: One-click workflow: Speech Recognition (ASR) → Subtitle Translation → Speech Synthesis (TTS) → Video Synthesis.
- Audio Transcription / Subtitle Generation: Batch convert audio/video to SRT subtitles, supporting Speaker Diarization to distinguish between different roles.
- ️Multi-Role AI Dubbing: Assign different AI dubbing voices to different speakers.
- Voice Cloning: Integrates models like F5-TTS, CosyVoice, GPT-SoVITS for zero-shot voice cloning.
- Powerful Model Support:
- ASR: Faster-Whisper (Local), OpenAI Whisper, Alibaba Qwen, ByteDance Volcano, Azure, Google, etc.
- LLM Translation: DeepSeek, ChatGPT, Claude, Gemini, MiniMax, Ollama (Local), Alibaba Bailian, etc.
- TTS: Edge-TTS (Free), OpenAI, Azure, Minimaxi, ChatTTS, ChatterBox, etc.
- ️Interactive Editing: Supports pausing and manual proofreading at each stage (recognition, translation, dubbing) to ensure accuracy.
- ️Utility Toolkit: Includes auxiliary tools such as vocal separation, video/subtitle merging, audio-video alignment, and transcript matching.
- Command Line Interface (CLI): Supports headless operation, convenient for server deployment or batch processing.
- Web Interface (WebUI): Browser-based interface for remote access or internal network deployment.
Quick Start (Windows Users)
We provide a pre-packaged .exe version for Windows 10/11 users, requiring no Python environment configuration.
- Download: Click to download the latest pre-packaged version
- Unzip: Extract the compressed file to a path without Chinese characters or spaces (e.g.,
D:\pyVideoTrans). - Run: Double-click
sp.exeinside the folder to launch.
Note:
- Do not run directly from within the compressed archive.
- To use GPU acceleration(NVIDIA GPU only), ensure CUDA 12.8 and cuDNN 9.11 are installed.
️ Source Deployment (macOS / Linux / Windows Developers)
We recommend using uv for package management for faster speed and better environment isolation.
1. Prerequisites
- Python: Recommended version 3.10
- FFmpeg: Must be installed and configured in the environment variables.
- macOS:
brew install libsndfile git python@3.10 brew uninstall --ignore-dependencies ffmpeg brew tap homebrew-ffmpeg/ffmpeg brew install homebrew-ffmpeg/ffmpeg/ffmpeg- Linux (Ubuntu/Debian):
sudo apt-get install ffmpeg libsndfile1-dev - Windows: Download FFmpeg and configure Path, or place
ffmpeg.exeandffprobe.exedirectly in the project directory.
2. Install uv (If not installed)
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
3. Clone and Install
git clone https://github.com/jianchang512/pyvideotrans.git
cd pyvideotrans
uv sync
By default,
whisper.netandWebUIare not installed locally.
- To install all optional channels:
uv sync --all-extras- To install whisper.net:
uv sync --extra dotnet- To install WebUI:
uv sync --extra webui
4. Launch Software
GUI:
uv run sp.py
CLI:
# Video Translation
uv run cli.py --task vtv --name "./video.mp4" --source_language_code zh-cn --target_language_code en --voice_role "en-US-GuyNeural"
# Audio to Subtitle
uv run cli.py --task stt --name "./audio.wav" --model_name large-v3
# Subtitle Translation
uv run cli.py --task sts --name "./subs.srt" --target_language_code en
# Text to Speech
uv run cli.py --task tts --name "./subs.srt" --voice_role "zh-CN-YunyangNeural"
WebUI (for remote/internal network access):
uv sync --extra webui
uv run webui.py
Docker (containerized deployment):
# Build
docker build -t pyvideotrans-webui .
# Run
docker run -d -p 7860:7860 --name pyvideotrans pyvideotrans-webui
# With persistent config and output
docker run -d -p 7860:7860 \
-v ./data/output:/app/output \
-v ./data/config:/app/videotrans \
--name pyvideotrans pyvideotrans-webui
5. (Optional) NVIDIA GPU Acceleration Configuration
If you have an NVIDIA graphics card, execute the following commands to install the CUDA-supported PyTorch version:
# Uninstall CPU version
uv remove torch torchaudio
# Install CUDA version (Example for CUDA 12.x)
uv add torch==2.7 torchaudio==2.7 --index-url https://download.pytorch.org/whl/cu128
uv add nvidia-cublas-cu12 nvidia-cudnn-cu12
Supported Channels & Models (Partial)
| Category | Channel/Model | Description |
|---|---|---|
| ASR (Speech Recognition) | Faster-Whisper (Local) | Recommended, fast speed, high accuracy |
| WhisperX / Parakeet | Supports timestamp alignment & speaker diarization | |
| Alibaba Qwen3-ASR / ByteDance Volcano | Online API, excellent for Chinese | |
| Translation (LLM/MT) | DeepSeek / ChatGPT | Supports context understanding, more natural translation |
| infistar AI | infistar - 160+ models, one Key, OpenAI compatible gateway, switch to 160+ models at any time with one Key | |
| Atlas Cloud | OpenAI-compatible gateway, one Key for DeepSeek, GLM, Kimi, Qwen, MiniMax and proxied vendor models | |
| MiniMax AI | MiniMax M3 LLM, latest flagship model, OpenAI-compatible | |
| Google / Microsoft | Traditional machine translation, fast speed | |
| Ollama / M2M100 | Fully local offline translation | |
| TTS (Speech Synthesis) | Edge-TTS | Microsoft free interface, natural effect |
| F5-TTS / OmniVoice / Qwen3-TTS | Supports Voice Cloning | |
| GPT-SoVITS / Index-TTS / ChatTTS | High-quality open-source TTS, requires local deployment | |
| 302.AI / OpenAI / Azure | High-quality commercial API |
Documentation & Support
- Official Documentation: https://pyvideotrans.com (Includes detailed tutorials, API configuration guides, FAQ)
- Online Q&A Community: https://bbs.pyvideotrans.com (Submit error logs for automated AI analysis and answers)
- GitHub Wiki: architecture.md | Add new Translator Channel | cli.md | webui.md | Synchronize.md | faq.md
Disclaimer
This software is an open-source, free, non-commercial project. Users are solely responsible for any legal consequences arising from the use of this software (including but not limited to calling third-party APIs or processing copyrighted video content). Please comply with local laws and regulations and the terms of use of relevant service providers.
Acknowledgements
This project mainly relies on the following open-source projects (partial):
- FFmpeg
- PySide6
- sherpa-onnx
- faster-whisper
- openai-whisper
- edge-tts
- F5-TTS
- Confucius4-TTS
- OmniVoice
- CosyVoice
- Gradio (WebUI)
Created by jianchang512
相關資源

VideoCaptioner
CLI卡卡字幕助手的命令行版:把课程、讲座、访谈视频转成字幕,再用大模型断句校对、翻译并烧录回视频。必剪识别与必应翻译免费可用,大模型优化需自备 API Key,需 Python 3.10–3.12。
WEIFENG2333/VideoCaptioner16.3k
Subaligner
CLI用神经网络把字幕与音视频自动对齐,还能用 Whisper 转写生成字幕、用本地模型翻译字幕,支持 SRT、TTML、SCC 等十多种格式。需 Python 3.9–3.12 与 FFmpeg,转写和翻译要另装 llm 扩展。
baxtree/subaligner511
YouTube Clipper Skill
Skill下载 YouTube 视频与字幕,由 AI 按内容划分几分钟粒度的语义章节,选段后精确剪辑、翻译成中英双语字幕并烧录,同时生成小红书、抖音等平台文案。依赖 yt-dlp 与带 libass 的 FFmpeg。
op7418/Youtube-clipper-skill2.2k
BaoCut Agent Skill
Skill宝玉开发的视频字幕工具 BaoCut 的官方技能:用自然语言让 Claude Code 或 Codex 转写音视频、生成并翻译字幕、校对说话人、调整时间线并导出 SRT 字幕与成片。需在 Apple 芯片的 Mac(macOS 14 及以上)安装 BaoCut 应用,Windows 可由技能自动下载预览版命令行。
JimLiu/baocut1k
FFsubsync
CLI按视频音轨自动校准字幕时间轴,修复译好的字幕与画面不同步的问题,也可以拿一份已对齐的字幕作参照。本地运行、无需账号,需先装好 Python 与 FFmpeg。
smacke/ffsubsync7.9k
Auto Synced & Translated Dubs
CLI根据已有 SRT 字幕把视频台词译成多种语言,再用 AI 语音逐句合成并按时间轴对齐,输出译文字幕和配音音轨,适合做多语种讲解视频。需要 Python、FFmpeg 及 Google Cloud、Azure、DeepL 或 ElevenLabs 的 API Key;在 ini 配置文件里填好路径与语言后运行 python main.py。
ThioJoe/Auto-Synced-Translated-Dubs1.8k