DEV Community

WonderLab
WonderLab

Posted on

Open Source Project of the Day (Part 2): Remotion - Create Videos Programmatically with React

Introduction

"What if video production worked just like writing code — built with components, functions, and logic?"

This is Part 2 of the "Open Source Project of the Day" series. Today we explore Remotion (GitHub).

Imagine no longer needing to open After Effects or Premiere Pro, no more manually adjusting every frame — instead, creating videos with code just like writing React components. That's the revolutionary experience Remotion delivers.

Why this project?

  • 🎬 Revolutionary concept: Create videos with React and web technologies, breaking the barriers of traditional video production
  • 🚀 Developer-friendly: Familiar React syntax with full TypeScript support
  • 🎨 Powerful capabilities: Supports CSS, Canvas, SVG, WebGL and all other web technologies
  • 🌟 Community recognized: 29.8k+ Stars, used by GitHub Unwrapped, Fireship, and other well-known projects
  • 📦 Complete ecosystem: Rich documentation, examples, and community support

What You'll Learn

  • Core concepts and how Remotion works
  • How to create video content using React components
  • Remotion's architecture design and key technical implementation
  • Real-world use cases and best practices
  • Comparative analysis with other video production tools
  • How to get started creating your first video with Remotion

Prerequisites

  • React basics (components, Hooks, JSX)
  • TypeScript basics (optional but recommended)
  • CSS and animation basics
  • Node.js and npm/yarn/pnpm experience
  • (Optional) Basic video production knowledge

Project Background

Project Introduction

Remotion is a framework for creating videos programmatically using React. It allows developers to create high-quality video content using familiar React syntax, web technologies (CSS, Canvas, SVG, WebGL), and programming logic.

Core problems the project solves:

  • Traditional video production tools (like After Effects) have steep learning curves that are difficult for non-designers
  • Video production processes are hard to version control and automate
  • Traditional tools are inefficient when creating large numbers of similar videos
  • Video production can't be reused, composed, and tested like code

Target user groups:

  • Frontend developers who want to create video content with code
  • Applications that need to batch-generate personalized videos (e.g., year-in-review, data visualizations)
  • Teams that want to integrate video production into their development workflow
  • SaaS products that need to generate videos programmatically

Author/Team Introduction

Team: remotion-dev

  • Background: Focused on developing tools for creating videos with code
  • Achievement: Remotion is used by multiple well-known projects, including:
    • GitHub Unwrapped: GitHub's annual personalized year-in-review videos
    • Fireship: Well-known tech education channel uses Remotion to create videos
    • Thousands of production applications
  • Philosophy: Make video production as simple, reusable, and automatable as writing code

Project creation date: 2020 (based on GitHub commit history, the project has been growing for years)

Project Stats

  • GitHub Stars: 29.8k+ (rapidly and continuously growing)
  • 🍴 Forks: 1.8k+
  • 📦 Version: v4.0.409 (latest version, released January 22, 2026)
  • 📄 License: Special license (some commercial uses require a company license, see LICENSE.md)
  • 🌐 Website: remotion.dev
  • 📚 Documentation: remotion.dev/docs
  • 📖 API Reference: remotion.dev/api
  • 💬 Community: Active Discord community
  • 📦 NPM: Hundreds of thousands of weekly downloads

Project development history:

  • 2020: Project launched, initial version released
  • 2021-2022: Rapid development, core features added, community growth
  • 2023: v3.0 released with major architectural improvements
  • 2024: v4.0 released with performance optimization and new features
  • 2025-2026: Continuous iteration, adding more features and optimizations

Notable use cases:

  • GitHub Unwrapped: Generates personalized annual summary videos for GitHub users every year
  • Fireship: Fast production of tech education videos
  • Thousands of production applications are using Remotion

Main Features

Core Purpose

Remotion's core purpose is to let developers create videos programmatically using React and web technologies, enabling:

  1. Code-driven video production: Build videos with React components, functions, and logic
  2. Web technology stack: Fully leverage CSS, Canvas, SVG, WebGL, and other web technologies
  3. Reusable and composable: Like React components, video segments can be reused and composed
  4. Version control: The video production process can be version-controlled just like code
  5. Automated generation: Batch-generate personalized videos, integrate into CI/CD pipelines

Use Cases

  1. Personalized video generation

    • Annual summary videos (like GitHub Unwrapped)
    • User data visualization videos
    • Personalized marketing videos
    • Dynamic report videos
  2. Data visualization videos

    • Chart animation videos
    • Data-driven animations
    • Real-time data visualizations
    • Statistical report videos
  3. Product demos and tutorials

    • Product feature introduction videos
    • Technical tutorial videos
    • Code demonstration animations
    • Interactive demo videos
  4. Social media content

    • Batch-generate social media videos
    • Dynamic logo animations
    • Brand promotion videos
    • Holiday greeting videos
  5. Automated video production

    • Integrate into CI/CD pipelines
    • Automated test videos
    • Batch processing videos
    • Dynamic content updates

Quick Start

Installation and Setup

# If Node.js is installed, run directly
npx create-video@latest

# Or use npm
npm create video@latest

# Or use yarn
yarn create video

# Or use pnpm
pnpm create video
Enter fullscreen mode Exit fullscreen mode

Simplest Video Example

Create your first Remotion video:

// src/Root.tsx
import { Composition } from 'remotion';
import { HelloWorld } from './HelloWorld';

export const RemotionRoot: React.FC = () => {
  return (
    <>
      <Composition
        id="HelloWorld"
        component={HelloWorld}
        durationInFrames={150}
        fps={30}
        width={1920}
        height={1080}
      />
    </>
  );
};
Enter fullscreen mode Exit fullscreen mode
// src/HelloWorld.tsx
import { useCurrentFrame } from 'remotion';

export const HelloWorld: React.FC = () => {
  const frame = useCurrentFrame();
  const opacity = frame >= 20 ? 1 : frame / 20;

  return (
    <div
      style={{
        flex: 1,
        textAlign: 'center',
        fontSize: '7em',
        opacity,
      }}
    >
      Hello World
    </div>
  );
};
Enter fullscreen mode Exit fullscreen mode

Preview and Render

# Start development server (preview)
npm run dev

# Render video
npm run build
Enter fullscreen mode Exit fullscreen mode

Core Features

  1. React component system

    • Uses familiar React syntax
    • Supports all React Hooks
    • Components are reusable and composable
    • Full TypeScript support
  2. Timeline control

    • useCurrentFrame(): Get the current frame number
    • useVideoConfig(): Get video configuration
    • interpolate(): Frame interpolation function
    • spring(): Spring animation function
  3. Rich animation capabilities

    • CSS animations and transitions
    • Canvas 2D and WebGL
    • SVG animations
    • Custom animation functions
  4. Video composition

    • Multi-track video composition
    • Audio support
    • Video segment composition
    • Transition effects
  5. Data-driven

    • Fetch data from APIs
    • Dynamic content generation
    • Batch video generation
    • Template system
  6. Developer tools

    • Real-time preview
    • Timeline editor
    • Performance profiling
    • Hot reload
  7. Rendering options

    • Local rendering
    • Cloud rendering (Remotion Cloud)
    • Lambda function rendering
    • Custom renderer
  8. Rich ecosystem

    • Official plugins and templates
    • Community-contributed components
    • Example projects
    • Detailed documentation

Project Advantages

Compared to other video production tools, Remotion's advantages:

Comparison Remotion After Effects FFmpeg MoviePy
Learning curve ⭐⭐⭐⭐⭐ Just know React ⭐⭐ Need to learn professional software ⭐⭐ CLI tool ⭐⭐⭐ Python library
Version control ⭐⭐⭐⭐⭐ Code is version-controllable ⭐⭐ Binary files ⭐⭐⭐ Scripts are version-controllable ⭐⭐⭐ Scripts are version-controllable
Automation ⭐⭐⭐⭐⭐ Fully programmable ⭐⭐ Requires scripting ⭐⭐⭐⭐ CLI automation ⭐⭐⭐⭐ Python automation
Reusability ⭐⭐⭐⭐⭐ React component reuse ⭐⭐⭐ Template system ⭐⭐ Script reuse ⭐⭐⭐ Function reuse
Web technologies ⭐⭐⭐⭐⭐ Fully supported ⭐ Not supported ⭐ Not supported ⭐ Not supported
Batch generation ⭐⭐⭐⭐⭐ Natively supported ⭐⭐ Requires scripting ⭐⭐⭐⭐ Script support ⭐⭐⭐⭐ Script support
Cost ⭐⭐⭐⭐ Open source (commercial needs license) ⭐⭐ Subscription-based ⭐⭐⭐⭐⭐ Completely free ⭐⭐⭐⭐⭐ Completely free
Community ⭐⭐⭐⭐ Active community ⭐⭐⭐⭐⭐ Large community ⭐⭐⭐⭐⭐ Large community ⭐⭐⭐ Smaller community

Why choose Remotion?

  • Developer-friendly: If you know React, almost zero learning curve
  • Code-driven: Video production can be version-controlled, tested, and automated
  • Web technology stack: Use all familiar web technologies
  • Batch generation: Natively supports batch-generating personalized videos
  • Integrable: Can integrate into existing development workflows
  • Active community: Rich documentation, examples, and community support

Detailed Project Analysis

Architecture Design

Remotion adopts a layered architecture at whose core is rendering React components as video frames:

┌─────────────────────────────────────┐
│   React Components (written by dev) │
│   - Using useCurrentFrame()         │
│   - Using interpolate() and Hooks   │
└──────────────┬──────────────────────┘
               │
┌──────────────▼──────────────────────┐
│   Remotion Core                      │
│   - Frame rendering engine          │
│   - Timeline management             │
│   - Component lifecycle             │
└──────────────┬──────────────────────┘
               │
┌──────────────▼──────────────────────┐
│   Rendering Layer                   │
│   - Puppeteer/Playwright            │
│   - Frame capture                   │
│   - Video encoding                  │
└─────────────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

Core Concepts

1. Composition

Composition is Remotion's core concept, defining the basic properties of a video:

<Composition
  id="MyVideo"              // Unique identifier
  component={MyComponent}   // React component
  durationInFrames={150}     // Total frames
  fps={30}                   // Frame rate
  width={1920}               // Width
  height={1080}              // Height
/>
Enter fullscreen mode Exit fullscreen mode

Design characteristics:

  • Each Composition corresponds to one video
  • Multiple Compositions can be defined
  • Supports different resolutions and frame rates

2. Timeline and Frames

Remotion uses frames as the unit of time, not seconds:

import { useCurrentFrame, useVideoConfig } from 'remotion';

export const MyComponent: React.FC = () => {
  const frame = useCurrentFrame();  // Current frame number (0, 1, 2, ...)
  const { fps, durationInFrames } = useVideoConfig();

  // Convert frames to seconds
  const seconds = frame / fps;

  // Calculate progress (0 to 1)
  const progress = frame / durationInFrames;

  return <div>Frame: {frame}</div>;
};
Enter fullscreen mode Exit fullscreen mode

Design philosophy:

  • Frames are discrete, enabling precise control
  • Frames = seconds × frame rate
  • All animations are calculated based on frames

3. Animation Functions

Remotion provides powerful animation functions:

interpolate:

import { interpolate } from 'remotion';

const opacity = interpolate(
  frame,
  [0, 30],      // Input range (frames)
  [0, 1],       // Output range (values)
  {
    extrapolateLeft: 'clamp',  // Handle values below input range
    extrapolateRight: 'clamp', // Handle values above input range
  }
);
Enter fullscreen mode Exit fullscreen mode

spring (spring animation):

import { spring } from 'remotion';

const scale = spring({
  frame,
  fps: 30,
  config: {
    damping: 200,
    stiffness: 200,
    mass: 0.5,
  },
});
Enter fullscreen mode Exit fullscreen mode

Design characteristics:

  • Multiple animation functions available
  • Supports custom animation curves
  • Performance optimized to avoid unnecessary calculations

4. Video Composition

Remotion supports complex video composition:

import { Sequence } from 'remotion';

export const MyVideo: React.FC = () => {
  return (
    <>
      <Sequence from={0} durationInFrames={30}>
        <Intro />
      </Sequence>
      <Sequence from={30} durationInFrames={60}>
        <MainContent />
      </Sequence>
      <Sequence from={90} durationInFrames={30}>
        <Outro />
      </Sequence>
    </>
  );
};
Enter fullscreen mode Exit fullscreen mode

Design characteristics:

  • Sequence is used for segments on the timeline
  • Supports multi-track composition
  • Supports audio tracks

Key Technical Implementation

1. Frame Rendering Mechanism

How it works:

  1. Remotion uses Puppeteer or Playwright to launch a headless browser
  2. Renders React components to Canvas
  3. Captures frames one by one
  4. Uses FFmpeg to encode the frame sequence into a video

Optimization strategies:

  • Frame caching mechanism
  • Parallel rendering
  • Incremental rendering (only render changed parts)

2. Timeline Synchronization

Challenge: Ensuring all components display the correct state at the same frame

Solution:

  • Global frame state management
  • Components synchronously update per frame
  • Avoid async operations affecting the timeline

3. Performance Optimization

Optimization techniques:

  • Frame caching: Cache already-rendered frames
  • Incremental rendering: Only re-render changed parts
  • Parallel processing: Multi-process/multi-thread rendering
  • Memory management: Timely release of unneeded resources

Extension Mechanisms

1. Plugin System

Remotion supports a rich plugin ecosystem:

# Install plugins
npm install @remotion/lottie
npm install @remotion/three
npm install @remotion/player
Enter fullscreen mode Exit fullscreen mode

Official plugins:

  • @remotion/lottie: Lottie animation support
  • @remotion/three: Three.js 3D support
  • @remotion/player: Video player component
  • @remotion/lambda: AWS Lambda rendering support

2. Custom Hooks

You can create custom Hooks to reuse logic:

function useFadeIn(durationInFrames: number) {
  const frame = useCurrentFrame();
  return interpolate(frame, [0, durationInFrames], [0, 1]);
}

export const MyComponent: React.FC = () => {
  const opacity = useFadeIn(30);
  return <div style={{ opacity }}>Fade In</div>;
};
Enter fullscreen mode Exit fullscreen mode

3. Templates and Examples

Remotion provides rich templates and examples:

  • GitHub Unwrapped template
  • Data visualization templates
  • Product demo templates
  • Social media templates

Project Resources

Official Resources

Related Resources


Welcome to visit my personal homepage for more useful knowledge and interesting products

Top comments (0)