pyvideotrans README

项目的 README,来自 github.com/jianchang512/pyvideotrans。合并为一个 markdown 文件:README.md。

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
apixo-card-mcp-en APIXO AI: All-in-One AI Video Maker & Multimodal Creation Platform
Create video covers and illustrations with Seedream 5.5 to help your localized content stand out. Seedream 5.5 image API: limited-time 30% off, output images from $0.014 each (rates vary by output size; input images billed separately).
Create online or connect through API and MCP → to fit your workflow.
模真真 Mozhenzhen 模真真 Mozhenzhen: 买 AI 别花冤枉钱!比价、验真、查降智免费查
Stop overpaying for AI — compare prices & verify models free at mozhenzhen.com

A Powerful Open Source Video Translation / Audio Transcription / AI Dubbing / Subtitle Translation Tool

中文 | Documentation | Online Q&A | Edit Document

License Python Platform

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.

image

Core Features

Technical Architecture and Principles


Quick Start (Windows Users)

We provide a pre-packaged .exe version for Windows 10/11 users, requiring no Python environment configuration.

  1. Download: Click to download the latest pre-packaged version
  2. Unzip: Extract the compressed file to a path without Chinese characters or spaces (e.g., D:\pyVideoTrans).
  3. Run: Double-click sp.exe inside 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

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.net and WebUI are 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"

CLI documentation with all parameters

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

WebUI documentation

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

AMD GPU acceleration via Whisper.NET


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 / OpenAIChatGPT Supports context understanding, more natural translation
MiniMax/Zhipu/Xiaomi/Gemini latest flagship model, OpenAI-compatible
Google / Microsoft Traditional machine translation, fast speed
HY-MT2 / 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 / ElevenLabs High-quality commercial API

Documentation & Support

Disclaimer

The folders moss_transcribe_diarize | mosstts | confuciustts | external within the videotrans directory contain integrated third-party code. Please refer to the corresponding README.md for the relevant protocol. If not needed, they can be deleted

Acknowledgements

This project mainly relies on the following open-source projects (partial):


Created by jianchang512

pyvideotrans (jianchang512/pyvideotrans)

正在搜索数据库…

这是什么东西?一个开源的视频翻译配音工具:通过语音识别、字幕翻译、TTS 配音和视频合成的一键式流程,把视频从一种语言转换成另一种语言。
它是桌面程序、命令行工具还是网页服务?三种合一:基于 PySide6 的桌面图形界面、用于无界面批量处理的命令行工具,以及可在浏览器里远程访问的 WebUI——另外还提供 Docker 方式进行容器化部署。
怎么把它跑起来?在 Windows 10/11 上,下载打包好的 .exe——不需要 Python——解压后双击 sp.exe 即可。在 macOS/Linux 上(或作为开发者),安装 Python 3.10 和 FFmpeg,克隆仓库后用 uv 完成配置。
需要 API 密钥吗,能不能完全离线使用?本地使用不需要密钥:Faster-Whisper 在本地运行,Ollama 或 M2M100 可以完全离线翻译,Edge-TTS 免费。只有选择 OpenAI、DeepSeek 或 Azure 等在线渠道时才需要 API 密钥。从源码安装还需要把 FFmpeg 加入 PATH。
安装之前有什么坑要注意?Windows 版必须解压到不含中文或空格的路径,并通过 sp.exe 启动——不能直接在压缩包里运行。GPU 加速还需要 CUDA 12.8 和 cuDNN 9.11。
它是免费的吗?我可以用它翻译有版权的视频吗?它采用 GPL-3.0 协议,免费且仅供非商业用途。README 提醒,任何法律后果由你自行承担,包括调用第三方 API 或处理有版权的视频内容所产生的后果。
它能用我的 NVIDIA 或 AMD 显卡吗?可以——NVIDIA 显卡需要安装支持 CUDA 的 PyTorch 版本(需要 CUDA 12.8 + cuDNN 9.11),AMD 显卡则通过 Whisper.NET 获得支持。
除了翻译整个视频,它还能做什么?它还是一套多媒体工具箱:支持批量把音频/视频转成带说话人分离的 SRT 字幕、人声分离、视频与字幕合并、音视频对齐以及字幕文本匹配。
可以接入哪些 AI 模型和服务?语音识别:Faster-Whisper(推荐本地使用)、WhisperX、Parakeet、阿里通义千问(Alibaba Qwen)、Azure、Google。翻译:DeepSeek、ChatGPT、Claude、Gemini、Ollama、Google/微软机器翻译。配音:Edge-TTS、F5-TTS、CosyVoice、GPT-SoVITS、ChatTTS、OpenAI、Azure。
在它配音之前,我能先校对翻译吗?可以——流程可以在每个阶段(识别、翻译、配音)暂停,让你先人工校对和修改,再继续下一步。
支持声音克隆和多人配音吗?都支持:视频里不同的说话人可以使用不同的 AI 音色,F5-TTS、CosyVoice 或 GPT-SoVITS 提供零样本声音克隆——这些克隆模型需要本地部署。
大小
488.5 MB
星标
19.9K
时长
3年
提交 · 90 天