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.
Metadata
Release files for translatedub 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| translatedub-0.4.0.tar.gz | 3.8 MB | With provenance | Details for translatedub-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| translatedub-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for translatedub-0.4.0-py3-none-any.whl |
Total release size: 7.5 MB
Release files / translatedub-0.4.0.tar.gz
| Download URL | translatedub-0.4.0.tar.gz |
|---|---|
| Size | 3.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e9ebc52215e630a2af30e87114786b9401e3941a83d8339298c79f8361995cc3
|
|
BLAKE2b-256 checksum How to use checksums |
6354863dc21c4aa8380f9654000b777b9e1f8085e53e52ee3fc578c172aaba9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.
Transparency logRelease files / translatedub-0.4.0-py3-none-any.whl
| Download URL | translatedub-0.4.0-py3-none-any.whl |
|---|---|
| Size | 3.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b60cf2fed9a0c292b344344dbe26507287df792bacc2741a4d203f5aa9d467e9
|
|
BLAKE2b-256 checksum How to use checksums |
691949d8c7fc01f9661ca1ad43e744eac4282f3bfbbe4bb0349ec0033b9b7e48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.
Transparency logSecurity for translatedub 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for translatedub-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.