<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Kadir Barut]]></title><description><![CDATA[Kadir Barut]]></description><link>https://kadirbarut.hashnode.dev</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1593680282896/kNC7E8IR4.png</url><title>Kadir Barut</title><link>https://kadirbarut.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Fri, 11 Sep 2026 21:19:47 GMT</lastBuildDate><atom:link href="https://kadirbarut.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[I Built a Local-First AI Video Dubbing Pipeline with WhisperX + VoxCPM2]]></title><description><![CDATA[I recently open-sourced a project I've been building: Video Dubbing Translator, a local-first Python pipeline that takes a source video and produces a translated dub while trying to preserve the origi]]></description><link>https://kadirbarut.hashnode.dev/local-first-ai-video-dubbing-whisperx-voxcpm2</link><guid isPermaLink="true">https://kadirbarut.hashnode.dev/local-first-ai-video-dubbing-whisperx-voxcpm2</guid><category><![CDATA[Artificial Intelligence]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Python]]></category><category><![CDATA[Machine Learning]]></category><category><![CDATA[text to speech]]></category><category><![CDATA[audio]]></category><category><![CDATA[#ArtificialIntelligence ]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Kadir Barut]]></dc:creator><pubDate>Wed, 19 Aug 2026 14:23:02 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6a85b6c48a5e3abcb9321cb7/b6fadcbc-1ef3-4deb-90c2-841df2c22004.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I recently open-sourced a project I've been building: <strong>Video Dubbing Translator</strong>, a local-first Python pipeline that takes a source video and produces a translated dub while trying to preserve the original speaker's voice.</p>
<p>💻 <strong>GitHub:</strong><br /><a href="https://github.com/kadirb4rut/video-dubbing-translator">https://github.com/kadirb4rut/video-dubbing-translator</a></p>
<p>The current pipeline combines <strong>Whisper / WhisperX, VoxCPM2, audio separation, translation, FFmpeg/MoviePy, and optional LatentSync</strong> into one workflow.</p>
<h2>What it does</h2>
<p>The pipeline looks like this:</p>
<p><strong>Video → vocal/background separation → Whisper → WhisperX alignment → translation → VoxCPM2 voice cloning → duration fitting → video reconstruction → optional LatentSync</strong></p>
<p>In practice, it:</p>
<ul>
<li><p>extracts and separates speech from the background audio</p>
</li>
<li><p>transcribes the speech with Whisper</p>
</li>
<li><p>aligns speech timing with WhisperX</p>
</li>
<li><p>translates each speech segment</p>
</li>
<li><p>uses the original speaker as a reference for VoxCPM2</p>
</li>
<li><p>generates new speech at 48 kHz</p>
</li>
<li><p>adjusts generated segments to approximately match the original timing</p>
</li>
<li><p>mixes the original background audio back in</p>
</li>
<li><p>rebuilds the video</p>
</li>
<li><p>can optionally apply AI lip-sync with LatentSync</p>
</li>
</ul>
<h2>Why VoxCPM2?</h2>
<p>The project originally used XTTS-v2, but I wanted a commercially friendlier and more capable multilingual voice-cloning backend.</p>
<p>I eventually migrated the pipeline to <strong>VoxCPM2</strong>.</p>
<p>VoxCPM2 supports <strong>30 languages</strong> and produces native <strong>48 kHz speech</strong>, while also supporting reference-based / zero-shot voice cloning.</p>
<p>The current version of my application exposes <strong>11 validated dubbing target languages</strong>, while the underlying VoxCPM2 model supports a broader 30-language set.</p>
<h2>English → Turkish real-world test</h2>
<p>I ran a full end-to-end test using a 15-second English video.</p>
<p>🎬 <strong>Original English video:</strong><br /><a href="https://github.com/kadirb4rut/video-dubbing-translator/releases/download/demo-videos/input-highlight-15s.mp4">https://github.com/kadirb4rut/video-dubbing-translator/releases/download/demo-videos/input-highlight-15s.mp4</a></p>
<p>🇹🇷 <strong>Turkish dub generated with VoxCPM2:</strong><br /><a href="https://github.com/kadirb4rut/video-dubbing-translator/releases/download/demo-videos/target-voxcpm2-highlight-15s.mp4">https://github.com/kadirb4rut/video-dubbing-translator/releases/download/demo-videos/target-voxcpm2-highlight-15s.mp4</a></p>
<p>The test went through the actual production pipeline rather than an isolated TTS demo:</p>
<p><strong>separation → transcription → alignment → translation → four VoxCPM2 generations → duration fitting → reconstruction → background mix</strong></p>
<p>The resulting video remained approximately the same duration as the original, and the Turkish speech retained noticeable characteristics of the source speaker.</p>
<h2>The surprising part: it ran on an 8 GB M1</h2>
<p>One of the more interesting experiments was running the entire base pipeline on an <strong>8 GB Apple M1 Mac</strong>.</p>
<p>It worked.</p>
<p>It was definitely not fast — VoxCPM2 inference on CPU/bfloat16 took a long time — but the complete pipeline successfully finished.</p>
<p>For one direct Turkish VoxCPM2 generation during testing:</p>
<ul>
<li><p>model load: ~59 seconds</p>
</li>
<li><p>synthesis: ~139 seconds</p>
</li>
<li><p>output: 48 kHz mono audio</p>
</li>
</ul>
<p>The complete 15-second video test required multiple speech generations and took significantly longer.</p>
<p>For actual use, an NVIDIA CUDA GPU is clearly the more practical option.</p>
<h2>Local-first, not completely offline</h2>
<p>I describe the project as <strong>local-first</strong> rather than fully offline.</p>
<p>Video processing, transcription, voice generation, audio separation and reconstruction run locally.</p>
<p>However, the current translation stage uses <code>deep-translator</code> with Google Translate, so transcript text is sent to an external translation service.</p>
<p>One item on the roadmap is adding an optional fully local translation backend.</p>
<h2>Current stack</h2>
<p>The main pieces are:</p>
<ul>
<li><p><strong>Python 3.10</strong></p>
</li>
<li><p><strong>Whisper</strong></p>
</li>
<li><p><strong>WhisperX</strong></p>
</li>
<li><p><strong>VoxCPM2</strong></p>
</li>
<li><p><strong>FFmpeg</strong></p>
</li>
<li><p><strong>MoviePy</strong></p>
</li>
<li><p>vocal/background separation</p>
</li>
<li><p><strong>LatentSync 1.6</strong> (optional)</p>
</li>
<li><p>local browser GUI</p>
</li>
</ul>
<p>The base dubbing pipeline does not require CUDA.</p>
<p>LatentSync does.</p>
<h2>Open source</h2>
<p>The project is available here:</p>
<p>👉 <strong><a href="https://github.com/kadirb4rut/video-dubbing-translator">https://github.com/kadirb4rut/video-dubbing-translator</a></strong></p>
<p>The original project code is MIT licensed, while the project documents the licenses and terms of the third-party models and components separately.</p>
<p>I'm particularly interested in feedback from people working on:</p>
<ul>
<li><p>speech AI</p>
</li>
<li><p>TTS</p>
</li>
<li><p>voice cloning</p>
</li>
<li><p>multilingual speech</p>
</li>
<li><p>dubbing</p>
</li>
<li><p>audio/video processing</p>
</li>
<li><p>local AI</p>
</li>
</ul>
<p>I'd also be very interested to see real-world performance numbers from people running the pipeline on NVIDIA GPUs.</p>
<p>If you work in this area, I'd love to hear what you would improve first: <strong>speaker similarity, multilingual pronunciation, timing, or the translation layer?</strong></p>
]]></content:encoded></item></channel></rss>