Create Videos with Code
MIT License
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 examples repository, and join our Discord server.
To create an example project, run the following command:
npm init @revideo@latest
The example project will have the following code, which defines the video shown below.
import {Audio, Img, Video, makeScene2D} from '@revideo/2d';
import {all, chain, createRef, waitFor} from '@revideo/core';
export default makeScene2D(function* (view) {
const logoRef = createRef<Img>();
yield view.add(
<>
<Video
src={'https://revideo-example-assets.s3.amazonaws.com/stars.mp4'}
size={['100%', '100%']}
play={true}
/>
<Audio
src={'https://revideo-example-assets.s3.amazonaws.com/chill-beat.mp3'}
play={true}
time={17.0}
/>
</>,
);
yield* waitFor(1);
view.add(
<Img
width={'1%'}
ref={logoRef}
src={
'https://revideo-example-assets.s3.amazonaws.com/revideo-logo-white.png'
}
/>,
);
yield* chain(
all(logoRef().scale(40, 2), logoRef().rotation(360, 2)),
logoRef().scale(60, 1),
);
});
https://github.com/havenhq/revideo/assets/122226645/4d4e56ba-5143-4e4b-9acf-d8a04330d162
Motion Canvas aims to be a standalone editor for 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:
seek()
operation for HTML video with our ffmpeg-based<Video/>
tags<Audio/>
tag that makes it easy toTo understand how people use Revideo, we anonymously track how many videos are rendered using the open-source tool Posthog. You can find our code implementing Posthog here.
If you want to disable telemetry, just set the following environment variable:
DISABLE_TELEMETRY=true
To learn more about Revideo, feel free to check out our documentation or join our Discord server.