BACK TO PORTFOLIO

Indic AI Dubbing Platform

Isochrony-Aware Video Dubbing and Zero-Shot Voice Cloning

Gemini 3.1 Flash-Lite IndicF5 (Diffusion Transformer) Faster-Whisper ASR Demucs Source Separation PyTorch / DSP

Original English Clip

Dubbed Hindi Clip

Pipeline Stages Walkthrough

Select any phase of the pipeline below to see how our engineering system processes the media files in real-time:

Stage 1: Audio Extraction & Separation
PHASE_01
Demuxes video audio and separates speech from environmental background track.

First, FFmpeg extracts raw 16kHz mono audio. Then, **Demucs (htdemucs)** separates it into vocal and background stems, allowing us to clone clean dialogue while retaining the original music/SFX track.

$ demucs --two-stems=vocals original_audio.wav Selected source: vocals | background Success: separated/vocals.wav, separated/background.wav (Duration: 455.92s)
Stage 2: Faster-Whisper ASR
PHASE_02
Transcribes audio and structures vocal timeline segments.

We execute **Faster-Whisper (large-v3)** in INT8 quantization on the GPU to generate high-fidelity, timestamped English transcript segments.

[00:00.27 -> 00:06.77] "There are plants in the soil. There is soil in the pot." [00:06.77 -> 00:13.29] "Soil is a resource. A natural resource."
Stage 3: Isochrony-Aware Translation
PHASE_03
Constrains translation upstream to match source timing.

We calculate the English syllable count and translate via **Gemini 3.1 Flash-Lite**. Chain-of-Thought (CoT) instructions force the LLM to generate exactly 3 candidates (Direct, Paraphrased, and Minimal), and we score them using a phoneme-budget evaluator to pick the best fit.

English Original "There are plants in the soil." (6.50s)
Phoneme Target: 10-14 syllables
Selected Hindi Candidate "मिट्टी में पौधे हैं।" Isochrony: 92.4%
Actual: 11 syllables (Perfect Fit)
Stage 4: Zero-Shot Voice Cloning & TTS
PHASE_04
Synthesizes duration-controlled voice using clones.

Using **IndicF5 (AI4Bharat)**, we feed a 12-second vocal clip from the speaker to extract speaker identity, and generate Hindi speech. The TTS is conditioned on the target duration to prevent downstream speed-stretching.

[DurationTTS] Processing [Segment 1/72]: target=6.50s | text='मिट्टी में पौधे हैं।' [SegGen] Ref duration = 4.84s | Target duration = 6.50s | Total fix_duration = 11.34s [SegGen] Synthesizing speech Born at target duration... Complete.
Stage 5: Timeline Synchronization & Mix
PHASE_05
Combines dubbed vocals, original background, and video.

We assemble the individual synthesized speech segments into a 455.92s timeline, overlay the original background track at 35% volume to preserve the ambient sound, and run FFmpeg to burn in the Nirmala UI Hindi subtitles.

$ ffmpeg -i input.mp4 -i synced_hindi_audio.wav -vf subtitles='Hindi.srt' final_hindi_dubbed.mp4 Output generated at: temp_processing/final_hindi_dubbed.mp4
View GitHub Repository Read Kaggle Setup Guide