FastAPI demo: English video → Hindi/Marathi dubbed outputs via Whisper, Google Translate, gTTS.
- ffmpeg on PATH
- Python 3.10+
python -m venv .venv
. .venv/Scripts/activate
pip install -r requirements.txtuvicorn app:app --reload --host 0.0.0.0 --port 8000GET /languages returns supported language codes and names. Defaults for dubbing include: hi, mr, bn, ta, te. Also available: gu, kn, ml, pa.
- POST
/upload-video: form-datafile - POST
/dub-video: form-datavideo_id,target_languages(can include comma-separated codes, e.g.hi,mr,bn,ta,te),model_size,generate_subtitles
Outputs are served under /outputs/... for preview.
Notes: Whisper downloads on first use; googletrans/gTTS need internet; timing fit is naive but OK for demo.
Build and run the API in a container with ffmpeg included:
docker build -t multilingual-dubbing:latest .
docker run --rm -p 8000:8000 -v %cd%/data:/app/data multilingual-dubbing:latestLinux/macOS volume flag:
docker run --rm -p 8000:8000 -v $(pwd)/data:/app/data multilingual-dubbing:latestVisit http://localhost:8000/ui and http://localhost:8000/outputs.