VideoFlowcodeGitHubStudioTry itCoreRenderersReact Video EditorPlaygroundExamplesDocscodeGitHubStudioTry it
← Back to Blog

Zero-Cost Video Export: Rendering MP4s in the Browser with WebCodecs

October 31, 2026 · By VideoFlowLearn how to offload video rendering costs to the user's browser using VideoFlow and WebCodecs. Generate high-quality MP4s without expensive server-side CPU bills.Zero-Cost Video Export: Rendering MP4s in the Browser with WebCodecs

Zero-Cost Video Export: Rendering MP4s in the Browser with WebCodecs

Scaling a video generation product usually ends in the same place: a massive AWS bill. Whether you are automating social media clips, generating personalized sales videos, or building a SaaS dashboard with "Export as MP4" functionality, the traditional approach involves spinning up a fleet of headless browsers or FFmpeg workers on the server. Every minute of video rendered is a minute of CPU and GPU time you have to pay for.

But what if you didn't have to pay for it at all?

With VideoFlow and the WebCodecs API, you can offload the entire rendering pipeline to the person who wants the video: the user. By utilizing zero-cost browser video export, you can turn every client device into a high-performance render node.

Bypassing the server for direct video export

The Cost of Server-Side Rendering

Most Remotion alternatives and programmatic video tools rely heavily on server-side infrastructure. To render a single 1080p video at 60fps, a server must:

  1. Launch a headless browser instance.
  2. Execute the JavaScript to build the timeline.
  3. Capture every frame (often 60 times per second).
  4. Pipe those frames into an encoder (like FFmpeg).

This works well for batch jobs, but it creates a scaling bottleneck. If 1,000 users hit "Export" at the same time, you need 1,000 concurrent browser instances. That is expensive, complex to orchestrate, and introduces significant latency as videos wait in a queue.

Enter @videoflow/renderer-browser

VideoFlow was architected from day one with a three-renderer rule: the same VideoJSON document must render identically across the DOM (for preview), the Server (for batch), and the Browser (for client-side export).

The @videoflow/renderer-browser package leverages the WebCodecs API—a modern browser standard that gives web applications low-level access to hardware-accelerated video encoders. Instead of sending frames to a server, VideoFlow encodes them directly into an MP4 file in a background worker thread within the user's browser.

Implementation: 18 Lines to Browser Export

You don't need a complex backend to start shipping video. Here is how you can implement a "Download MP4" button that runs entirely on the client side using the VideoFlow core builder.

import VideoFlow from '@videoflow/core';
import '@videoflow/renderer-browser'; // Registers the browser renderer

async function exportUserVideo(userData) {
  const $ = new VideoFlow({ width: 1280, height: 720, fps: 30 });

  // Build a personalized video
  $.addImage({ fit: 'cover' }, { source: userData.bgUrl });
  $.addText({
    text: `Congrats, ${userData.name}!`,
    fontSize: 6,
    color: '#FF5A1F',
    position: [0.5, 0.4]
  }).fadeIn('500ms');

  $.wait('3s');

  // Render directly to a Blob in the browser
  const blob = await $.renderVideo({
    outputType: 'blob',
    onProgress: (p) => console.log(`Exporting: ${Math.round(p * 100)}%`)
  });

  // Trigger a browser download
  const url = URL.createObjectURL(blob);
  const a = document.createElement('a');
  a.href = url;
  a.download = 'my-video.mp4';
  a.click();
}

By calling $.renderVideo in a browser environment, VideoFlow automatically selects the renderer-browser engine. It handles the worker orchestration, frame-accurate synchronization, and muxing into a valid MP4 container without ever touching your server.

Building a timeline from code blocks

Why This Beats Traditional Pipelines

1. Zero Infrastructure Cost

Your rendering cost stays at $0 regardless of whether you have ten users or ten million. The user provides the CPU and GPU power.

2. Instant Privacy

Because the video is generated locally, sensitive user data (like names, photos, or private dashboard metrics) never leaves the user's machine. This is a massive win for GDPR and HIPAA compliance. We've seen this used effectively in personalised SaaS recap videos where data privacy is paramount.

3. Lower Latency

There is no "uploading" frames or "downloading" a finished file from a cloud bucket. The encoding happens in real-time on the local machine, and the file is available immediately upon completion.

4. Portability

Because VideoFlow uses a portable VideoJSON schema, you can let users customize their video in our interactive Playground, save the JSON to your database, and then render it on-demand in the browser later.

When to Still Use the Server

While browser-side rendering is a game-changer, it isn't a silver bullet. You should still reach for @videoflow/renderer-server when:

  • Batch Processing: You need to generate 5,000 videos at 3 AM for an email campaign.
  • Consistency Guarantees: You need to ensure a video renders exactly the same way even if a user is on an ancient browser that doesn't support WebCodecs.
  • Long Renders: If a video takes 10 minutes to render, a user might close their tab. Server-side rendering allows for background processing.

Conclusion

VideoFlow’s browser renderer represents a shift in how we think about video infrastructure. By moving the heavy lifting to the edge, you can build powerful video creation tools with the same cost profile as a static website.

Ready to try it out? Head over to the VideoFlow Documentation to see the full renderer matrix, or jump straight into the GitHub repository to see how we've implemented the WebCodecs pipeline. Stop paying for your users' render time and start shipping zero-cost video today.

VideoFlow

Open-source toolkit for composing videos from code.

Product

CoreRenderersReact Video EditorPlaygroundStudio

Learn

DocsAPI referenceExamplesvs. Remotionvs. FFmpeg

Project

GitHubLicenseContactTermsPrivacy

From the blog

All posts →How to Add a Professional Video Editor to Your SaaS in 10 Lines of CodeBeyond the Shell: Why Your Video Pipeline Should Be a TypeScript APICinematic Code: How to Stack and Animate GLSL Effects in VideoFlowDynamic HUDs and Overlays: Mastering Layer Groups in VideoFlowBeyond the MP4: Exporting Editable NLE Projects with VideoFlowVideo Rendering Without FFmpeg: Inside the VideoFlow Server EngineVisualizing Git History: How to Build a Repository Timeline with VideoFlowHeadless Video as a Service: Building a Scalable Rendering API with Node.js
© 2026 VideoFlow. Apache-2.0 core.