VideoFlowcodeGitHubStudioTry itCoreRenderersReact Video EditorPlaygroundExamplesDocscodeGitHubStudioTry it
← Back to Blog

How to Render MP4 from Node.js Without FFmpeg

October 3, 2026 · By VideoFlowLearn how to use VideoFlow and headless Chromium to generate high-quality MP4 videos in Node.js without installing FFmpeg. Faster, cleaner, and dependency-free.How to Render MP4 from Node.js Without FFmpeg

How to Render MP4 from Node.js Without FFmpeg

For years, the standard answer for "how do I generate a video on the server?" has been a variation of: "Shell out to FFmpeg and pray the string concatenation doesn't break." While FFmpeg is a legendary piece of software, it was never designed for the modern web stack. It's a binary dependency that's notoriously hard to bundle, difficult to debug, and requires complex frame-piping logic if you want to do anything more advanced than concatenating clips.

If you are building a SaaS product that needs to generate personalized onboarding videos, automated social media clips, or data-driven dashboards, you shouldn't have to manage a fleet of FFmpeg instances.

In this guide, we'll look at how VideoFlow allows you to render high-quality MP4 files directly from Node.js using WebCodecs and headless Chromium, bypassing the need for a local FFmpeg installation entirely.

The Problem with Traditional Video Pipelines

Most video generation tools follow a "screenshot and stitch" architecture. They spin up a headless browser, take a JPEG screenshot of every single frame, and then pipe those thousands of images into an FFmpeg process to be encoded into an H.264 stream.

This approach has three major drawbacks:

  1. Performance Overhead: The round-trip between the browser's memory and the disk (or a pipe) for every frame is incredibly slow.
  2. Resource Intensity: Re-encoding JPEGs into video is CPU-intensive and often results in lower quality than a direct hardware-accelerated encode.
  3. Dependency Hell: Your server environment (Docker, Lambda, etc.) must have FFmpeg and all its required codecs pre-installed and correctly configured.

Architecture of a modern headless video pipeline Modern video pipelines shouldn't rely on fragile binary dependencies.

Enter WebCodecs and @videoflow/renderer-server

VideoFlow takes a different approach. By leveraging the WebCodecs API inside a headless Chromium instance, we can encode the video directly within the browser process.

The @videoflow/renderer-server package (built on Apache-2.0) drives this process via Playwright. Instead of screenshots, the browser exports a finished MP4 blob that is sent back to your Node.js environment. This means:

  • No FFmpeg required for the default pipeline.
  • Pixel-perfect consistency between what you see in the Playground and what your server renders.
  • Hardware acceleration where available, significantly reducing render times.

Building Your First Server-Side Video

To get started, you only need to install the core library and the server renderer:

npm install @videoflow/core @videoflow/renderer-server
npx playwright install chromium

Once installed, you can use the fluent VideoFlow builder API to define your scene. Here is a minimal example that generates a 5-second video with a fade-in title:

import VideoFlow from '@videoflow/core';
import '@videoflow/renderer-server'; // Registers the Node.js renderer

const $ = new VideoFlow({ width: 1920, height: 1080, fps: 30 });

// Add a background image (using the two-arg pattern: properties, then settings)
$.addImage(
  { fit: 'cover', opacity: 0.8 },
  { source: 'https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe' }
);

const title = $.addText({
  text: 'Rendered Without FFmpeg',
  fontSize: 8,
  color: '#FF5A1F', // VideoFlow Orange
  position: [0.5, 0.5],
});

title.fadeIn('1s');
$.wait('3s');
title.fadeOut('1s');

// Render directly to a file
await $.renderVideo({
  outputType: 'file',
  output: './onboarding.mp4',
  verbose: true,
});

Why JSON Portability Matters

One of the biggest advantages of VideoFlow over alternatives like Remotion is that your video isn't tied to a specific React runtime. A VideoFlow project compiles down to a portable VideoJSON document.

This means your backend can be written in Go, Python, or Rust—as long as it can emit a JSON object that follows our schema, the @videoflow/renderer-server can pick it up and turn it into a video. This "JSON-first" approach is why VideoFlow is the preferred choice for AI agents and LLM pipelines that need to "speak" video.

JSON to Video Pipeline Treating videos as data makes them easy to version, diff, and generate at scale.

Advanced Rendering Options

While the default WebCodecs pipeline is the fastest, VideoFlow is flexible. If you do need specific FFmpeg flags (like custom x264 presets or AAC bitrate control), you can opt back into an FFmpeg-based pipeline with a single flag:

await $.renderVideo({
  outputType: 'file',
  output: './custom-render.mp4',
  ffmpeg: true, // Opt into the FFmpeg fallback pipeline
});

This flexibility is a core part of our official renderers architecture. Whether you are exporting in the browser tab via @videoflow/renderer-browser or batch-processing on a server, the output remains identical.

Summary

Rendering MP4s from Node.js no longer requires complex shell scripts or fragile binary dependencies. By combining the power of headless Chromium with the convenience of a typed TypeScript builder, VideoFlow makes programmatic video generation as easy as writing a few lines of code.

If you're ready to move beyond FFmpeg, here's how to dive deeper:

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 →Cinematic Code: How to Stack and Animate GLSL Effects in 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.jsHow to Build a YouTube Shorts Factory with TypeScript and VideoFlowProgrammatic Video Localization: Scaling Multilingual Content with VideoFlowScaling Programmatic Video: How to Architect Large-Scale ProjectsThe Three-Renderer Rule: Preview, Export, and Batch Render with One JSON
© 2026 VideoFlow. Apache-2.0 core.