@revideo/create 0.5.11-alpha.1102 → 0.5.11-alpha.1104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/README.md +43 -0
- package/examples/avatar-with-background/package.json +27 -0
- package/examples/avatar-with-background/src/project.meta +31 -0
- package/examples/avatar-with-background/src/project.ts +6 -0
- package/examples/avatar-with-background/src/render.ts +14 -0
- package/examples/avatar-with-background/src/revideo.d.ts +1 -0
- package/examples/avatar-with-background/src/scenes/example.meta +5 -0
- package/examples/avatar-with-background/src/scenes/example.tsx +28 -0
- package/examples/avatar-with-background/tsconfig.json +9 -0
- package/examples/avatar-with-background/vite.config.ts +8 -0
- package/examples/default/README.md +19 -0
- package/examples/default/package.json +20 -0
- package/examples/default/src/project.tsx +56 -0
- package/examples/default/src/render.ts +15 -0
- package/examples/default/tsconfig.json +10 -0
- package/examples/github-stars-celebration/package-lock.json +3833 -0
- package/examples/github-stars-celebration/package.json +24 -0
- package/examples/github-stars-celebration/src/global.css +1 -0
- package/examples/github-stars-celebration/src/project.meta +28 -0
- package/examples/github-stars-celebration/src/project.ts +8 -0
- package/examples/github-stars-celebration/src/render.ts +15 -0
- package/examples/github-stars-celebration/src/revideo.d.ts +1 -0
- package/examples/github-stars-celebration/src/scenes/example.meta +5 -0
- package/examples/github-stars-celebration/src/scenes/example.tsx +51 -0
- package/examples/github-stars-celebration/tsconfig.json +9 -0
- package/examples/github-stars-celebration/vite.config.ts +8 -0
- package/examples/google-cloud-run-parallelized/README.md +127 -0
- package/examples/google-cloud-run-parallelized/render-orchestrator/Dockerfile +56 -0
- package/examples/google-cloud-run-parallelized/render-orchestrator/package.json +22 -0
- package/examples/google-cloud-run-parallelized/render-orchestrator/src/index.ts +72 -0
- package/examples/google-cloud-run-parallelized/render-orchestrator/src/revideo.d.ts +1 -0
- package/examples/google-cloud-run-parallelized/render-orchestrator/tsconfig.json +10 -0
- package/examples/google-cloud-run-parallelized/render-worker/.gcloudignore +17 -0
- package/examples/google-cloud-run-parallelized/render-worker/.puppeteerrc.cjs +9 -0
- package/examples/google-cloud-run-parallelized/render-worker/package.json +30 -0
- package/examples/google-cloud-run-parallelized/render-worker/src/index.ts +45 -0
- package/examples/google-cloud-run-parallelized/render-worker/src/project.meta +31 -0
- package/examples/google-cloud-run-parallelized/render-worker/src/project.ts +6 -0
- package/examples/google-cloud-run-parallelized/render-worker/src/render.ts +14 -0
- package/examples/google-cloud-run-parallelized/render-worker/src/revideo.d.ts +1 -0
- package/examples/google-cloud-run-parallelized/render-worker/src/scenes/example.tsx +30 -0
- package/examples/google-cloud-run-parallelized/render-worker/tsconfig.json +13 -0
- package/examples/google-cloud-run-parallelized/render-worker/vite.config.ts +9 -0
- package/examples/logo.svg +6 -0
- package/examples/logo_dark.svg +6 -0
- package/examples/marketing-templates/README.md +10 -0
- package/examples/marketing-templates/marketing-template/package.json +24 -0
- package/examples/marketing-templates/marketing-template/src/globals.css +0 -0
- package/examples/marketing-templates/marketing-template/src/project.meta +28 -0
- package/examples/marketing-templates/marketing-template/src/project.ts +9 -0
- package/examples/marketing-templates/marketing-template/src/render.ts +15 -0
- package/examples/marketing-templates/marketing-template/src/revideo.d.ts +1 -0
- package/examples/marketing-templates/marketing-template/src/scenes/example.meta +5 -0
- package/examples/marketing-templates/marketing-template/src/scenes/example.tsx +67 -0
- package/examples/marketing-templates/marketing-template/tsconfig.json +9 -0
- package/examples/marketing-templates/marketing-template/vite.config.ts +9 -0
- package/examples/marketing-templates/multiple-videos-in-one/package.json +24 -0
- package/examples/marketing-templates/multiple-videos-in-one/src/project.meta +28 -0
- package/examples/marketing-templates/multiple-videos-in-one/src/project.ts +9 -0
- package/examples/marketing-templates/multiple-videos-in-one/src/render.ts +15 -0
- package/examples/marketing-templates/multiple-videos-in-one/src/revideo.d.ts +1 -0
- package/examples/marketing-templates/multiple-videos-in-one/src/scenes/example.meta +5 -0
- package/examples/marketing-templates/multiple-videos-in-one/src/scenes/example.tsx +122 -0
- package/examples/marketing-templates/multiple-videos-in-one/tsconfig.json +9 -0
- package/examples/marketing-templates/multiple-videos-in-one/vite.config.ts +9 -0
- package/examples/minimal-drag-drop/README.md +29 -0
- package/examples/minimal-drag-drop/next/app/api/render/route.ts +22 -0
- package/examples/minimal-drag-drop/next/app/globals.css +3 -0
- package/examples/minimal-drag-drop/next/app/layout.tsx +25 -0
- package/examples/minimal-drag-drop/next/app/page.tsx +277 -0
- package/examples/minimal-drag-drop/next/next-env.d.ts +5 -0
- package/examples/minimal-drag-drop/next/next.config.mjs +4 -0
- package/examples/minimal-drag-drop/next/package-lock.json +5577 -0
- package/examples/minimal-drag-drop/next/package.json +35 -0
- package/examples/minimal-drag-drop/next/postcss.config.js +6 -0
- package/examples/minimal-drag-drop/next/public/favicon.ico +0 -0
- package/examples/minimal-drag-drop/next/public/next.svg +1 -0
- package/examples/minimal-drag-drop/next/public/vercel.svg +1 -0
- package/examples/minimal-drag-drop/next/tailwind.config.ts +30 -0
- package/examples/minimal-drag-drop/next/tsconfig.json +26 -0
- package/examples/minimal-drag-drop/next/utils/parse.ts +35 -0
- package/examples/minimal-drag-drop/revideo/package-lock.json +3771 -0
- package/examples/minimal-drag-drop/revideo/package.json +24 -0
- package/examples/minimal-drag-drop/revideo/src/global.css +1 -0
- package/examples/minimal-drag-drop/revideo/src/project.meta +28 -0
- package/examples/minimal-drag-drop/revideo/src/project.ts +9 -0
- package/examples/minimal-drag-drop/revideo/src/render.ts +15 -0
- package/examples/minimal-drag-drop/revideo/src/revideo.d.ts +1 -0
- package/examples/minimal-drag-drop/revideo/src/scenes/example.meta +5 -0
- package/examples/minimal-drag-drop/revideo/src/scenes/example.tsx +44 -0
- package/examples/minimal-drag-drop/revideo/tsconfig.json +9 -0
- package/examples/minimal-drag-drop/revideo/vite.config.ts +6 -0
- package/examples/parallelized-aws-lambda/.dockerignore +3 -0
- package/examples/parallelized-aws-lambda/Dockerfile +21 -0
- package/examples/parallelized-aws-lambda/Dockerfile.base +64 -0
- package/examples/parallelized-aws-lambda/README.md +197 -0
- package/examples/parallelized-aws-lambda/revideo-project/.puppeteerrc.cjs +9 -0
- package/examples/parallelized-aws-lambda/revideo-project/package-lock.json +4133 -0
- package/examples/parallelized-aws-lambda/revideo-project/package.json +28 -0
- package/examples/parallelized-aws-lambda/revideo-project/src/lambda.ts +157 -0
- package/examples/parallelized-aws-lambda/revideo-project/src/project.meta +28 -0
- package/examples/parallelized-aws-lambda/revideo-project/src/project.ts +7 -0
- package/examples/parallelized-aws-lambda/revideo-project/src/render.ts +17 -0
- package/examples/parallelized-aws-lambda/revideo-project/src/revideo.d.ts +1 -0
- package/examples/parallelized-aws-lambda/revideo-project/src/scenes/example.meta +5 -0
- package/examples/parallelized-aws-lambda/revideo-project/src/scenes/example.tsx +30 -0
- package/examples/parallelized-aws-lambda/revideo-project/tsconfig.json +10 -0
- package/examples/parallelized-aws-lambda/revideo-project/vite.config.ts +9 -0
- package/examples/reddit-post-video/README.md +84 -0
- package/examples/reddit-post-video/package-lock.json +2941 -0
- package/examples/reddit-post-video/package.json +27 -0
- package/examples/reddit-post-video/src/global.css +1 -0
- package/examples/reddit-post-video/src/metadata.json +576 -0
- package/examples/reddit-post-video/src/project.meta +31 -0
- package/examples/reddit-post-video/src/project.ts +9 -0
- package/examples/reddit-post-video/src/render.ts +157 -0
- package/examples/reddit-post-video/src/revideo.d.ts +1 -0
- package/examples/reddit-post-video/src/scenes/example.meta +5 -0
- package/examples/reddit-post-video/src/scenes/example.tsx +74 -0
- package/examples/reddit-post-video/tsconfig.json +9 -0
- package/examples/reddit-post-video/vite.config.ts +6 -0
- package/examples/rive-explanation-video/README.md +9 -0
- package/examples/rive-explanation-video/package.json +25 -0
- package/examples/rive-explanation-video/src/global.css +1 -0
- package/examples/rive-explanation-video/src/project.meta +31 -0
- package/examples/rive-explanation-video/src/project.ts +8 -0
- package/examples/rive-explanation-video/src/render.ts +15 -0
- package/examples/rive-explanation-video/src/revideo.d.ts +1 -0
- package/examples/rive-explanation-video/src/scenes/example.meta +5 -0
- package/examples/rive-explanation-video/src/scenes/example.tsx +218 -0
- package/examples/rive-explanation-video/tsconfig.json +9 -0
- package/examples/rive-explanation-video/vite.config.ts +8 -0
- package/examples/saas-template/.prettierrc +9 -0
- package/examples/saas-template/README.md +26 -0
- package/examples/saas-template/app/actions.tsx +114 -0
- package/examples/saas-template/app/api/render/route.ts +23 -0
- package/examples/saas-template/app/globals.css +3 -0
- package/examples/saas-template/app/layout.tsx +25 -0
- package/examples/saas-template/app/page.tsx +204 -0
- package/examples/saas-template/next.config.mjs +4 -0
- package/examples/saas-template/package.json +40 -0
- package/examples/saas-template/postcss.config.js +6 -0
- package/examples/saas-template/revideo/global.css +1 -0
- package/examples/saas-template/revideo/project.ts +9 -0
- package/examples/saas-template/revideo/scene.tsx +179 -0
- package/examples/saas-template/tailwind.config.ts +30 -0
- package/examples/saas-template/tsconfig.json +27 -0
- package/examples/saas-template/utils/parse.ts +35 -0
- package/examples/stitching-videos/README.md +7 -0
- package/examples/stitching-videos/package.json +23 -0
- package/examples/stitching-videos/src/project.meta +28 -0
- package/examples/stitching-videos/src/project.ts +20 -0
- package/examples/stitching-videos/src/render.ts +27 -0
- package/examples/stitching-videos/src/revideo.d.ts +1 -0
- package/examples/stitching-videos/src/scenes/example.tsx +30 -0
- package/examples/stitching-videos/tsconfig.json +9 -0
- package/examples/stitching-videos/vite.config.ts +8 -0
- package/examples/three-js-example/README.md +8 -0
- package/examples/three-js-example/package-lock.json +2753 -0
- package/examples/three-js-example/package.json +25 -0
- package/examples/three-js-example/src/components/Three.ts +166 -0
- package/examples/three-js-example/src/global.css +1 -0
- package/examples/three-js-example/src/project.meta +31 -0
- package/examples/three-js-example/src/project.ts +8 -0
- package/examples/three-js-example/src/render.ts +15 -0
- package/examples/three-js-example/src/revideo.d.ts +1 -0
- package/examples/three-js-example/src/scenes/basic3D.meta +5 -0
- package/examples/three-js-example/src/scenes/basic3D.tsx +89 -0
- package/examples/three-js-example/tsconfig.json +9 -0
- package/examples/three-js-example/vite.config.ts +6 -0
- package/examples/youtube-shorts/README.md +65 -0
- package/examples/youtube-shorts/package-lock.json +3881 -0
- package/examples/youtube-shorts/package.json +30 -0
- package/examples/youtube-shorts/src/get-assets.ts +34 -0
- package/examples/youtube-shorts/src/global.css +3 -0
- package/examples/youtube-shorts/src/metadata.json +635 -0
- package/examples/youtube-shorts/src/project.meta +28 -0
- package/examples/youtube-shorts/src/project.ts +9 -0
- package/examples/youtube-shorts/src/render.ts +12 -0
- package/examples/youtube-shorts/src/revideo.d.ts +1 -0
- package/examples/youtube-shorts/src/scenes/example.tsx +224 -0
- package/examples/youtube-shorts/src/utils.ts +123 -0
- package/examples/youtube-shorts/tsconfig.json +9 -0
- package/examples/youtube-shorts/vite.config.ts +8 -0
- package/package.json +9 -9
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<br/>
|
|
2
|
+
<p align="center">
|
|
3
|
+
<a href="https://re.video">
|
|
4
|
+
<picture>
|
|
5
|
+
<source media="(prefers-color-scheme: dark)" srcset="./logo_dark.svg">
|
|
6
|
+
<img width="360" alt="Revideo logo" src="./logo.svg">
|
|
7
|
+
</picture>
|
|
8
|
+
</a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# Revideo Code Examples
|
|
13
|
+
|
|
14
|
+
This repository contains example projects built with [Revideo](https://github.com/redotvideo/revideo). If you prefer to learn by looking at code examples rather than reading through docs, this is a great place to get started with Revideo.
|
|
15
|
+
|
|
16
|
+
## List of Projects
|
|
17
|
+
|
|
18
|
+
Below you can find a list of Revideo projects along with a quick summary, focused on teaching different aspects (deployment, animations, etc.). All the individual project folders have a README to help you get started.
|
|
19
|
+
|
|
20
|
+
- **SaaS Template (Default Project + NextJS):** This is a NextJS project that demonstrates how to include Revideo in a SaaS application. If this is your first time using Revideo, this is probably what you're looking for. - ([project folder](https://github.com/redotvideo/revideo-examples/tree/main/saas-template))
|
|
21
|
+
|
|
22
|
+
- **Default Project:** This is a simple project that demonstrates the basic structure of a Revideo project. It includes an audio file and a background video - ([project folder](https://github.com/redotvideo/revideo-examples/tree/main/default))
|
|
23
|
+
|
|
24
|
+
### Animations
|
|
25
|
+
|
|
26
|
+
- **Transparent AI avatar with background image:** This is a very simple example of a video of an AI avatar speaking with a background image. It is mainly meant to demonstrate how to use transparent videos in Revideo ([project folder](https://github.com/redotvideo/revideo-examples/tree/main/github-stars-celebration))
|
|
27
|
+
|
|
28
|
+
- **Marketing Templates**: A template for a post on social media advertising black friday discounts. ([project folder](https://github.com/redotvideo/examples/tree/main/marketing-templates))
|
|
29
|
+
|
|
30
|
+
- **Stitching together videos:** This is a simple project that demonstrates how you can append videos one after another. It also includes an animation for a transition between videos - ([project folder](https://github.com/redotvideo/revideo-examples/tree/main/stitching-videos))
|
|
31
|
+
|
|
32
|
+
- **Youtube shorts with animated subtitles:** This example project generates Youtube Shorts with AI. It generates scripts with ChatGPT, voiceovers with Elevenlabs, and background images with Dall-E. **This project has a heavy emphasis on animating subtitles** - ([project folder](https://github.com/redotvideo/revideo-examples/tree/main/youtube-shorts))
|
|
33
|
+
|
|
34
|
+
- **Animation for 1,000 Github Stars:** A fun animation celebrating 1,000 Github stars for Revideo - ([project folder](https://github.com/redotvideo/revideo-examples/tree/main/youtube-shorts))
|
|
35
|
+
|
|
36
|
+
- **Code Explainer Video for Rive Animations:** An explainer video showcasing how you can use Rive animations inside of Revideo. Worth taking a look at to learn about our `<Code/>` and `<Rive/>` component. ([project folder](https://github.com/redotvideo/examples/tree/main/rive-explanation-video))
|
|
37
|
+
|
|
38
|
+
### Deployment
|
|
39
|
+
|
|
40
|
+
- **Parallelized Rendering with Cloud Functions:** This example project also uses Cloud Run, but enables faster rendering by distributing the rendering work across a large number of cloud functions - ([project folder](https://github.com/redotvideo/revideo-examples/tree/main/google-cloud-run-parallelized))
|
|
41
|
+
|
|
42
|
+
- **Parallelized Rendering with AWS Lambda:** This example project shows you how you can do parallelized rendering with AWS Lambda - ([project folder](https://github.com/redotvideo/revideo-examples/tree/main/parallelized-aws-lambda))
|
|
43
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "avatar-with-background",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"start": "vite",
|
|
7
|
+
"serve": "vite",
|
|
8
|
+
"build": "tsc && vite build",
|
|
9
|
+
"render": "tsc && node dist/render.js"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@deepgram/sdk": "^3.3.0",
|
|
13
|
+
"@revideo/2d": "0.5.10",
|
|
14
|
+
"@revideo/cli": "0.5.10",
|
|
15
|
+
"@revideo/core": "0.5.10",
|
|
16
|
+
"@revideo/ffmpeg": "0.5.10",
|
|
17
|
+
"@revideo/renderer": "0.5.10",
|
|
18
|
+
"@revideo/vite-plugin": "0.5.10",
|
|
19
|
+
"dotenv": "^16.4.5",
|
|
20
|
+
"openai": "^4.39.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@revideo/ui": "0.5.10",
|
|
24
|
+
"typescript": "5.5.4",
|
|
25
|
+
"vite": "^4.5"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 0,
|
|
3
|
+
"shared": {
|
|
4
|
+
"background": null,
|
|
5
|
+
"range": [
|
|
6
|
+
0,
|
|
7
|
+
null
|
|
8
|
+
],
|
|
9
|
+
"size": {
|
|
10
|
+
"x": 1080,
|
|
11
|
+
"y": 1080
|
|
12
|
+
},
|
|
13
|
+
"audioOffset": 0
|
|
14
|
+
},
|
|
15
|
+
"preview": {
|
|
16
|
+
"fps": 30,
|
|
17
|
+
"resolutionScale": 1
|
|
18
|
+
},
|
|
19
|
+
"rendering": {
|
|
20
|
+
"fps": 30,
|
|
21
|
+
"resolutionScale": 1,
|
|
22
|
+
"colorSpace": "srgb",
|
|
23
|
+
"exporter": {
|
|
24
|
+
"name": "@revideo/core/wasm",
|
|
25
|
+
"options": {
|
|
26
|
+
"fastStart": true,
|
|
27
|
+
"includeAudio": true
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {renderVideo} from '@revideo/renderer';
|
|
2
|
+
|
|
3
|
+
async function render() {
|
|
4
|
+
console.log('Rendering video...');
|
|
5
|
+
|
|
6
|
+
const file = await renderVideo({
|
|
7
|
+
projectFile: './src/project.ts',
|
|
8
|
+
settings: { logProgress: true }
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
console.log(`Rendered video to ${file}`);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
render();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="@revideo/core/project" />
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Img, Video, makeScene2D } from '@revideo/2d';
|
|
2
|
+
import { waitFor, createRef, useScene } from '@revideo/core'
|
|
3
|
+
|
|
4
|
+
export default makeScene2D(function* (view) {
|
|
5
|
+
const avatarRef = createRef<Video>();
|
|
6
|
+
const backgroundRef = createRef<Img>();
|
|
7
|
+
|
|
8
|
+
yield view.add(
|
|
9
|
+
<>
|
|
10
|
+
<Img
|
|
11
|
+
src={'https://revideo-example-assets.s3.amazonaws.com/mountains.jpg'}
|
|
12
|
+
height={'100%'}
|
|
13
|
+
ref={backgroundRef}
|
|
14
|
+
/>
|
|
15
|
+
<Video
|
|
16
|
+
src={'https://revideo-example-assets.s3.amazonaws.com/avatar.webm'}
|
|
17
|
+
play={true}
|
|
18
|
+
width={'100%'}
|
|
19
|
+
ref={avatarRef}
|
|
20
|
+
decoder={"slow"} // we need to use the slow decoder to support transparency
|
|
21
|
+
/>
|
|
22
|
+
</>,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
avatarRef().position.y(useScene().getSize().y / 2 - avatarRef().height() / 2);
|
|
26
|
+
|
|
27
|
+
yield* waitFor(avatarRef().getDuration());
|
|
28
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Revideo Minimal Starter Template
|
|
2
|
+
|
|
3
|
+
This is a minimal Revideo starter project. It can be bootstrapped using
|
|
4
|
+
`npm init @revideo@latest` and selecting the minimal template.
|
|
5
|
+
|
|
6
|
+
It includes a simple scene with a background video, music and the Revideo logo.
|
|
7
|
+
You can get started by editing the `project.tsx` file in the `src` folder.
|
|
8
|
+
|
|
9
|
+
You can run the Revideo editor using `npm start` and render the final video
|
|
10
|
+
using `npm run render`.
|
|
11
|
+
|
|
12
|
+
If you want to see what's possible with Revideo, check out the other templates
|
|
13
|
+
in the [Revideo Examples repository](https://github.com/redotvideo/examples), or
|
|
14
|
+
the [Revideo documentation](https://docs.re.video).
|
|
15
|
+
|
|
16
|
+
If you want to include your Revideo project in a website, you can use the
|
|
17
|
+
Next.js template. It can be found in the Revideo Examples repository or
|
|
18
|
+
bootstrapped using `npm init @revideo@latest` and selecting the Next.js
|
|
19
|
+
template.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "revideo-app",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"start": "revideo editor --projectFile ./src/project.tsx",
|
|
7
|
+
"render": "tsc && node dist/render.js"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@revideo/core": "0.6.0",
|
|
11
|
+
"@revideo/2d": "0.6.0",
|
|
12
|
+
"@revideo/renderer": "0.6.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@revideo/ui": "0.6.0",
|
|
16
|
+
"@revideo/cli": "0.6.0",
|
|
17
|
+
"typescript": "5.5.4",
|
|
18
|
+
"vite": "^4.5"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {makeProject, Vector2} from '@revideo/core';
|
|
2
|
+
|
|
3
|
+
import {Audio, Img, makeScene2D, Video} from '@revideo/2d';
|
|
4
|
+
import {all, chain, createRef, waitFor} from '@revideo/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The Revideo scene
|
|
8
|
+
*/
|
|
9
|
+
const scene = makeScene2D('scene', function* (view) {
|
|
10
|
+
const logoRef = createRef<Img>();
|
|
11
|
+
|
|
12
|
+
yield view.add(
|
|
13
|
+
<>
|
|
14
|
+
<Video
|
|
15
|
+
src={'https://revideo-example-assets.s3.amazonaws.com/stars.mp4'}
|
|
16
|
+
size={['100%', '100%']}
|
|
17
|
+
play={true}
|
|
18
|
+
/>
|
|
19
|
+
<Audio
|
|
20
|
+
src={'https://revideo-example-assets.s3.amazonaws.com/chill-beat.mp3'}
|
|
21
|
+
play={true}
|
|
22
|
+
time={17.0}
|
|
23
|
+
/>
|
|
24
|
+
</>,
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
yield* waitFor(1);
|
|
28
|
+
|
|
29
|
+
view.add(
|
|
30
|
+
<Img
|
|
31
|
+
width={'1%'}
|
|
32
|
+
ref={logoRef}
|
|
33
|
+
src={
|
|
34
|
+
'https://revideo-example-assets.s3.amazonaws.com/revideo-logo-white.png'
|
|
35
|
+
}
|
|
36
|
+
/>,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
yield* chain(
|
|
40
|
+
all(logoRef().scale(40, 2), logoRef().rotation(360, 2)),
|
|
41
|
+
logoRef().scale(60, 1),
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The final revideo project
|
|
47
|
+
*/
|
|
48
|
+
export default makeProject({
|
|
49
|
+
scenes: [scene],
|
|
50
|
+
settings: {
|
|
51
|
+
// Example settings:
|
|
52
|
+
shared: {
|
|
53
|
+
size: new Vector2(1920, 1080),
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {renderVideo} from '@revideo/renderer';
|
|
2
|
+
|
|
3
|
+
async function render() {
|
|
4
|
+
console.log('Rendering video...');
|
|
5
|
+
|
|
6
|
+
// This is the main function that renders the video
|
|
7
|
+
const file = await renderVideo({
|
|
8
|
+
projectFile: './src/project.tsx',
|
|
9
|
+
settings: {logProgress: true},
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
console.log(`Rendered video to ${file}`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
render();
|