Global by Default: Automating Video Localization with TypeScript
May 22, 2026 · By VideoFlowStop manually editing localized videos. Learn how to build a programmatic localization pipeline using VideoFlow to automate multilingual audio and captions.
Global by Default: Automating Video Localization with TypeScript
Shipping a video to one market is a project; shipping it to fifty is a pipeline nightmare. If you are manually swapping audio tracks and re-timing subtitles in Premiere Pro for every locale, you aren't building a product—you're running a boutique agency. For engineering teams at SaaS companies and content automation platforms, the only sustainable path is to treat video as code.
Video localization is the perfect use case for a programmatic approach. By separating the visual structure from the locale-specific assets (audio, text, captions), you can render an entire global campaign from a single TypeScript source.
In this guide, we’ll explore how to build a localization-ready video pipeline using VideoFlow that handles multilingual audio and word-level animated captions with ease.
The Architecture of a Localized Video
When we move from manual editing to VideoFlow, we stop thinking about "clips" and start thinking about "layers" and "flows." A localized video is essentially a template where the source of an audio layer or the captions array of a captions layer are variables injected at runtime.

Because VideoFlow uses a portable JSON format, you can store your video structure in a database and simply swap the asset URLs based on the user's language preference. This is significantly more scalable than the traditional approach of managing hundreds of independent MP4 files.
Step 1: Defining the Multilingual Core
Let’s look at a concrete example. We want to create a short explainer video that supports both English and Spanish. We’ll use a shared visual background and swap the audio and captions dynamically.
import VideoFlow from '@videoflow/core';
async function createLocalizedVideo(locale, assets) {
const $ = new VideoFlow({ width: 1080, height: 1080, fps: 30 });
// 1. Shared visual background
$.addImage(
{ fit: 'cover', opacity: 0.8 },
{ source: 'https://assets.videoflow.dev/bg-abstract.jpg' }
);
// 2. Dynamic Audio Layer
// We pass the locale-specific audio URL into the settings object.
$.addAudio(
{ volume: 0.8 },
{ source: assets[locale].audioUrl }
);
// 3. Dynamic Captions Layer
// VideoFlow's CaptionsLayer handles word-level timing automatically.
$.addCaptions(
{
fontSize: 5,
fontWeight: 700,
color: '#FF5A1F', // VideoFlow Orange
position: [0.5, 0.85],
textAlign: 'center',
},
{
captions: assets[locale].captions,
maxCharsPerLine: 30,
}
);
// The wait duration should match your longest media asset
$.wait(assets[locale].duration);
return $.compile();
}
Step 2: High-Impact Captions with Zero Manual Effort
One of the biggest pain points in localization is subtitle timing. Different languages have different word counts and lengths. If you use a static text layer, it will inevitably break.
VideoFlow’s captions guide shows how the $.addCaptions method accepts a time-coded array. This is perfect for integrating with AI transcription services like Whisper. You simply pipe the JSON output from your transcription tool directly into VideoFlow, and it handles the frame-accurate rendering.
This approach is a massive upgrade over FFmpeg shell scripts, where managing word-level subtitle synchronization often requires complex filter graphs and fragile string manipulation.
Step 3: Scaling the Render Pipeline
Once you have your VideoJSON for each locale, you need to render it. Depending on your use case, you have two powerful options:
- Server-Side Batching: Use
@videoflow/renderer-serverin a Node.js environment to render all fifty versions in parallel. Since VideoFlow doesn't require FFmpeg by default, it's trivial to deploy on modern serverless infrastructure. - Client-Side Export: If you are building a SaaS user recap video, you can use
@videoflow/renderer-browserto let the user export the localized MP4 directly in their browser tab using WebCodecs. This eliminates your server costs entirely.

Why VideoFlow for Localization?
Localization is where the "Video as Code" philosophy truly shines. By using VideoFlow, you gain several advantages over proprietary alternatives like Remotion:
- Apache-2.0 Licensing: Your core rendering engine is truly open-source. There are no hidden fees for scaling your localization factory.
- JSON Portability: You can generate the video structure in Python or Go and render it with VideoFlow's Node or Browser renderers. You aren't locked into a specific React runtime.
- Built-in Cinematics: You get 27 transitions and 42 GLSL effects out of the box, ensuring your localized videos look like high-end motion graphics, not just static slideshows.
Conclusion
Automating video localization isn't just about saving time—it's about making global content possible. When the cost of producing a new language version drops to the cost of a single API call, you can reach audiences you previously had to ignore.
Ready to build your global video factory? Head over to the VideoFlow Playground to experiment with captions and audio in real-time, or check out the source on GitHub to start building your pipeline today.