Convert Figma logo to code with AI

remotion-dev logoremotion

🎥 Make videos programmatically with React

46,558
3,198
46,558
93

Top Related Projects

React runtime for Rive

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/

32,901

A modern animation library for React and JavaScript

✌️ A spring physics based React animation library

🇨🇭 A React renderer for Three.js

24,466

GSAP (GreenSock Animation Platform), a JavaScript animation library for the modern web

Quick Overview

Remotion is a powerful framework for creating videos programmatically using React. It allows developers to leverage their web development skills to produce high-quality videos with dynamic content, animations, and custom logic.

Pros

  • Utilizes familiar React concepts and components for video creation
  • Offers fine-grained control over video composition and timing
  • Supports integration with external data sources and APIs
  • Provides a rich ecosystem of plugins and extensions

Cons

  • Steep learning curve for those new to video production concepts
  • Rendering can be resource-intensive for complex compositions
  • Limited built-in video editing features compared to traditional video software
  • Requires Node.js environment for video rendering

Code Examples

  1. Creating a simple video composition:
import {Composition} from 'remotion';
import {MyComposition} from './MyComposition';

export const RemotionVideo: React.FC = () => {
  return (
    <Composition
      id="MyVideo"
      component={MyComposition}
      durationInFrames={150}
      fps={30}
      width={1920}
      height={1080}
    />
  );
};
  1. Animating elements using interpolation:
import {useCurrentFrame, interpolate} from 'remotion';

export const AnimatedText: React.FC = () => {
  const frame = useCurrentFrame();
  const opacity = interpolate(frame, [0, 30], [0, 1]);
  
  return <h1 style={{opacity}}>Hello, Remotion!</h1>;
};
  1. Incorporating audio into a composition:
import {Audio} from 'remotion';

export const VideoWithAudio: React.FC = () => {
  return (
    <div>
      <h1>My Video Content</h1>
      <Audio src="path/to/audio.mp3" />
    </div>
  );
};

Getting Started

To start using Remotion, follow these steps:

  1. Install Remotion:

    npm init video
    
  2. Create a new composition in src/Composition.tsx:

    import {useCurrentFrame} from 'remotion';
    
    export const MyComposition = () => {
      const frame = useCurrentFrame();
      return <div>The current frame is {frame}</div>;
    };
    
  3. Preview your video:

    npm start
    
  4. Render your video:

    npm run build
    

For more detailed instructions and advanced features, refer to the official Remotion documentation.

Competitor Comparisons

React runtime for Rive

Pros of Rive React

  • Lightweight and optimized for performance, especially for mobile devices
  • Supports interactive animations with real-time user input
  • Seamless integration with React components

Cons of Rive React

  • Limited to Rive-specific animations, less flexible for custom animations
  • Steeper learning curve for designers not familiar with Rive's tooling
  • Smaller community and ecosystem compared to Remotion

Code Comparison

Rive React:

import { useRive } from '@rive-app/react-canvas';

function MyComponent() {
  const { rive, RiveComponent } = useRive({
    src: 'animation.riv',
    stateMachines: 'State Machine 1',
  });

  return <RiveComponent />;
}

Remotion:

import { Composition } from 'remotion';
import { MyAnimation } from './MyAnimation';

export const RemotionVideo = () => {
  return (
    <Composition
      id="MyAnimation"
      component={MyAnimation}
      durationInFrames={120}
      fps={30}
      width={1920}
      height={1080}
    />
  );
};

Summary

Rive React excels in lightweight, interactive animations for React applications, particularly on mobile devices. It offers seamless integration but is limited to Rive-specific animations. Remotion, on the other hand, provides more flexibility for custom animations and has a larger community, but may have a higher performance overhead for simpler animations.

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/

Pros of Lottie-web

  • Lightweight and efficient for simple animations
  • Wide browser support and easy integration
  • Large ecosystem of pre-made animations

Cons of Lottie-web

  • Limited to vector animations, less flexible for complex video-like content
  • Requires designers to use specific tools (e.g., After Effects) for creating animations
  • Less control over runtime behavior and interactivity

Code Comparison

Lottie-web:

lottie.loadAnimation({
  container: document.getElementById('lottie-container'),
  renderer: 'svg',
  loop: true,
  autoplay: true,
  path: 'animation.json'
});

Remotion:

import { Composition } from 'remotion';
import { MyAnimation } from './MyAnimation';

export const RemotionVideo = () => {
  return (
    <Composition
      id="MyAnimation"
      component={MyAnimation}
      durationInFrames={120}
      fps={30}
      width={1920}
      height={1080}
    />
  );
};
32,901

A modern animation library for React and JavaScript

Pros of Motion

  • Simpler API and easier learning curve for beginners
  • Lightweight and focused on animation, with a smaller bundle size
  • Better performance for simple animations due to its streamlined approach

Cons of Motion

  • Less comprehensive feature set compared to Remotion
  • Limited support for complex video editing and composition
  • Smaller community and ecosystem, potentially leading to fewer resources and plugins

Code Comparison

Motion:

import { motion } from "framer-motion"

const Box = () => (
  <motion.div
    animate={{ x: 100 }}
    transition={{ duration: 2 }}
  />
)

Remotion:

import { spring, useCurrentFrame, useVideoConfig } from "remotion"

const Box = () => {
  const frame = useCurrentFrame()
  const { fps } = useVideoConfig()
  const x = spring({ frame, fps, from: 0, to: 100 })
  return <div style={{ transform: `translateX(${x}px)` }} />
}

Motion focuses on simplicity and ease of use, with a more declarative approach to animations. Remotion offers more fine-grained control over animation timing and frames, catering to more complex video production needs. While Motion is great for simple web animations, Remotion excels in creating full-fledged video content programmatically.

✌️ A spring physics based React animation library

Pros of react-spring

  • Lightweight and focused on spring animations
  • Easier to integrate into existing React projects
  • More suitable for UI animations and transitions

Cons of react-spring

  • Limited to React applications
  • Not designed for complex video creation or editing

Code Comparison

react-spring:

import { useSpring, animated } from 'react-spring'

function AnimatedComponent() {
  const props = useSpring({ opacity: 1, from: { opacity: 0 } })
  return <animated.div style={props}>I will fade in</animated.div>
}

Remotion:

import { useCurrentFrame } from 'remotion'

export const MyVideo = () => {
  const frame = useCurrentFrame()
  return <div style={{ opacity: frame / 60 }}>Fade in over 1 second</div>
}

Summary

react-spring is a powerful animation library for React applications, focusing on spring physics-based animations. It's lightweight and easy to integrate into existing projects, making it ideal for UI animations and transitions.

Remotion, on the other hand, is a comprehensive framework for creating videos programmatically using React. It offers more advanced features for video creation and editing but may be overkill for simple UI animations.

Choose react-spring for lightweight UI animations in React applications, and Remotion for complex video creation tasks requiring programmatic control.

🇨🇭 A React renderer for Three.js

Pros of react-three-fiber

  • Specialized for 3D graphics and WebGL rendering
  • Seamless integration with Three.js, providing a React-friendly API
  • Large ecosystem of extensions and helpers for 3D development

Cons of react-three-fiber

  • Steeper learning curve for developers unfamiliar with 3D graphics concepts
  • Limited to 3D rendering, not suitable for general-purpose video creation
  • Performance may be a concern for complex 3D scenes on low-end devices

Code Comparison

react-three-fiber:

function Box(props) {
  const mesh = useRef()
  const [hovered, setHover] = useState(false)
  return (
    <mesh {...props} ref={mesh} onPointerOver={() => setHover(true)} onPointerOut={() => setHover(false)}>
      <boxGeometry args={[1, 1, 1]} />
      <meshStandardMaterial color={hovered ? 'hotpink' : 'orange'} />
    </mesh>
  )
}

Remotion:

export const MyVideo = () => {
  return (
    <Composition
      id="MyComp"
      component={MyComp}
      durationInFrames={150}
      fps={30}
      width={1920}
      height={1080}
    />
  );
};

While react-three-fiber focuses on creating 3D scenes with React components, Remotion is designed for programmatic video creation using React. The code examples highlight these different use cases, with react-three-fiber demonstrating 3D object manipulation and Remotion showcasing video composition setup.

24,466

GSAP (GreenSock Animation Platform), a JavaScript animation library for the modern web

Pros of GSAP

  • Mature and battle-tested animation library with extensive browser support
  • Powerful and flexible, capable of animating virtually any property
  • Large community and ecosystem with numerous plugins and resources

Cons of GSAP

  • Steeper learning curve for complex animations
  • Primarily focused on DOM and CSS animations, less suited for video creation
  • Requires a paid license for some advanced features and commercial use

Code Comparison

GSAP:

gsap.to(".box", {
  duration: 1,
  x: 100,
  y: 50,
  rotation: 360,
  ease: "bounce.out"
});

Remotion:

<Sequence from={0} durationInFrames={30}>
  <Animate
    start={[0, 0, 0]}
    end={[100, 50, 360]}
    easing="bounceOut"
  >
    {({x, y, rotation}) => (
      <div style={{transform: `translate(${x}px, ${y}px) rotate(${rotation}deg)`}} />
    )}
  </Animate>
</Sequence>

GSAP excels in web animations and interactive content, offering a powerful API for complex animations. Remotion, on the other hand, is specifically designed for programmatic video creation using React, making it more suitable for generating video content. While GSAP has a larger ecosystem and broader browser support, Remotion provides a more integrated approach for video production within a React environment.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Animated Remotion Logo

Discord Shield NPM Version NPM Downloads Twitter

Remotion is a framework for creating videos programmatically using React.

Why create videos in React?

  • Leverage web technologies: Use all of CSS, Canvas, SVG, WebGL, etc.
  • Leverage programming: Use variables, functions, APIs, math and algorithms to create new effects
  • Leverage React: Reusable components, Powerful composition, Fast Refresh, Package ecosystem

Created with Remotion

"This video was made with code" - Fireship Watch • Source

GitHub Unwrapped - Personalized Year in Review Try • Source

View more in the Remotion Showcase!

Get started

If you already have Node.JS installed, type

npx create-video@latest

to get started. Otherwise, read the installation page in the documentation.

Documentation

Documentation: remotion.dev/docs
API Reference: remotion.dev/api

License

Be aware of that Remotion has a special license and requires obtaining a company license in some cases. Read the LICENSE page for more information.

Contributing

Please read CONTRIBUTING.md to learn about contributing to this project.

NPM DownloadsLast 30 Days