MCPcopy
hub / github.com/midrender/revideo

github.com/midrender/revideo @v0.10.4 sqlite

repository ↗ · DeepWiki ↗ · release v0.10.4 ↗
2,151 symbols 5,810 edges 575 files 263 documented · 12%
README

  <img width="360" alt="Revideo logo" src="https://github.com/midrender/revideo/raw/v0.10.4/logo.svg">

published with lerna powered by vite npm package version discord

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 examples repository, and join our Discord server.

News 🔥

  • [05/21/2024] We released an example 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:

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('scene', 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

Differences between Revideo and Motion Canvas

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:

  • 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 parallelized rendering and replacing the seek() operation for HTML video with our ffmpeg-based video frame extractor
  • Better Audio Support: We have enabled audio export from <Video/> tags during rendering, and have also added an <Audio/> tag that makes it easy to synchronize audio with your animations.

Telemetry

To 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

Learn More

To learn more about Revideo, feel free to check out our documentation or join our Discord server.

Extension points exported contracts — how you extend this code

Type (Interface)
(no doc) [8 implementers]
packages/core/src/types/Type.ts
SourceNode (Interface)
(no doc) [4 implementers]
packages/vite-plugin/src/partials/webgl.ts
CodeSignalHelpers (Interface)
(no doc) [2 implementers]
packages/2d/src/lib/code/CodeSignal.ts
Panel (Interface)
(no doc) [2 implementers]
packages/ui/src/contexts/panels.tsx
Window (Interface)
(no doc)
packages/renderer/client/render.ts
MotionCanvasPlayerProps (Interface)
(no doc)
packages/player/types/main.d.ts
RevideoPlayerProps (Interface)
(no doc)
packages/player-react/src/index.tsx
FFmpegExporterSettings (Interface)
(no doc)
packages/ffmpeg/src/ffmpeg-exporter-server.ts

Core symbols most depended-on inside this repo

signal
called by 150
packages/2d/src/lib/decorators/signal.ts
add
called by 104
packages/vite-plugin/src/partials/webgl.ts
initial
called by 101
packages/2d/src/lib/decorators/signal.ts
computed
called by 85
packages/2d/src/lib/decorators/computed.ts
scale
called by 82
packages/core/src/types/Vector.ts
map
called by 64
packages/core/src/tweening/helpers.ts
get
called by 61
packages/core/src/scenes/Variables.ts
createSignal
called by 54
packages/core/src/signals/createSignal.ts

Shape

Method 986
Function 735
Interface 223
Class 192
Enum 15

Languages

TypeScript100%

Modules by API surface

packages/2d/src/lib/components/Node.ts88 symbols
packages/2d/src/lib/components/Layout.ts48 symbols
packages/core/src/types/Vector.ts43 symbols
packages/core/src/scenes/Scene.ts35 symbols
packages/core/src/app/Player.ts35 symbols
packages/core/src/types/BBox.ts34 symbols
packages/core/src/tweening/timingFunctions.ts34 symbols
packages/2d/src/lib/components/SVG.ts34 symbols
packages/core/src/types/Matrix2D.ts33 symbols
packages/core/src/scenes/GeneratorScene.ts31 symbols
packages/2d/src/lib/components/CodeBlock.ts28 symbols
packages/2d/src/lib/components/Media.ts26 symbols

Dependencies from manifests, versioned

@codemirror/language6.10.1 · 1×
@commitlint/cli19.4.0 · 1×
@commitlint/config-conventional19.2.2 · 1×
@ffmpeg-installer/ffmpeg1.1.0 · 1×
@ffprobe-installer/ffprobe2.0.0 · 1×
@lezer/common1.2.1 · 1×
@lezer/highlight1.2.0 · 1×
@preact/preset-vite2.5.0 · 1×
@preact/signals1.2.1 · 1×
@revideo/2d* · 1×
@revideo/core0.10.4 · 1×
@revideo/ffmpeg0.10.4 · 1×

For agents

$ claude mcp add revideo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact