Revideo

Create Videos with Code

README

Revideo - Create Videos with Code


Revideo is an open source framework for programmatic video editing. It is forked
from the amazing Motion Canvas editor, with the goal
of turning it from a standalone application into a library that developers can
use to build entire video editing apps.

Revideo lets you create video templates in Typescript and deploy an API endpoint
to render them with dynamic inputs. It also provides a React player component to
preview changes in the browser in real-time. If you want to learn more, you can
check out our docs, our

News 🔥


- [05/21/2024] We released an
  on how to parallelize rendering jobs with Google Cloud Functions
- [05/20/2024] We have a new website!

Getting Started


To create an example project, run the following command:

  1. ```bash
  2. npm init @revideo@latest
  3. ```

The example project will have the following code, which defines the video shown
below.

  1. ```tsx
  2. import {Audio, Img, Video, makeScene2D} from '@revideo/2d';
  3. import {all, chain, createRef, waitFor} from '@revideo/core';

  4. export default makeScene2D(function* (view) {
  5.   const logoRef = createRef<Img>();

  6.   yield view.add(
  7.     <>
  8.       <Video
  9.         src={'https://revideo-example-assets.s3.amazonaws.com/stars.mp4'}
  10.         size={['100%', '100%']}
  11.         play={true}
  12.       />
  13.       <Audio
  14.         src={'https://revideo-example-assets.s3.amazonaws.com/chill-beat.mp3'}
  15.         play={true}
  16.         time={17.0}
  17.       />
  18.     </>,
  19.   );

  20.   yield* waitFor(1);

  21.   view.add(
  22.     <Img
  23.       width={'1%'}
  24.       ref={logoRef}
  25.       src={
  26.         'https://revideo-example-assets.s3.amazonaws.com/revideo-logo-white.png'
  27.       }
  28.     />,
  29.   );

  30.   yield* chain(
  31.     all(logoRef().scale(40, 2), logoRef().rotation(360, 2)),
  32.     logoRef().scale(60, 1),
  33.   );
  34. });
  35. ```

Differences between Revideo and Motion Canvas


Motion Canvas aims to be a
animations. While it happens to be distributed as an npm package, the
maintainers don't intend for it to be used as a library.

We started out as users of Motion Canvas ourselves but ran into these
limitations when we wanted to build a video editing app on top of it. After
building our initial version using Motion Canvas' plugin system, we realized
that we wanted to make more fundamental changes to the codebase that would be
difficult to implement while keeping compatibility with the existing Motion
Canvas API.

That's why we decided to fork the project and turn it into Revideo. We wrote a
bit more about it on our blog.

Concretely, some of the differences to Motion Canvas are the following ones:

- Headless Rendering: Motion Canvas currently requires you to press a button
  in its UI to render a video. We have exposed this functionality as a
  function call and are making it
  possible to deploy a rendering API to services like Google Cloud Run
  (example,
  or to use our CLI to expose a rendering endpoint from your Revideo project
  (docs)
- Faster Rendering: When building an app rather than creating videos for
  yourself, rendering speeds are quite important. We have sped up rendering
  speeds by enabling
  replacing the seek() operation for HTML video with our ffmpeg-based
- **Better Audio Support:** We have enabled audio export from `