@revideo/create 0.5.11-beta.1106 → 0.10.0
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/avatar-with-background/package.json +7 -14
- package/examples/avatar-with-background/src/{scenes/example.tsx → project.tsx} +19 -3
- package/examples/avatar-with-background/src/render.ts +4 -3
- package/examples/avatar-with-background/tsconfig.json +2 -1
- package/examples/default/package.json +6 -6
- package/examples/default/src/project.tsx +2 -2
- package/examples/github-stars-celebration/package.json +7 -11
- package/examples/github-stars-celebration/src/{scenes/example.tsx → project.tsx} +24 -4
- package/examples/github-stars-celebration/src/render.ts +1 -1
- package/examples/github-stars-celebration/tsconfig.json +2 -1
- package/examples/marketing-templates/marketing-template/README.md +19 -0
- package/examples/marketing-templates/marketing-template/package.json +7 -11
- package/examples/marketing-templates/marketing-template/src/{scenes/example.tsx → project.tsx} +23 -3
- package/examples/marketing-templates/marketing-template/src/render.ts +1 -1
- package/examples/marketing-templates/marketing-template/tsconfig.json +2 -1
- package/examples/marketing-templates/multiple-videos-in-one/README.md +19 -0
- package/examples/marketing-templates/multiple-videos-in-one/package.json +7 -11
- package/examples/marketing-templates/multiple-videos-in-one/src/{scenes/example.tsx → project.tsx} +21 -3
- package/examples/marketing-templates/multiple-videos-in-one/src/render.ts +1 -1
- package/examples/marketing-templates/multiple-videos-in-one/tsconfig.json +2 -1
- package/examples/minimal-drag-drop/README.md +14 -18
- package/examples/minimal-drag-drop/{next/app → app}/page.tsx +51 -39
- package/examples/minimal-drag-drop/{next/next-env.d.ts → next-env.d.ts} +1 -1
- package/examples/minimal-drag-drop/{next/package.json → package.json} +9 -4
- package/examples/minimal-drag-drop/revideo/project.tsx +54 -0
- package/examples/parallelized-aws-lambda/Dockerfile +0 -2
- package/examples/parallelized-aws-lambda/README.md +331 -100
- package/examples/parallelized-aws-lambda/revideo-project/package.json +9 -11
- package/examples/parallelized-aws-lambda/revideo-project/src/lambda.ts +2 -3
- package/examples/parallelized-aws-lambda/revideo-project/src/{scenes/example.tsx → project.tsx} +9 -5
- package/examples/parallelized-aws-lambda/revideo-project/src/render.ts +1 -1
- package/examples/parallelized-aws-lambda/revideo-project/tsconfig.json +1 -0
- package/examples/rive-explanation-video/README.md +0 -3
- package/examples/rive-explanation-video/package.json +8 -12
- package/examples/rive-explanation-video/src/project.tsx +234 -0
- package/examples/rive-explanation-video/src/render.ts +1 -1
- package/examples/rive-explanation-video/tsconfig.json +2 -1
- package/examples/saas-template/package.json +39 -39
- package/examples/stitching-videos/README.md +15 -3
- package/examples/stitching-videos/package.json +7 -10
- package/examples/stitching-videos/src/{scenes/example.tsx → project.tsx} +36 -3
- package/examples/stitching-videos/src/render.ts +4 -16
- package/examples/stitching-videos/tsconfig.json +2 -1
- package/examples/three-js-example/package.json +10 -13
- package/examples/three-js-example/src/project.tsx +105 -0
- package/examples/three-js-example/src/render.ts +1 -1
- package/examples/three-js-example/tsconfig.json +2 -1
- package/examples/youtube-shorts/README.md +14 -60
- package/examples/youtube-shorts/package.json +8 -12
- package/examples/youtube-shorts/src/{scenes/example.tsx → project.tsx} +20 -3
- package/examples/youtube-shorts/src/render.ts +11 -8
- package/examples/youtube-shorts/src/utils.ts +1 -1
- package/examples/youtube-shorts/tsconfig.json +2 -1
- package/index.js +2 -26
- package/package.json +9 -9
- package/examples/avatar-with-background/src/project.meta +0 -31
- package/examples/avatar-with-background/src/project.ts +0 -6
- package/examples/avatar-with-background/src/revideo.d.ts +0 -1
- package/examples/avatar-with-background/src/scenes/example.meta +0 -5
- package/examples/avatar-with-background/vite.config.ts +0 -8
- package/examples/github-stars-celebration/src/project.meta +0 -28
- package/examples/github-stars-celebration/src/project.ts +0 -8
- package/examples/github-stars-celebration/src/revideo.d.ts +0 -1
- package/examples/github-stars-celebration/src/scenes/example.meta +0 -5
- package/examples/github-stars-celebration/vite.config.ts +0 -8
- package/examples/google-cloud-run-parallelized/README.md +0 -127
- package/examples/google-cloud-run-parallelized/render-orchestrator/Dockerfile +0 -56
- package/examples/google-cloud-run-parallelized/render-orchestrator/package.json +0 -22
- package/examples/google-cloud-run-parallelized/render-orchestrator/src/index.ts +0 -72
- package/examples/google-cloud-run-parallelized/render-orchestrator/src/revideo.d.ts +0 -1
- package/examples/google-cloud-run-parallelized/render-orchestrator/tsconfig.json +0 -10
- package/examples/google-cloud-run-parallelized/render-worker/.gcloudignore +0 -17
- package/examples/google-cloud-run-parallelized/render-worker/.puppeteerrc.cjs +0 -9
- package/examples/google-cloud-run-parallelized/render-worker/package.json +0 -30
- package/examples/google-cloud-run-parallelized/render-worker/src/index.ts +0 -45
- package/examples/google-cloud-run-parallelized/render-worker/src/project.meta +0 -31
- package/examples/google-cloud-run-parallelized/render-worker/src/project.ts +0 -6
- package/examples/google-cloud-run-parallelized/render-worker/src/render.ts +0 -14
- package/examples/google-cloud-run-parallelized/render-worker/src/revideo.d.ts +0 -1
- package/examples/google-cloud-run-parallelized/render-worker/src/scenes/example.tsx +0 -30
- package/examples/google-cloud-run-parallelized/render-worker/tsconfig.json +0 -13
- package/examples/google-cloud-run-parallelized/render-worker/vite.config.ts +0 -9
- package/examples/marketing-templates/marketing-template/src/globals.css +0 -0
- package/examples/marketing-templates/marketing-template/src/project.meta +0 -28
- package/examples/marketing-templates/marketing-template/src/project.ts +0 -9
- package/examples/marketing-templates/marketing-template/src/revideo.d.ts +0 -1
- package/examples/marketing-templates/marketing-template/src/scenes/example.meta +0 -5
- package/examples/marketing-templates/marketing-template/vite.config.ts +0 -9
- package/examples/marketing-templates/multiple-videos-in-one/src/project.meta +0 -28
- package/examples/marketing-templates/multiple-videos-in-one/src/project.ts +0 -9
- package/examples/marketing-templates/multiple-videos-in-one/src/revideo.d.ts +0 -1
- package/examples/marketing-templates/multiple-videos-in-one/src/scenes/example.meta +0 -5
- package/examples/marketing-templates/multiple-videos-in-one/vite.config.ts +0 -9
- package/examples/minimal-drag-drop/next/package-lock.json +0 -5577
- package/examples/minimal-drag-drop/next/public/favicon.ico +0 -0
- package/examples/minimal-drag-drop/next/public/next.svg +0 -1
- package/examples/minimal-drag-drop/next/public/vercel.svg +0 -1
- package/examples/minimal-drag-drop/revideo/package-lock.json +0 -3771
- package/examples/minimal-drag-drop/revideo/package.json +0 -24
- package/examples/minimal-drag-drop/revideo/src/project.meta +0 -28
- package/examples/minimal-drag-drop/revideo/src/project.ts +0 -9
- package/examples/minimal-drag-drop/revideo/src/render.ts +0 -15
- package/examples/minimal-drag-drop/revideo/src/revideo.d.ts +0 -1
- package/examples/minimal-drag-drop/revideo/src/scenes/example.meta +0 -5
- package/examples/minimal-drag-drop/revideo/src/scenes/example.tsx +0 -44
- package/examples/minimal-drag-drop/revideo/tsconfig.json +0 -9
- package/examples/minimal-drag-drop/revideo/vite.config.ts +0 -6
- package/examples/parallelized-aws-lambda/revideo-project/.puppeteerrc.cjs +0 -9
- package/examples/parallelized-aws-lambda/revideo-project/src/project.meta +0 -28
- package/examples/parallelized-aws-lambda/revideo-project/src/project.ts +0 -7
- package/examples/parallelized-aws-lambda/revideo-project/src/revideo.d.ts +0 -1
- package/examples/parallelized-aws-lambda/revideo-project/src/scenes/example.meta +0 -5
- package/examples/parallelized-aws-lambda/revideo-project/vite.config.ts +0 -9
- package/examples/reddit-post-video/README.md +0 -84
- package/examples/reddit-post-video/package-lock.json +0 -2941
- package/examples/reddit-post-video/package.json +0 -27
- package/examples/reddit-post-video/src/global.css +0 -1
- package/examples/reddit-post-video/src/metadata.json +0 -576
- package/examples/reddit-post-video/src/project.meta +0 -31
- package/examples/reddit-post-video/src/project.ts +0 -9
- package/examples/reddit-post-video/src/render.ts +0 -157
- package/examples/reddit-post-video/src/revideo.d.ts +0 -1
- package/examples/reddit-post-video/src/scenes/example.meta +0 -5
- package/examples/reddit-post-video/src/scenes/example.tsx +0 -74
- package/examples/reddit-post-video/tsconfig.json +0 -9
- package/examples/reddit-post-video/vite.config.ts +0 -6
- package/examples/rive-explanation-video/src/project.meta +0 -31
- package/examples/rive-explanation-video/src/project.ts +0 -8
- package/examples/rive-explanation-video/src/revideo.d.ts +0 -1
- package/examples/rive-explanation-video/src/scenes/example.meta +0 -5
- package/examples/rive-explanation-video/src/scenes/example.tsx +0 -218
- package/examples/rive-explanation-video/vite.config.ts +0 -8
- package/examples/stitching-videos/src/project.meta +0 -28
- package/examples/stitching-videos/src/project.ts +0 -20
- package/examples/stitching-videos/src/revideo.d.ts +0 -1
- package/examples/stitching-videos/vite.config.ts +0 -8
- package/examples/three-js-example/README.md +0 -8
- package/examples/three-js-example/src/project.meta +0 -31
- package/examples/three-js-example/src/project.ts +0 -8
- package/examples/three-js-example/src/revideo.d.ts +0 -1
- package/examples/three-js-example/src/scenes/basic3D.meta +0 -5
- package/examples/three-js-example/src/scenes/basic3D.tsx +0 -89
- package/examples/three-js-example/vite.config.ts +0 -6
- package/examples/youtube-shorts/src/project.meta +0 -28
- package/examples/youtube-shorts/src/project.ts +0 -9
- package/examples/youtube-shorts/src/revideo.d.ts +0 -1
- package/examples/youtube-shorts/vite.config.ts +0 -8
- /package/examples/minimal-drag-drop/{next/app → app}/api/render/route.ts +0 -0
- /package/examples/minimal-drag-drop/{next/app → app}/globals.css +0 -0
- /package/examples/minimal-drag-drop/{next/app → app}/layout.tsx +0 -0
- /package/examples/minimal-drag-drop/{next/next.config.mjs → next.config.mjs} +0 -0
- /package/examples/minimal-drag-drop/{next/postcss.config.js → postcss.config.js} +0 -0
- /package/examples/minimal-drag-drop/revideo/{src/global.css → global.css} +0 -0
- /package/examples/minimal-drag-drop/{next/tailwind.config.ts → tailwind.config.ts} +0 -0
- /package/examples/minimal-drag-drop/{next/tsconfig.json → tsconfig.json} +0 -0
- /package/examples/minimal-drag-drop/{next/utils → utils}/parse.ts +0 -0
package/examples/parallelized-aws-lambda/revideo-project/src/{scenes/example.tsx → project.tsx}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {Audio,
|
|
2
|
-
import {
|
|
1
|
+
import {Audio, Txt, Video, makeScene2D} from '@revideo/2d';
|
|
2
|
+
import {createSignal, useScene, waitFor, makeProject} from '@revideo/core';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
const scene = makeScene2D("scene", function* (view) {
|
|
5
5
|
const fontSize = createSignal(50);
|
|
6
6
|
|
|
7
7
|
yield view.add(
|
|
@@ -10,7 +10,7 @@ export default makeScene2D(function* (view) {
|
|
|
10
10
|
src={'https://revideo-example-assets.s3.amazonaws.com/beach-4.mp4'}
|
|
11
11
|
size={['100%', '100%']}
|
|
12
12
|
play={true}
|
|
13
|
-
decoder={"ffmpeg"} // ffmpeg is more reliable than webcodecs decoder
|
|
13
|
+
decoder={useScene().variables.get("decoder", "ffmpeg")} // ffmpeg is more reliable than webcodecs decoder
|
|
14
14
|
/>
|
|
15
15
|
<Audio
|
|
16
16
|
src={'https://revideo-example-assets.s3.amazonaws.com/chill-beat-2.mp3'}
|
|
@@ -26,5 +26,9 @@ export default makeScene2D(function* (view) {
|
|
|
26
26
|
yield* fontSize(100, 4); // increase font size to 100 in 4 seconds
|
|
27
27
|
|
|
28
28
|
yield* waitFor(25); // wait for 25 seconds more
|
|
29
|
-
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export default makeProject({
|
|
33
|
+
scenes: [scene],
|
|
30
34
|
});
|
|
@@ -6,7 +6,7 @@ async function render() {
|
|
|
6
6
|
// This is the main function that renders the video
|
|
7
7
|
console.time("render");
|
|
8
8
|
const file = await renderVideo({
|
|
9
|
-
projectFile: './src/project.
|
|
9
|
+
projectFile: './src/project.tsx',
|
|
10
10
|
settings: {logProgress: true},
|
|
11
11
|
});
|
|
12
12
|
console.timeEnd("render");
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "revideo-app",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"start": "
|
|
7
|
-
"serve": "vite",
|
|
8
|
-
"build": "tsc && vite build",
|
|
6
|
+
"start": "revideo editor --projectFile ./src/project.tsx",
|
|
9
7
|
"render": "tsc && node dist/render.js"
|
|
10
8
|
},
|
|
11
9
|
"dependencies": {
|
|
12
|
-
"@lezer/javascript": "^1.4.
|
|
13
|
-
"@revideo/2d": "0.
|
|
14
|
-
"@revideo/core": "0.
|
|
15
|
-
"@revideo/
|
|
16
|
-
"@revideo/renderer": "0.5.10",
|
|
17
|
-
"@revideo/vite-plugin": "0.5.10"
|
|
10
|
+
"@lezer/javascript": "^1.4.18",
|
|
11
|
+
"@revideo/2d": "0.10.0",
|
|
12
|
+
"@revideo/core": "0.10.0",
|
|
13
|
+
"@revideo/renderer": "0.10.0"
|
|
18
14
|
},
|
|
19
15
|
"devDependencies": {
|
|
20
|
-
"@revideo/cli": "0.
|
|
21
|
-
"@revideo/ui": "0.
|
|
16
|
+
"@revideo/cli": "0.10.0",
|
|
17
|
+
"@revideo/ui": "0.10.0",
|
|
22
18
|
"typescript": "5.5.4",
|
|
23
19
|
"vite": "^4.5"
|
|
24
20
|
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { waitFor, createRef, makeProject, all, Reference, chain } from '@revideo/core';
|
|
2
|
+
import {
|
|
3
|
+
Img,
|
|
4
|
+
makeScene2D,
|
|
5
|
+
Rive,
|
|
6
|
+
Txt,
|
|
7
|
+
Layout,
|
|
8
|
+
LezerHighlighter, Code, word, lines, Rect,
|
|
9
|
+
View2D,
|
|
10
|
+
} from '@revideo/2d';
|
|
11
|
+
import {parser} from '@lezer/javascript';
|
|
12
|
+
import {tags} from '@lezer/highlight';
|
|
13
|
+
import {HighlightStyle} from '@codemirror/language';
|
|
14
|
+
import './global.css';
|
|
15
|
+
|
|
16
|
+
const MyStyle = HighlightStyle.define([
|
|
17
|
+
{
|
|
18
|
+
tag: tags.comment,
|
|
19
|
+
color: '#8E908C',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
tag: [tags.variableName, tags.self, tags.propertyName, tags.attributeName, tags.regexp],
|
|
23
|
+
color: '#C82829',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
tag: [tags.number, tags.bool, tags.null],
|
|
27
|
+
color: '#F5871F',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
tag: [tags.className, tags.typeName, tags.definition(tags.typeName)],
|
|
31
|
+
color: '#C99E00',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
tag: [tags.string, tags.special(tags.brace)],
|
|
35
|
+
color: '#718C00',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
tag: tags.operator,
|
|
39
|
+
color: '#3E999F',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
tag: [tags.definition(tags.propertyName), tags.function(tags.variableName)],
|
|
43
|
+
color: '#4271AE',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
tag: tags.keyword,
|
|
47
|
+
color: '#8959A8',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
tag: tags.derefOperator,
|
|
51
|
+
color: '#4D4D4C',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
tag: tags.bracket,
|
|
55
|
+
color: "grey"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
tag: tags.separator,
|
|
59
|
+
color: "grey"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
tag: tags.punctuation,
|
|
63
|
+
color: "grey"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
tag: tags.typeOperator,
|
|
67
|
+
color: "grey"
|
|
68
|
+
}
|
|
69
|
+
]);
|
|
70
|
+
|
|
71
|
+
Code.defaultHighlighter = new LezerHighlighter(
|
|
72
|
+
parser.configure({
|
|
73
|
+
dialect: 'jsx ts',
|
|
74
|
+
}),
|
|
75
|
+
MyStyle
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* The Revideo scene
|
|
80
|
+
*/
|
|
81
|
+
const scene = makeScene2D('scene', function* (view) {
|
|
82
|
+
|
|
83
|
+
const textRef = createRef<Txt>();
|
|
84
|
+
yield view.add(
|
|
85
|
+
<Txt fontFamily={"Lexend"} fontSize={100} fontWeight={600} ref={textRef}/>
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
yield* all(textRef().text("Rive Animations in Revideo", 1.25))
|
|
89
|
+
yield* all(
|
|
90
|
+
textRef().scale(0.75, 0.75),
|
|
91
|
+
textRef().position.y(-400, 0.75)
|
|
92
|
+
)
|
|
93
|
+
yield* waitFor(0.25);
|
|
94
|
+
|
|
95
|
+
const codeRef= createRef<Code>();
|
|
96
|
+
const videoBoxRef = createRef<Layout>();
|
|
97
|
+
view.add(<Layout opacity={0} position={[550, 100]} size={[600, 600]} ref={videoBoxRef} />);
|
|
98
|
+
view.add(
|
|
99
|
+
<Code
|
|
100
|
+
ref={codeRef}
|
|
101
|
+
textAlign={"left"}
|
|
102
|
+
fontSize={35}
|
|
103
|
+
x={-400}
|
|
104
|
+
y={100}
|
|
105
|
+
opacity={0}
|
|
106
|
+
fontFamily={'JetBrains Mono, monospace'}
|
|
107
|
+
code={
|
|
108
|
+
`export default makeScene2D(function* (view){
|
|
109
|
+
yield view.add(
|
|
110
|
+
<Img
|
|
111
|
+
src={"/sf.png"}
|
|
112
|
+
size={["100%", "100%"]}
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
});
|
|
117
|
+
`
|
|
118
|
+
}/>);
|
|
119
|
+
|
|
120
|
+
videoBoxRef().add(
|
|
121
|
+
<Img
|
|
122
|
+
src={"https://revideo-example-assets.s3.amazonaws.com/sf.png"}
|
|
123
|
+
size={[videoBoxRef().width(), videoBoxRef().height()]}
|
|
124
|
+
/>
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
yield* all(
|
|
128
|
+
codeRef().opacity(1, 0.75),
|
|
129
|
+
videoBoxRef().opacity(1, 0.75)
|
|
130
|
+
);
|
|
131
|
+
yield* waitFor(0.5);
|
|
132
|
+
|
|
133
|
+
const riveRef = createRef<Rive>();
|
|
134
|
+
videoBoxRef().add(
|
|
135
|
+
<Rive
|
|
136
|
+
src={"https://revideo-example-assets.s3.amazonaws.com/emoji.riv"}
|
|
137
|
+
animationId={1}
|
|
138
|
+
size={[600, 600]}
|
|
139
|
+
opacity={0}
|
|
140
|
+
ref={riveRef}
|
|
141
|
+
/>
|
|
142
|
+
);
|
|
143
|
+
yield* all(codeRef().code.insert([8, 0],
|
|
144
|
+
`\n yield view.add(
|
|
145
|
+
<Rive
|
|
146
|
+
src={"/emoji.riv"}
|
|
147
|
+
animationId={1}
|
|
148
|
+
size={[600, 600]}
|
|
149
|
+
/>
|
|
150
|
+
);\n`, 1),
|
|
151
|
+
riveRef().opacity(1, 1)
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
yield* waitFor(1);
|
|
155
|
+
|
|
156
|
+
yield* codeRef().selection(lines(11, 13), 1),
|
|
157
|
+
yield replaceRive(videoBoxRef, riveRef)
|
|
158
|
+
yield* all(
|
|
159
|
+
codeRef().code.replace(word(11, 17, 5), "dog", 2),
|
|
160
|
+
codeRef().code.replace(word(13, 17, 3), "900", 2),
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
yield* codeRef().selection(lines(0, 17), 1);
|
|
164
|
+
|
|
165
|
+
yield* waitFor(1);
|
|
166
|
+
yield* all(
|
|
167
|
+
codeRef().opacity(0, 1),
|
|
168
|
+
videoBoxRef().opacity(0, 1),
|
|
169
|
+
textRef().opacity(0, 1)
|
|
170
|
+
);
|
|
171
|
+
|
|
172
|
+
yield* waitFor(0.5);
|
|
173
|
+
yield* logoAnimation(view);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
function* replaceRive(box: Reference<Layout>, rive: Reference<Rive>){
|
|
177
|
+
yield* rive().opacity(0, 1);
|
|
178
|
+
rive().remove();
|
|
179
|
+
|
|
180
|
+
const riveRef = createRef<Rive>();
|
|
181
|
+
box().add(
|
|
182
|
+
<Rive
|
|
183
|
+
src={"https://revideo-example-assets.s3.amazonaws.com/dog.riv"}
|
|
184
|
+
size={[1000, 600]}
|
|
185
|
+
opacity={0}
|
|
186
|
+
animationId={1}
|
|
187
|
+
ref={riveRef}
|
|
188
|
+
/>
|
|
189
|
+
);
|
|
190
|
+
|
|
191
|
+
yield* riveRef().opacity(1, 1);
|
|
192
|
+
yield* waitFor(5);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function* logoAnimation(view: View2D){
|
|
196
|
+
const block1 = createRef<Rect>()
|
|
197
|
+
const block2 = createRef<Rect>()
|
|
198
|
+
const block3 = createRef<Rect>()
|
|
199
|
+
const blocks = createRef<Layout>();
|
|
200
|
+
const logoText = createRef<Txt>();
|
|
201
|
+
view.add(
|
|
202
|
+
<>
|
|
203
|
+
<Layout ref={blocks} x={-600}>
|
|
204
|
+
<Rect fill={"#151515"} height={60} y={-80} x={-620} width={180} radius={9.3} ref={block1} />
|
|
205
|
+
<Rect fill={"#151515"} height={60} width={180} x={-540} radius={9.3} ref={block2} />
|
|
206
|
+
<Rect fill={"#151515"} height={60} width={180} x={-460} y={80} radius={9.3} ref={block3} />
|
|
207
|
+
<Txt ref={logoText} fontFamily={"Lexend"} x={53+757.5} y={20} fontSize={300} letterSpacing={-4} fontWeight={700} text={""}/>
|
|
208
|
+
</Layout>
|
|
209
|
+
</>
|
|
210
|
+
);
|
|
211
|
+
|
|
212
|
+
yield* all(
|
|
213
|
+
block1().position.x(-80, 0.5),
|
|
214
|
+
chain(waitFor(0.1), block2().position.x(0, 0.4)),
|
|
215
|
+
chain(waitFor(0.2), block3().position.x(80, 0.3)),
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
yield* logoText().text("revideo", 1);
|
|
219
|
+
|
|
220
|
+
yield* waitFor(1);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The final revideo project
|
|
225
|
+
*/
|
|
226
|
+
export default makeProject({
|
|
227
|
+
scenes: [scene],
|
|
228
|
+
settings: {
|
|
229
|
+
// Example settings:
|
|
230
|
+
shared: {
|
|
231
|
+
size: {x: 1920, 1080},
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
});
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
2
|
+
"name": "next",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "next lint",
|
|
10
|
+
"revideo:serve": "revideo serve --projectFile ./revideo/project.ts",
|
|
11
|
+
"revideo:editor": "revideo editor --projectFile ./revideo/project.ts"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@radix-ui/react-navigation-menu": "^1.1.4",
|
|
15
|
+
"@revideo/2d": "0.10.0",
|
|
16
|
+
"@revideo/core": "0.10.0",
|
|
17
|
+
"@revideo/player-react": "0.10.0",
|
|
18
|
+
"class-variance-authority": "^0.7.0",
|
|
19
|
+
"lucide-react": "^0.378.0",
|
|
20
|
+
"next": "^14.2.13",
|
|
21
|
+
"p-limit": "^3",
|
|
22
|
+
"react": "^18",
|
|
23
|
+
"react-dom": "^18",
|
|
24
|
+
"tailwind-merge": "^2.3.0",
|
|
25
|
+
"tailwindcss-animate": "^1.0.7"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@revideo/cli": "0.10.0",
|
|
29
|
+
"@revideo/ui": "0.10.0",
|
|
30
|
+
"@types/node": "^20",
|
|
31
|
+
"@types/react": "^18",
|
|
32
|
+
"@types/react-dom": "^18",
|
|
33
|
+
"autoprefixer": "^10.4.19",
|
|
34
|
+
"eslint": "^8",
|
|
35
|
+
"eslint-config-next": "14.2.3",
|
|
36
|
+
"postcss": "^8",
|
|
37
|
+
"tailwindcss": "^3.4.3",
|
|
38
|
+
"typescript": "^5"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Revideo Minimal Starter Template
|
|
2
2
|
|
|
3
|
-
This is a
|
|
3
|
+
This is a minimal Revideo starter project. It can be bootstrapped using
|
|
4
|
+
`npm init @revideo@latest` and selecting the minimal template.
|
|
4
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.
|
|
5
8
|
|
|
6
|
-
|
|
9
|
+
You can run the Revideo editor using `npm start` and render the final video
|
|
10
|
+
using `npm run render`.
|
|
7
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.
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "revideo-app",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"start": "
|
|
7
|
-
"serve": "vite",
|
|
8
|
-
"build": "tsc && vite build",
|
|
6
|
+
"start": "revideo editor --projectFile ./src/project.tsx",
|
|
9
7
|
"render": "tsc && node dist/render.js"
|
|
10
8
|
},
|
|
11
9
|
"dependencies": {
|
|
12
|
-
"@revideo/core": "0.
|
|
13
|
-
"@revideo/2d": "0.
|
|
14
|
-
"@revideo/renderer": "0.
|
|
15
|
-
"@revideo/vite-plugin": "0.5.10",
|
|
16
|
-
"@revideo/ffmpeg": "0.5.10"
|
|
10
|
+
"@revideo/core": "0.10.0",
|
|
11
|
+
"@revideo/2d": "0.10.0",
|
|
12
|
+
"@revideo/renderer": "0.10.0"
|
|
17
13
|
},
|
|
18
14
|
"devDependencies": {
|
|
19
|
-
"@revideo/ui": "0.
|
|
15
|
+
"@revideo/ui": "0.10.0",
|
|
16
|
+
"@revideo/cli": "0.10.0",
|
|
20
17
|
"typescript": "5.5.4",
|
|
21
18
|
"vite": "^4.5"
|
|
22
19
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {makeProject} from '@revideo/core';
|
|
2
|
+
|
|
3
|
+
import {makeScene2D, Video} from '@revideo/2d';
|
|
4
|
+
import {useScene, createRef, waitFor} from '@revideo/core';
|
|
3
5
|
|
|
4
6
|
interface VideoObject {
|
|
5
7
|
src: string;
|
|
@@ -7,7 +9,10 @@ interface VideoObject {
|
|
|
7
9
|
duration: number;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
/**
|
|
13
|
+
* The Revideo scene
|
|
14
|
+
*/
|
|
15
|
+
const scene = makeScene2D('scene', function* (view) {
|
|
11
16
|
const videos: VideoObject[] = useScene().variables.get('videos', [])();
|
|
12
17
|
|
|
13
18
|
for(const vid of videos){
|
|
@@ -28,3 +33,31 @@ export default makeScene2D(function* (view) {
|
|
|
28
33
|
videoRef().remove();
|
|
29
34
|
}
|
|
30
35
|
});
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The final revideo project
|
|
40
|
+
*/
|
|
41
|
+
export default makeProject({
|
|
42
|
+
scenes: [scene],
|
|
43
|
+
variables: {
|
|
44
|
+
videos: [
|
|
45
|
+
{
|
|
46
|
+
src: "https://revideo-example-assets.s3.amazonaws.com/beach-3.mp4",
|
|
47
|
+
start: 1,
|
|
48
|
+
duration: 6
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
src: "https://revideo-example-assets.s3.amazonaws.com/beach-2.mp4",
|
|
52
|
+
start: 2,
|
|
53
|
+
duration: 10
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
settings: {
|
|
58
|
+
// Example settings:
|
|
59
|
+
shared: {
|
|
60
|
+
size: {x: 1920, y: 1080},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
@@ -2,24 +2,12 @@ import {renderVideo} from '@revideo/renderer';
|
|
|
2
2
|
|
|
3
3
|
async function render() {
|
|
4
4
|
console.log('Rendering video...');
|
|
5
|
+
|
|
5
6
|
// This is the main function that renders the video
|
|
6
7
|
const file = await renderVideo({
|
|
7
|
-
projectFile: './src/project.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
src: "https://revideo-example-assets.s3.amazonaws.com/beach-3.mp4",
|
|
12
|
-
start: 1,
|
|
13
|
-
duration: 6
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
src: "https://revideo-example-assets.s3.amazonaws.com/beach-2.mp4",
|
|
17
|
-
start: 2,
|
|
18
|
-
duration: 10
|
|
19
|
-
}
|
|
20
|
-
]},
|
|
21
|
-
settings: {logProgress: true}
|
|
22
|
-
});
|
|
8
|
+
projectFile: './src/project.tsx',
|
|
9
|
+
settings: {logProgress: true},
|
|
10
|
+
});
|
|
23
11
|
|
|
24
12
|
console.log(`Rendered video to ${file}`);
|
|
25
13
|
}
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "revideo-app",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"start": "
|
|
7
|
-
"serve": "vite",
|
|
8
|
-
"build": "tsc && vite build",
|
|
6
|
+
"start": "revideo editor --projectFile ./src/project.tsx",
|
|
9
7
|
"render": "tsc && node dist/render.js"
|
|
10
8
|
},
|
|
11
9
|
"dependencies": {
|
|
12
|
-
"@revideo/2d": "0.
|
|
13
|
-
"@revideo/core": "0.
|
|
14
|
-
"@revideo/renderer": "0.
|
|
15
|
-
"
|
|
16
|
-
"three": "^0.167.1"
|
|
10
|
+
"@revideo/2d": "0.10.0",
|
|
11
|
+
"@revideo/core": "0.10.0",
|
|
12
|
+
"@revideo/renderer": "0.10.0",
|
|
13
|
+
"three": "^0.169.0"
|
|
17
14
|
},
|
|
18
15
|
"devDependencies": {
|
|
19
|
-
"@revideo/
|
|
20
|
-
"@revideo/
|
|
21
|
-
"@types/three": "^0.
|
|
16
|
+
"@revideo/cli": "0.10.0",
|
|
17
|
+
"@revideo/ui": "0.10.0",
|
|
18
|
+
"@types/three": "^0.169.0",
|
|
22
19
|
"typescript": "5.5.4",
|
|
23
|
-
"vite": "^4.
|
|
20
|
+
"vite": "^4.5"
|
|
24
21
|
}
|
|
25
22
|
}
|