RepositoryTypeScriptCACanada
ybouane

ybouane/VideoFlow

Programmatic video for the web. Define videos with a fluent TypeScript API, compile them to a portable JSON format, and render to MP4 — in the browser, on the server, or play them back live with full scrubbing controls.

174stars
37forks
6issues
5views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: programmatic

#1 Repository of the week

2
TINIX TRENDING·Topic: remotion-alternative

#2 Repository of the week

2
TINIX TRENDING·Topic: remotion-video

#2 Repository of the week

VideoFlow — programmatic video for the web

VideoFlow

npm license

Programmatic video for the web. Define videos with a fluent TypeScript API, compile them to a portable JSON format, and render to MP4 — in the browser, on the server, or play them back live with full scrubbing controls.

Try it live: videoflow.dev/playground · Docs: videoflow.dev


Why VideoFlow?

  • Code your video like a script. A flow-style API where wait, parallel, and per-layer animate advance a timeline you can read top-to-bottom.
  • One JSON, three renderers. Compile once, render anywhere — server-side MP4, browser-side MP4, or live DOM playback for editors.
  • Built-in transitions and shader effects. 25+ enter/exit presets (slideUp, blurResolve, glitchResolve, typewriter, numberCountUp, …) and a WebGL effect pipeline (bloom, chromaticAberration, colorCorrection, …) — animate any param.
  • Resolution-independent units. Sizes default to em where 1em = 1% of the project width, so a layout written for 1920×1080 renders identically at 720p or 4K.
  • Editor-ready. The same JSON model powers a drop-in React video editor — your code-built videos and your editor scenes share the same format.

Packages

This monorepo publishes four npm packages — install only what you need.

PackageWhat it doesDocs
@videoflow/coreDefine and compose videos with the fluent API · compile to portable JSONCore docs
@videoflow/renderer-domLive preview / scrubbable playback in the browserRenderers docs
@videoflow/renderer-browserRender to MP4 entirely client-side (WebCodecs + MediaBunny)Renderers docs
@videoflow/renderer-serverRender to MP4 on Node.js via headless ChromiumRenderers docs

There's also a separate React component for building visual editors on top of this format → VideoFlow React Video Editor.


Installation

# Core (always required)
npm install @videoflow/core

# Pick a renderer for your environment:
npm install @videoflow/renderer-server          # Node.js → MP4
npx playwright install chromium                 #   one-time browser download

# or
npm install @videoflow/renderer-browser         # Browser → MP4
npm install @videoflow/renderer-dom             # Browser → live preview

renderVideo() auto-detects the environment and dynamically imports the matching renderer, so you usually only need to install one alongside @videoflow/core.


Quick Start

import VideoFlow from '@videoflow/core';

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

const title = $.addText({
  text: 'Hello, VideoFlow!',
  fontSize: 7,
  fontWeight: 800,
  color: '#ffffff',
});

title.animate(
  { opacity: 0, scale: 0.8 },
  { opacity: 1, scale: 1 },
  { duration: '0.8s' },
);
$.wait('1.5s');
title.animate(
  { opacity: 1, scale: 1 },
  { opacity: 0, scale: 1.2 },
  { duration: '0.8s' },
);

// Auto-detects environment and renders to MP4
await $.renderVideo({
  outputType: 'file',
  output: './hello.mp4',
  verbose: true,
});

Run it with:

npx tsx hello.ts

Compile once, render later

$.compile() produces a fully self-describing VideoJSON you can store, send over the wire, or hand to any VideoFlow renderer:

const json = await $.compile();
// → { width, height, fps, duration, layers, ... }

Pick a specific renderer

// Server (Node.js)
import VideoRenderer from '@videoflow/renderer-server';
await VideoRenderer.render(json, { outputType: 'file', output: './out.mp4' });

// Browser (MP4 export)
import VideoRenderer from '@videoflow/renderer-browser';
const blob = await VideoRenderer.render(json);

// Browser (live preview)
import DomRenderer from '@videoflow/renderer-dom';
const player = new DomRenderer(document.getElementById('player'));
await player.loadVideo(json);
await player.play();

A taste of the API

const $ = new VideoFlow({ width: 1920, height: 1080, fps: 30, backgroundColor: '#0a0d18' });

// Background image with a colour-correction sweep
$.addImage(
  {
    fit: 'cover',
    effects: [{ effect: 'colorCorrection', params: { saturation: 1.2, contrast: 1.1 } }],
  },
  { source: './hero.jpg' },
);

// Two text lines that slide in in parallel, hold, then fade out together
const heading = $.addText(
  { text: 'Built with VideoFlow', fontSize: 6, fontWeight: 800 },
  { transitionIn: { transition: 'slideUp', duration: '500ms' } },
);
const sub = $.addText(
  { text: 'Code → JSON → MP4', fontSize: 3, position: [0.5, 0.6], color: '#94a3b8' },
  { transitionIn: { transition: 'slideUp', duration: '500ms' }, startTime: '0.15s' },
);

$.wait('3s');
$.parallel([
  () => heading.fadeOut('500ms'),
  () => sub.fadeOut('500ms'),
]);

await $.renderVideo({ outputType: 'file', output: './out.mp4' });

Group layers

Composite a sub-tree as a single unit. Transitions, animations, and effects on the group apply to the whole composite — child timings are relative to the group's start.

$.group(
  { position: [0.5, 0.5], scale: 1 },
  { transitionIn: { transition: 'zoom', duration: '600ms' } },
  () => {
    $.addShape({ width: 30, height: 18, fill: '#0e1524', cornerRadius: 2 }, { shapeType: 'rectangle' });
    $.addText({ text: 'CARD', fontSize: 4, fontWeight: 800 });
  },
);

Visual properties at a glance

All visual layers (text, image, video, captions, shape, group) share the same transform / styling vocabulary:

PropertyTypeDefaultNotes
position[x, y] or [x, y, z][0.5, 0.5]Normalised 0–1 of the canvas; z adds depth in em
scalenumber or [x, y]1Uniform or per-axis multiplier
rotationnumber or [x, y, z]0Degrees, clockwise. [x, y, z] for 3D
anchor[x, y][0.5, 0.5]Normalised pivot inside the element
opacity0–11Animatable
blendModeCSS mix-blend-mode'normal''multiply', 'screen', 'difference', …
perspectivenumber (em)1003D viewing distance
effectsEffectSpec[][]WebGL pipeline; each param animatable via dot-paths

See @videoflow/core for the complete property list (filters, borders, shadows, text styling, audio …) plus the full transition + effect catalogue.

Time formats

Anywhere a duration or time appears (startTime, duration, wait, sourceDuration, …) you can pass a number (seconds) or one of:

FormExampleMeaning
Seconds'5s'5 seconds
Milliseconds'500ms'500 ms
Minutes / hours'2m', '1h'2 minutes / 1 hour
Frames'120f'120 frames at the project's fps
Timecode'01:30', '01:02:30', '01:02:30:15'mm:ss / hh:mm:ss / hh:mm:ss:ff

Examples

The examples/ folder contains 11 runnable scripts that double as a feature tour. Each compiles a project and renders an MP4.

ExampleWhat it shows
01-basic-text.tsaddText with a fade + scale animation
02-image-background.tsImage background with an animated blur
03-video-with-audio.tsVideo layer + parallel music track
04-captions.tsTime-coded addCaptions overlay
05-parallel-animations.ts$.parallel with staggered children
06-render-frame-and-audio.tsRender a single frame or just the audio
07-abort-controller.tsCancel a render mid-flight via AbortController
08-transitions.tsBuilt-in transition presets showcase
09-effects.tsWebGL effects (bloom, glitch, frosted glass)
10-groups.tsComposing sub-trees with shared transitions
11-keyframe-animations.tsKeyframe-driven scale / position / rotation / blur
npx tsx examples/01-basic-text.ts

Building from source

git clone https://github.com/ybouane/VideoFlow.git
cd VideoFlow
npm install
npm run build

Resources

License

Apache-2.0

Similar Projects

Discover other similar projects and AI models.

RepositoryTypeScript
mohyware/clip-js

online video editor built with nextjs, remotion and ffmpeg (web assembly port) for render.

776
Aug 3, 2026
RepositoryTypeScript
mifi/lossless-cut

The swiss army knife of lossless video/audio editing

46.6k
Nov 25, 2026
RepositoryTypeScript
openvideodev/react-video-editor

Online react video editor using remotion. Capcut and canva clone.

1.8k
Jun 30, 2026
RepositoryTypeScript
shadcn-labs/snapcn

A shadcn registry of Remotion components for product demo videos. Install a text reveal, device frame, terminal session, logo sting or a whole scene with a command.

731
Dec 1, 2026
RepositoryTypeScript
Hainrixz/editor-pro-max

AI-powered video editor by @soyenriquerocha — built with Remotion + Claude Code. Describe videos in natural language, get professional MP4s. 25 components, 9 templates, 7 skills.

317
Oct 25, 2026
RepositoryTypeScript
Cuongyd196/remotion-cuongit-template

Bộ skill cho AI agent tạo video ngắn 9:16 bằng Remotion: giải thích chủ đề, giới thiệu GitHub repo, so sánh hai lựa chọn.

260
Nov 7, 2026
RepositoryTypeScript
remotion-dev/remotion

🎥 Make videos programmatically with React

77.2k
Dec 2, 2026
RepositoryRust
storytold/filmcraft

FilmCraft: An open-source, nonlinear video editor written from scratch in pure Rust

19.3k
Dec 1, 2026
RepositoryTypeScript
videojs/video.js

Video.js v10 - open source media player framework for HTML and React.

40.3k
Nov 27, 2026