Skip to content

About

Translate the video from one language to another and embed dubbing & subtitles.

Topics

Resources

Stars

19.8k stars

Watchers

105 watching

Forks

Repository files navigation

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.
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.

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

  • 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.

  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

  • 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.exe and ffprobe.exe directly 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.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

  • License Scope: The Project code is open-sourced under GPL-V3. This license applies only to the Project code itself and does not apply to the local models integrated into the Project, third-party online APIs, or their outputs. When distributing modified versions or derivative works, please comply with the relevant obligations of GPL-V3.

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

  • Local Models: The local models integrated into the Project are each subject to their own independent licenses. Copyright and licensing conditions belong to their respective upstream authors or publishers. Before use (especially commercial use), please verify and comply with the applicable model licenses yourself.
  • Online APIs: The online APIs called by the Project require you to register, obtain authorization, and bear any fees yourself. Your use must comply with each provider's terms; please independently confirm whether the output can be used commercially.
  • Content Copyright: When processing videos, audio, subtitles, or other content, you must ensure that you have lawful rights or have obtained authorization. The developer does not claim rights over any input or output content and assumes no liability for third-party claims arising therefrom.
  • Limitation of Liability: The software is provided "as is", and the developer assumes no liability for any direct or indirect losses arising from the use of or inability to use this software. By using it, you are deemed to have understood and accepted the above terms.

Acknowledgements

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


Created by jianchang512

About

Translate the video from one language to another and embed dubbing & subtitles.

Topics

Resources

Stars

19.8k stars

Watchers

105 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages