VideoFlowcodeGitHubTry itCoreRenderersReact Video EditorPlaygroundExamplesDocscodeGitHubTry it
← Back to Blog

How to Render MP4s in Node.js Without Installing FFmpeg

May 22, 2026 · By VideoFlowLearn how to render MP4s in Node.js without installing FFmpeg. Use VideoFlow and WebCodecs to build a portable, headless video pipeline with TypeScript.How to Render MP4s in Node.js Without Installing FFmpeg

How to Render MP4s in Node.js Without Installing FFmpeg

If you've ever tried to build a video automation pipeline in Node.js, you've likely hit the "FFmpeg Wall." You start with a simple requirement—"generate a short video from data"—and end up managing a complex web of binary dependencies, fragile shell commands, and massive Docker images.

FFmpeg is a powerful tool, but for modern full-stack developers, it's often the wrong abstraction. It’s hard to scale, difficult to debug, and a nightmare to keep updated in production environments.

In this guide, we’ll show you how to render MP4s in Node.js using VideoFlow—a toolkit that bypasses the need for local FFmpeg installations by leveraging WebCodecs and headless browsers.

The Problem with the FFmpeg Status Quo

Most video libraries for Node.js are thin wrappers around the FFmpeg CLI. This approach introduces several friction points:

  1. Dependency Hell: You have to ensure the correct version of FFmpeg is installed on every developer machine and production server.
  2. Opaque Command Strings: Debugging a 500-character shell command concatenated with template literals is an exercise in frustration.
  3. No Visual Logic: FFmpeg doesn't understand "layers," "typography," or "easings." You have to map your visual intent to low-level filter graphs manually.

By moving away from shell-scripting and toward a typed, programmatic builder, you can treat your video pipelines like any other part of your TypeScript stack.

Architecture of a headless video pipeline

Enter VideoFlow: Headless Video Rendering

VideoFlow takes a different approach. Instead of wrapping a C++ binary, it uses the same technology that powers modern web browsers.

When you use the @videoflow/renderer-server package, it spins up a headless Chromium instance via Playwright. It then uses the WebCodecs API to encode frames directly into an MP4 container. This means your video rendering logic is written in pure TypeScript, and your output is byte-for-byte identical to what you see in the browser.

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

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

Building and Rendering Your First Video

Here is a complete, runnable example of rendering an MP4 from a Node.js script. Note how we define the scene using the fluent builder API and then call renderVideo to produce the file.

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

async function main() {
  // 1. Initialize the project
  const $ = new VideoFlow({
    width: 1280,
    height: 720,
    fps: 30,
    backgroundColor: '#0d1117'
  });

  // 2. Add some visual layers
  const title = $.addText({
    text: 'Zero FFmpeg Needed',
    fontSize: 6,
    color: '#FF5A1F',
    fontWeight: 700,
    position: [0.5, 0.4]
  });

  const subtitle = $.addText({
    text: 'Rendered via WebCodecs in Node.js',
    fontSize: 3,
    color: '#ffffff',
    position: [0.5, 0.6]
  });

  // 3. Add cinematic motion
  title.fadeIn('800ms');
  $.wait('2s');
  title.fadeOut('500ms');

  // 4. Render directly to a file
  console.log('Rendering video...');
  await $.renderVideo({
    outputType: 'file',
    output: './output.mp4',
    verbose: true
  });

  console.log('Video saved to ./output.mp4');
}

main();

Why This Matters for SaaS and Automation

This "headless-first" architecture is a game-changer for SaaS video automation pipelines. Because VideoFlow doesn't rely on FFmpeg by default, you can deploy it to environments where installing custom binaries is difficult, such as certain serverless platforms or restricted CI/CD environments.

  • Portability: The same VideoJSON document can be previewed in the VideoFlow Playground, exported in a user's browser, or rendered on a server.
  • Cinematic Primitives: You get access to 27 transition presets and 42 GLSL effects (like bloom, vhsDistortion, and chromaticAberration) out of the box, without writing a single line of shader code.
  • Scalability: Since it uses standard Playwright/Chromium, you can scale your rendering workers using standard container orchestration patterns.

Deploying video pipelines to serverless environments

Deployment Tips

When deploying the @videoflow/renderer-server to production, keep these two things in mind:

  1. Playwright Dependencies: Your Dockerfile must include the system libraries required by Chromium. Using the official Playwright base images is the easiest path.
  2. Memory Allocation: Rendering video is a memory-intensive task. Ensure your server or lambda function has at least 2GB of RAM for 720p renders, and more for 1080p or 4K.

Getting Started with VideoFlow

VideoFlow is fully open-source (Apache-2.0). You can start building today by checking out the official documentation or browsing the examples gallery.

If you're tired of fighting with FFmpeg flags and want a modern, typed way to generate video from code, give VideoFlow on GitHub a star and try the server renderer in your next project.

VideoFlow

Open-source toolkit for composing videos from code.

Product

CoreRenderersReact Video EditorPlayground

Learn

DocsAPI referenceExamplesvs. Remotionvs. FFmpeg

Project

GitHubLicenseContactTermsPrivacy

From the blog

All posts →How to Automate Loom-style Product Demos with TypeScriptAutomated Podcast Audiogram Generator: Turning Audio into Viral Video with TypeScriptHow to Turn Markdown Changelogs into Automated Product Update VideosAutomating Personalized Onboarding Videos with VideoFlow and TypeScriptAutomated Video Subtitles: A Developer's Guide to the VideoFlow Captions LayerAutomating YouTube Shorts: Build a Vertical Video Factory in 30 Lines of TypeScriptHow to Build a Browser-Based Video Editor with React and VideoFlowCinematic 3D Video with TypeScript: A Guide to Perspective and Rotation
© 2026 VideoFlow. Apache-2.0 core.