Programmatic Video Ads: Scaling Creative Production with JSON Templates
August 20, 2026 · By VideoFlowLearn how to scale creative production by treating video ads as JSON templates. Generate 1,000s of variants for localization and A/B testing with VideoFlow.
Programmatic Video Ads: Scaling Creative Production with JSON Templates
In the world of performance marketing, creative fatigue is the enemy. To keep conversion rates high, brands need to test hundreds of ad variants—different headlines, background videos, call-to-actions, and localized offers. But manual editing doesn't scale. If your creative team is stuck in After Effects for every minor copy change, you aren't running a performance engine; you're running a bottleneck.
The solution is programmatic video ads: treating your video creative as data. By moving from monolithic video files to portable JSON templates, you can decouple your creative logic from your rendering pipeline, allowing you to generate 1,000 unique variants as easily as you generate one.

The Template-to-Scale Workflow
Traditional video production is linear and destructive. Programmatic video with VideoFlow is modular. You define a template using the @videoflow/core builder, then inject dynamic data (like product names or prices) at runtime. Because VideoFlow compiles your code into a lightweight VideoJSON document, you can store your entire ad library in a database and render it on-demand.
Here is how you can structure a dynamic ad template in just a few lines of TypeScript:
import VideoFlow from '@videoflow/core';
function createAdVariant(product) {
const $ = new VideoFlow({ width: 1080, height: 1920, fps: 30 });
// 1. Dynamic Background
const bg = $.addVideo(
{ fit: 'cover' },
{ source: product.videoUrl }
);
// 2. Branded Overlay Group
$.group(
{ position: [0.5, 0.8], opacity: 0.9 },
{ transitionIn: { transition: 'slideUp', duration: '500ms' } },
() => {
$.addShape(
{ width: 80, height: 20, fill: '#FF5A1F', cornerRadius: 2 },
{ shapeType: 'rectangle' }
);
$.addText({
text: product.name,
fontSize: 6,
color: '#fff',
fontWeight: 700,
position: [0.5, 0.4]
});
$.addText({
text: `Only ${product.price}`,
fontSize: 4,
color: '#fff',
position: [0.5, 0.7]
});
}
);
$.wait('6s');
return $.compile();
}
Why Your Pipeline Should Be JSON-First
When your videos are represented as JSON, they become part of your standard engineering stack. This shift unlocks capabilities that are impossible with traditional MP4-based workflows:
- A/B Testing at Scale: Automatically generate variants with different GLSL effects or transitions to see which visual style drives the most clicks.
- Localization: Pass a dictionary of translated strings and localized currency formats into your builder function to generate global ad sets in seconds.
- Real-Time Personalization: Use the browser renderer to export personalized videos directly in the user's tab, avoiding server-side queue times and costs.
- Version Control: Since VideoJSON is just text, you can diff your creative changes in Git, just like your application code.

How VideoFlow Handles the Heavy Lifting
VideoFlow was built specifically for this "content factory" use case. Unlike Remotion, which requires a React runtime, VideoFlow's core is a pure TypeScript library. This means you can generate your VideoJSON in a serverless function, a worker, or even a CLI tool.
Once you have your JSON, you have three official paths to pixels:
- @videoflow/renderer-server: For high-volume batch jobs in Node.js. It uses headless Chromium to render frames with frame-perfect accuracy without needing a complex FFmpeg setup.
- @videoflow/renderer-browser: For client-side exports. Perfect for tools where users customize their own ads before downloading.
- @videoflow/renderer-dom: For live previews while you are designing your templates.
From Script to Screen
If you are currently chaining FFmpeg shell scripts or manually editing ad variants, you are leaving performance on the table. Moving to a programmatic workflow doesn't just save time—it allows you to treat your creative as a variable you can optimize with the same rigor as your bidding strategy.
Ready to build your first ad factory? Check out our Getting Started guide to see how to set up your first project, or dive into our YouTube Shorts factory tutorial for a deep dive into automated content creation. You can also explore the source and contribute on GitHub.
Stop editing. Start generating.