Local-first, cross-platform video translation, subtitling and AI dubbing.
Project description
TranslateDub AI
Local-first, cross-platform video translation, subtitling, and AI dubbing — as a CLI, a Python library, or a one-command local web app.
Translate a video into another language, review the bilingual subtitles, generate a dubbed voice track, and export a ready-to-share video — all on your own machine. Your video files and API keys never leave your computer.
Install
Requires Python 3.9+. No code signing, no downloads to unblock, no admin rights.
pipx install translatedub # recommended (isolated), or:
pip install translatedub
# run once without installing:
uvx translatedub serve
FFmpeg is resolved automatically: it uses a system ffmpeg if present, otherwise the
bundled-per-platform binary from the imageio-ffmpeg dependency. Nothing extra to install.
For a fully free, no-API-key pipeline (recommended), install the optional extra:
pip install "translatedub[free]"
This enables local speech recognition (faster-whisper), free translation (deep-translator), and free neural voices incl. natural Vietnamese (edge-tts) — so you can transcribe, translate, and dub without any API key. With a Gemini key set, the app prefers Gemini automatically for higher quality. edge-tts (LGPLv3) is optional and invoked via its CLI; nothing here is bundled or modified.
For premium Google Cloud voices, install the optional extra and add a key:
pip install "translatedub[cloud]"
Quick start
No API key needed with the [free] extra installed:
# Translate + dub a video in one command
translatedub translate input.mp4 --to vi -o output.mp4
# …or open the visual editor in your browser (edit subtitles before export)
translatedub serve
Optional — higher quality with a Gemini key (free tier at Google AI Studio). With a key stored, the app prefers Gemini automatically for transcription and translation:
translatedub config set-key # kept in a chmod 600 file, never in the repo
Three ways to use it
| Mode | Command | Best for |
|---|---|---|
| CLI | translatedub translate ... |
scripting, batch, power users |
| Web UI | translatedub serve |
reviewing/editing subtitles, non-technical users |
| Library | from translatedub.core import ... |
embedding in your own tools |
CLI examples
# Subtitles only (no dubbing), burned into the video
translatedub translate talk.mp4 --to en --subtitles-only --burn-subtitles
# Premium Google Cloud voice, keep 20% of the original audio under the dub
translatedub translate vlog.mp4 --to vi --engine google_cloud \
--voice vi-VN-Neural2-A --original-vol 0.2
# See all options
translatedub translate --help
Library example
from translatedub.pipeline import translate_video, export_video
subs = translate_video("input.mp4", "auto", "vi", gemini_key="...")
for s in subs:
print(s.index, s.translated_text) # review / edit programmatically
export_video("input.mp4", subs, "output.mp4", target_lang="vi")
How it works
- Extract audio with FFmpeg.
- Transcribe speech with faster-whisper (local, free) or Google Gemini (auto-chunked for long videos).
- Translate with deep-translator (free) or Gemini — by default the app picks Gemini when a key is present, the free local stack otherwise.
- Review/edit bilingual subtitles (in the web UI) or use them directly (CLI/library).
- Generate a dubbed voice track with edge-tts (free neural voices, default), gTTS (fallback), or Google Cloud TTS (premium), with optional duration matching so speech fits each subtitle window.
- Mux the dub over the original video, with optional burned-in or soft subtitles.
This is an independent implementation inspired by the general workflow of pyVideoTrans. It does not vendor or depend on pyVideoTrans source code, assets, or binaries.
Security & privacy
Local-first by design. Nothing is uploaded to any server run by this project.
| Data | Handling |
|---|---|
| Gemini API key | Environment variable, or ~/.translatedub/config.json created chmod 600 |
| Google Cloud service-account JSON | Same as above (env var or the config file) |
| Video / audio | Processed on your machine; temp files under ~/.translatedub/temp |
| The local web server | Bound to 127.0.0.1 and rejects non-local requests |
Credential storage follows the same model as gh, aws, and npm: environment
variable first, then an owner-only file. See SECURITY.md.
Supported credential environment variables:
TRANSLATEDUB_GEMINI_KEY (or GEMINI_API_KEY),
TRANSLATEDUB_GOOGLE_CLOUD_CREDENTIALS (or GOOGLE_APPLICATION_CREDENTIALS pointing to a JSON file).
Develop
git clone https://github.com/Phong-EpicMind/video-translate-pro.git
cd video-translate-pro
python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev,cloud]"
pytest
License
MIT — see LICENSE. Third-party components (FFmpeg, Google libraries, etc.) are under their own licenses; see THIRD_PARTY_NOTICES.md.
Tiếng Việt
TranslateDub AI là công cụ dịch video, làm phụ đề song ngữ và lồng tiếng bằng AI, chạy cục bộ trên máy (Mac/Windows/Linux). Video và API key không rời khỏi máy bạn. Dùng được theo 3 cách: dòng lệnh (CLI), giao diện web (một lệnh mở trình duyệt), hoặc thư viện Python.
Cài đặt
Cần Python 3.9+. Không cần ký app, không cảnh báo tải về.
pip install "translatedub[free]" # bản đầy đủ, KHÔNG cần API key
FFmpeg tự lo: dùng ffmpeg hệ thống nếu có, không thì lấy bản đi kèm imageio-ffmpeg.
Bắt đầu nhanh
Không cần API key — nhận dạng giọng nói, dịch và lồng tiếng đều có sẵn bản miễn phí (faster-whisper + deep-translator + edge-tts, có giọng tiếng Việt tự nhiên):
translatedub translate input.mp4 --to vi -o out.mp4 # dịch + lồng tiếng một lệnh
translatedub serve # hoặc mở giao diện web để sửa phụ đề
Muốn chất lượng cao hơn thì thêm Gemini key (có bậc miễn phí tại Google AI Studio) — app sẽ tự ưu tiên Gemini:
translatedub config set-key # key lưu file chmod 600 trên máy bạn
Bảo mật
Chạy cục bộ, không upload lên server nào của dự án. Key lưu trong biến môi trường hoặc
file ~/.translatedub/config.json với quyền chmod 600 (giống cách gh, aws, npm
làm). Server web chỉ nhận kết nối từ 127.0.0.1. Xem SECURITY.md.
Đây là dự án độc lập, lấy cảm hứng từ quy trình tổng quát của pyVideoTrans; không copy/phụ thuộc source code, asset hay binary của pyVideoTrans.
Giấy phép
MIT — xem LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file translatedub-0.2.4.tar.gz.
File metadata
- Download URL: translatedub-0.2.4.tar.gz
- Upload date:
- Size: 3.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
766fcf2760fa2bff1f93c3977b23251d2971613ad07140f1c0e0b033b5f8402d
|
|
| MD5 |
4004c7a1049a0cc56a00c14ab48c6fd3
|
|
| BLAKE2b-256 |
cc47ce57e26097ad06810ce5f5e0cf6e7876c840c1f19855701d4a630f5e3549
|
Provenance
The following attestation bundles were made for translatedub-0.2.4.tar.gz:
Publisher:
release.yml on Phong-EpicMind/video-translate-pro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
translatedub-0.2.4.tar.gz -
Subject digest:
766fcf2760fa2bff1f93c3977b23251d2971613ad07140f1c0e0b033b5f8402d - Sigstore transparency entry: 2045054652
- Sigstore integration time:
-
Permalink:
Phong-EpicMind/video-translate-pro@8e97a438e1c5b0f4fb03d9e7dc4a5fe22fc5225a -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/Phong-EpicMind
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e97a438e1c5b0f4fb03d9e7dc4a5fe22fc5225a -
Trigger Event:
push
-
Statement type:
File details
Details for the file translatedub-0.2.4-py3-none-any.whl.
File metadata
- Download URL: translatedub-0.2.4-py3-none-any.whl
- Upload date:
- Size: 3.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bffab81d065472201a1cabfec95b15e838bc3d6a9f7a61261221b194be158b15
|
|
| MD5 |
d353ccd167bd2e38b7eb322ac99c42c1
|
|
| BLAKE2b-256 |
bad498404fe7ea9ba34a78d66917a68fce668efe71c3e99f89ca0e51362bc7ba
|
Provenance
The following attestation bundles were made for translatedub-0.2.4-py3-none-any.whl:
Publisher:
release.yml on Phong-EpicMind/video-translate-pro
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
translatedub-0.2.4-py3-none-any.whl -
Subject digest:
bffab81d065472201a1cabfec95b15e838bc3d6a9f7a61261221b194be158b15 - Sigstore transparency entry: 2045054771
- Sigstore integration time:
-
Permalink:
Phong-EpicMind/video-translate-pro@8e97a438e1c5b0f4fb03d9e7dc4a5fe22fc5225a -
Branch / Tag:
refs/tags/v0.2.4 - Owner: https://github.com/Phong-EpicMind
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e97a438e1c5b0f4fb03d9e7dc4a5fe22fc5225a -
Trigger Event:
push
-
Statement type: