@revideo/create 0.4.2-red.992 → 0.4.2-turtle.993
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/package.json +9 -9
- package/examples/README.md +0 -39
- package/examples/avatar-with-background/package-lock.json +0 -3162
- package/examples/avatar-with-background/package.json +0 -26
- 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/render.ts +0 -36
- package/examples/avatar-with-background/src/revideo.d.ts +0 -1
- package/examples/avatar-with-background/src/scenes/example.tsx +0 -28
- package/examples/avatar-with-background/tsconfig.json +0 -9
- package/examples/avatar-with-background/vite.config.ts +0 -8
- package/examples/default/package.json +0 -24
- package/examples/default/src/project.meta +0 -31
- package/examples/default/src/project.ts +0 -7
- package/examples/default/src/render.ts +0 -16
- package/examples/default/src/revideo.d.ts +0 -1
- package/examples/default/src/scenes/example.tsx +0 -38
- package/examples/default/tsconfig.json +0 -9
- package/examples/default/vite.config.ts +0 -8
- package/examples/google-cloud-run/Dockerfile +0 -56
- package/examples/google-cloud-run/README.md +0 -35
- package/examples/google-cloud-run/package.json +0 -28
- package/examples/google-cloud-run/src/index.ts +0 -39
- package/examples/google-cloud-run/src/project.meta +0 -31
- package/examples/google-cloud-run/src/project.ts +0 -7
- package/examples/google-cloud-run/src/revideo.d.ts +0 -1
- package/examples/google-cloud-run/src/scenes/example.meta +0 -5
- package/examples/google-cloud-run/src/scenes/example.tsx +0 -30
- package/examples/google-cloud-run/tsconfig.json +0 -9
- package/examples/google-cloud-run/vite.config.ts +0 -9
- 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 -39
- package/examples/google-cloud-run-parallelized/render-worker/src/project.ts +0 -6
- 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/logo.svg +0 -6
- package/examples/logo_dark.svg +0 -6
- package/examples/marketing-templates/README.md +0 -10
- package/examples/marketing-templates/marketing-template/package-lock.json +0 -3824
- package/examples/marketing-templates/marketing-template/package.json +0 -24
- package/examples/marketing-templates/marketing-template/src/globals.css +0 -0
- package/examples/marketing-templates/marketing-template/src/project.meta +0 -31
- package/examples/marketing-templates/marketing-template/src/project.ts +0 -9
- package/examples/marketing-templates/marketing-template/src/render.ts +0 -17
- 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/src/scenes/example.tsx +0 -67
- package/examples/marketing-templates/marketing-template/tsconfig.json +0 -9
- package/examples/marketing-templates/marketing-template/vite.config.ts +0 -9
- package/examples/marketing-templates/multiple-videos-in-one/package-lock.json +0 -3824
- package/examples/marketing-templates/multiple-videos-in-one/package.json +0 -24
- package/examples/marketing-templates/multiple-videos-in-one/src/project.meta +0 -31
- package/examples/marketing-templates/multiple-videos-in-one/src/project.ts +0 -9
- package/examples/marketing-templates/multiple-videos-in-one/src/render.ts +0 -17
- 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/src/scenes/example.tsx +0 -122
- package/examples/marketing-templates/multiple-videos-in-one/tsconfig.json +0 -9
- package/examples/marketing-templates/multiple-videos-in-one/vite.config.ts +0 -9
- package/examples/saas-template/.prettierrc +0 -9
- package/examples/saas-template/README.md +0 -28
- package/examples/saas-template/next/app/actions.tsx +0 -113
- package/examples/saas-template/next/app/api/render/route.ts +0 -22
- package/examples/saas-template/next/app/globals.css +0 -3
- package/examples/saas-template/next/app/layout.tsx +0 -25
- package/examples/saas-template/next/app/page.tsx +0 -182
- package/examples/saas-template/next/next.config.mjs +0 -4
- package/examples/saas-template/next/package.json +0 -34
- package/examples/saas-template/next/postcss.config.js +0 -6
- package/examples/saas-template/next/public/favicon.ico +0 -0
- package/examples/saas-template/next/public/next.svg +0 -1
- package/examples/saas-template/next/public/vercel.svg +0 -1
- package/examples/saas-template/next/tailwind.config.ts +0 -30
- package/examples/saas-template/next/tsconfig.json +0 -26
- package/examples/saas-template/next/utils/parse.ts +0 -35
- package/examples/saas-template/revideo/package.json +0 -24
- package/examples/saas-template/revideo/src/global.css +0 -1
- package/examples/saas-template/revideo/src/project.meta +0 -31
- package/examples/saas-template/revideo/src/project.ts +0 -9
- package/examples/saas-template/revideo/src/render.ts +0 -15
- package/examples/saas-template/revideo/src/revideo.d.ts +0 -1
- package/examples/saas-template/revideo/src/scenes/example.meta +0 -5
- package/examples/saas-template/revideo/src/scenes/example.tsx +0 -178
- package/examples/saas-template/revideo/tsconfig.json +0 -9
- package/examples/saas-template/revideo/vite.config.ts +0 -6
- package/examples/stitching-videos/README.md +0 -7
- package/examples/stitching-videos/package-lock.json +0 -2801
- package/examples/stitching-videos/package.json +0 -23
- package/examples/stitching-videos/src/project.meta +0 -31
- package/examples/stitching-videos/src/project.ts +0 -26
- package/examples/stitching-videos/src/render.ts +0 -58
- package/examples/stitching-videos/src/revideo.d.ts +0 -1
- package/examples/stitching-videos/src/scenes/example.tsx +0 -30
- package/examples/stitching-videos/tsconfig.json +0 -9
- package/examples/stitching-videos/vite.config.ts +0 -8
- package/examples/youtube-shorts/README.md +0 -65
- package/examples/youtube-shorts/package-lock.json +0 -3914
- package/examples/youtube-shorts/package.json +0 -30
- package/examples/youtube-shorts/src/global.css +0 -3
- package/examples/youtube-shorts/src/metadata.json +0 -635
- package/examples/youtube-shorts/src/project.meta +0 -31
- package/examples/youtube-shorts/src/project.ts +0 -9
- package/examples/youtube-shorts/src/render.ts +0 -40
- package/examples/youtube-shorts/src/revideo.d.ts +0 -1
- package/examples/youtube-shorts/src/scenes/example.tsx +0 -211
- package/examples/youtube-shorts/src/utils.ts +0 -123
- package/examples/youtube-shorts/tsconfig.json +0 -9
- package/examples/youtube-shorts/vite.config.ts +0 -8
|
@@ -1,26 +0,0 @@
|
|
|
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.3.0",
|
|
14
|
-
"@revideo/core": "0.3.0",
|
|
15
|
-
"@revideo/ffmpeg": "0.3.0",
|
|
16
|
-
"@revideo/renderer": "0.3.0",
|
|
17
|
-
"@revideo/vite-plugin": "0.3.0",
|
|
18
|
-
"dotenv": "^16.4.5",
|
|
19
|
-
"openai": "^4.39.0"
|
|
20
|
-
},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@revideo/ui": "0.3.0",
|
|
23
|
-
"typescript": "^5.2.2",
|
|
24
|
-
"vite": "^4.5"
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
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/ffmpeg",
|
|
25
|
-
"options": {
|
|
26
|
-
"fastStart": true,
|
|
27
|
-
"includeAudio": true
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import {renderVideo} from '@revideo/renderer';
|
|
2
|
-
|
|
3
|
-
const progressTracker = new Map<number, number>();
|
|
4
|
-
|
|
5
|
-
function trackProgress(id: number, progress: number) {
|
|
6
|
-
progressTracker.set(id, progress);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function printProgress() {
|
|
10
|
-
let line = '';
|
|
11
|
-
for (const [key, value] of progressTracker.entries()) {
|
|
12
|
-
line += `Worker ${key}: ${(value * 100).toFixed(0)}% `;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
if (line === '') {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
console.log(line);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async function render() {
|
|
23
|
-
console.log('Rendering video...');
|
|
24
|
-
|
|
25
|
-
const interval = setInterval(() => {
|
|
26
|
-
printProgress();
|
|
27
|
-
}, 1000);
|
|
28
|
-
|
|
29
|
-
const file = await renderVideo('./vite.config.ts', {}, trackProgress);
|
|
30
|
-
|
|
31
|
-
clearInterval(interval);
|
|
32
|
-
|
|
33
|
-
console.log(`Rendered video to ${file}`);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
render();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="@revideo/core/project" />
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
-
transparency={true}
|
|
21
|
-
/>
|
|
22
|
-
</>,
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
avatarRef().position.y(useScene().getSize().y / 2 - avatarRef().height() / 2);
|
|
26
|
-
|
|
27
|
-
yield* waitFor(avatarRef().getDuration());
|
|
28
|
-
});
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "revideo-app",
|
|
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
|
-
"@revideo/core": "^0.4.1",
|
|
13
|
-
"@revideo/2d": "^0.4.1",
|
|
14
|
-
"@revideo/renderer": "^0.4.1",
|
|
15
|
-
"@revideo/vite-plugin": "^0.4.1",
|
|
16
|
-
"@revideo/ffmpeg": "^0.4.1"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@revideo/ui": "^0.4.1",
|
|
20
|
-
"@revideo/cli": "^0.4.1",
|
|
21
|
-
"typescript": "^5.2.2",
|
|
22
|
-
"vite": "^4.5"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 0,
|
|
3
|
-
"shared": {
|
|
4
|
-
"background": null,
|
|
5
|
-
"range": [
|
|
6
|
-
0,
|
|
7
|
-
null
|
|
8
|
-
],
|
|
9
|
-
"size": {
|
|
10
|
-
"x": 1920,
|
|
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/ffmpeg",
|
|
25
|
-
"options": {
|
|
26
|
-
"fastStart": true,
|
|
27
|
-
"includeAudio": true
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
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.ts',
|
|
9
|
-
variables: {fill: 'orange'},
|
|
10
|
-
settings: {logProgress: true},
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
console.log(`Rendered video to ${file}`);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
render();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="@revideo/core/project" />
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {Audio, Img, Video, makeScene2D} from '@revideo/2d';
|
|
2
|
-
import {all, chain, createRef, waitFor} from '@revideo/core';
|
|
3
|
-
|
|
4
|
-
export default makeScene2D(function* (view) {
|
|
5
|
-
const logoRef = createRef<Img>();
|
|
6
|
-
|
|
7
|
-
yield view.add(
|
|
8
|
-
<>
|
|
9
|
-
<Video
|
|
10
|
-
src={'https://revideo-example-assets.s3.amazonaws.com/stars.mp4'}
|
|
11
|
-
size={['100%', '100%']}
|
|
12
|
-
play={true}
|
|
13
|
-
/>
|
|
14
|
-
<Audio
|
|
15
|
-
src={'https://revideo-example-assets.s3.amazonaws.com/chill-beat.mp3'}
|
|
16
|
-
play={true}
|
|
17
|
-
time={17.0}
|
|
18
|
-
/>
|
|
19
|
-
</>,
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
yield* waitFor(1);
|
|
23
|
-
|
|
24
|
-
view.add(
|
|
25
|
-
<Img
|
|
26
|
-
width={'1%'}
|
|
27
|
-
ref={logoRef}
|
|
28
|
-
src={
|
|
29
|
-
'https://revideo-example-assets.s3.amazonaws.com/revideo-logo-white.png'
|
|
30
|
-
}
|
|
31
|
-
/>,
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
yield* chain(
|
|
35
|
-
all(logoRef().scale(40, 2), logoRef().rotation(360, 2)),
|
|
36
|
-
logoRef().scale(60, 1),
|
|
37
|
-
);
|
|
38
|
-
});
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
FROM node:18-bullseye
|
|
2
|
-
|
|
3
|
-
RUN apt-get update && apt-get install -y \
|
|
4
|
-
nscd \
|
|
5
|
-
libnss3 \
|
|
6
|
-
libdbus-1-3 \
|
|
7
|
-
libatk1.0-0 \
|
|
8
|
-
libatk-bridge2.0-0 \
|
|
9
|
-
libcups2 \
|
|
10
|
-
libxkbcommon0 \
|
|
11
|
-
libxcomposite1 \
|
|
12
|
-
libxdamage1 \
|
|
13
|
-
libxrandr2 \
|
|
14
|
-
libgbm1 \
|
|
15
|
-
libpango-1.0-0 \
|
|
16
|
-
libcairo2 \
|
|
17
|
-
libasound2 \
|
|
18
|
-
libatspi2.0-0
|
|
19
|
-
|
|
20
|
-
RUN apt-get install -y libxfixes3
|
|
21
|
-
|
|
22
|
-
WORKDIR /usr/src/app
|
|
23
|
-
|
|
24
|
-
RUN wget https://github.com/eugeneware/ffmpeg-static/releases/download/b6.0/ffmpeg-linux-x64
|
|
25
|
-
|
|
26
|
-
RUN chmod +x ffmpeg-linux-x64
|
|
27
|
-
|
|
28
|
-
RUN mv ffmpeg-linux-x64 ffmpeg
|
|
29
|
-
|
|
30
|
-
RUN mv ffmpeg /usr/local/bin/
|
|
31
|
-
|
|
32
|
-
ENV FFMPEG_PATH=ffmpeg
|
|
33
|
-
|
|
34
|
-
RUN wget https://github.com/eugeneware/ffmpeg-static/releases/download/b6.0/ffprobe-linux-x64
|
|
35
|
-
|
|
36
|
-
RUN chmod +x ffprobe-linux-x64
|
|
37
|
-
|
|
38
|
-
RUN mv ffprobe-linux-x64 ffprobe
|
|
39
|
-
|
|
40
|
-
RUN mv ffprobe /usr/local/bin/
|
|
41
|
-
|
|
42
|
-
ENV FFPROBE_PATH=ffprobe
|
|
43
|
-
|
|
44
|
-
COPY package*.json ./
|
|
45
|
-
|
|
46
|
-
COPY . ./
|
|
47
|
-
|
|
48
|
-
RUN npm install
|
|
49
|
-
|
|
50
|
-
RUN npx puppeteer browsers install chrome
|
|
51
|
-
|
|
52
|
-
RUN apt-get update && apt-get install -y nscd libnss3
|
|
53
|
-
|
|
54
|
-
RUN ffmpeg -version
|
|
55
|
-
|
|
56
|
-
CMD service nscd start && npm run serve
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# Revideo on Google Cloud Run
|
|
2
|
-
|
|
3
|
-
This is an example project demonstrating how you can deploy Revideo projects on Google Cloud Run for rendering.
|
|
4
|
-
|
|
5
|
-
The project is structured like a normal Revideo project, but it also contains a minimal Express server in `src/index.ts` that exposes a `/render` endpoint calling `renderVideo()` ([function docs](https://docs.re.video/renderer/renderVideo)). It also contains a Dockerfile that sets up an environment to run Revideo out of the box on Cloud Run.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### Getting Started
|
|
9
|
-
|
|
10
|
-
To deploy the example proejct to Cloud Run, you should have a Google Cloud account and have enabled the [Cloud Run API](https://console.cloud.google.com/run). You should also install the gcloud CLI ([guide](https://cloud.google.com/sdk/docs/install)).
|
|
11
|
-
|
|
12
|
-
After cloning the `revideo-examples` project, navigate to `/google-cloud-run`. Now, you can run the following command to deploy the example project.
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
gcloud run deploy revideo-cloudrun-example --source . --region us-east1 --memory 8Gi --cpu 4 --allow-unauthenticated --concurrency=1
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Once the function is deployed, you will receive a service URL in your terminal. You can run the following command to trigger a video render:
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
curl -X POST https://<your-service-url>/render \
|
|
22
|
-
-H "Content-Type: application/json" \
|
|
23
|
-
-d '{
|
|
24
|
-
"variables": {"username": "Sarah"}
|
|
25
|
-
}' --output output.mp4
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
This will save the file which is sent back as a response to `output.mp4`. In production, it would be better to upload the file to a bucket instead of sending it back as a response - here, we merely use this approach for simplicity - if you want to upload the result file to a bucket instead of sending it back, you can do so by modifying `src/index.ts`.
|
|
29
|
-
|
|
30
|
-
Note that `--concurrency=1` makes sure that every request will spin up a new container instance to render a video. This is intentional, as rendering is a computationally expensive process. If you want to, you can also try decreasing the requested cpu and memory - 8Gi and 4 cpu is more than sufficient. When deploying in production, you might also want to require authentication.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Deploying your own Video Template
|
|
34
|
-
|
|
35
|
-
If you want to deploy your own video template, you can simply change the code in `src/scenes/example.tsx` and redeploy the service by running the `gcloud run deploy` command from above.
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "google-cloud-run",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"start": "vite",
|
|
7
|
-
"serve": "tsc && node dist/index.js",
|
|
8
|
-
"build": "tsc && vite build",
|
|
9
|
-
"render": "tsc && node dist/render.js"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@revideo/2d": "0.3.6",
|
|
13
|
-
"@revideo/core": "0.3.6",
|
|
14
|
-
"@revideo/ffmpeg": "0.3.6",
|
|
15
|
-
"@revideo/renderer": "0.3.6",
|
|
16
|
-
"@revideo/vite-plugin": "0.3.6",
|
|
17
|
-
"express": "^4.19.2",
|
|
18
|
-
"uuid": "^9.0.1"
|
|
19
|
-
},
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"@revideo/cli": "^0.3.6",
|
|
22
|
-
"@revideo/ui": "0.3.6",
|
|
23
|
-
"@types/express": "^4.17.21",
|
|
24
|
-
"@types/uuid": "^9.0.8",
|
|
25
|
-
"typescript": "^5.2.2",
|
|
26
|
-
"vite": "^4.5"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { renderVideo } from '@revideo/renderer';
|
|
2
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
-
import * as express from 'express';
|
|
4
|
-
import * as fs from 'fs';
|
|
5
|
-
import * as path from 'path';
|
|
6
|
-
|
|
7
|
-
const app = express();
|
|
8
|
-
app.use(express.json());
|
|
9
|
-
|
|
10
|
-
app.get('/', (req, res) => {
|
|
11
|
-
res.status(200).send(`Hello World!`);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
app.post('/render', async (req, res) => {
|
|
15
|
-
try {
|
|
16
|
-
const { variables } = req.body;
|
|
17
|
-
const jobId = uuidv4();
|
|
18
|
-
|
|
19
|
-
console.log("Rendering video...")
|
|
20
|
-
await renderVideo("./vite.config.ts", variables, () => {}, { name: jobId, logProgress: true, puppeteer: { args: ['--no-sandbox', '--disable-setuid-sandbox'] }});
|
|
21
|
-
console.log("Finished rendering")
|
|
22
|
-
|
|
23
|
-
const outputFilePath = path.join(process.cwd(), `./output/${jobId}.mp4`);
|
|
24
|
-
|
|
25
|
-
if (fs.existsSync(outputFilePath)) {
|
|
26
|
-
res.sendFile(outputFilePath); // alternatively (and recommended), upload file to a bucket
|
|
27
|
-
} else {
|
|
28
|
-
res.status(500).send('Rendered video not found');
|
|
29
|
-
}
|
|
30
|
-
} catch (err) {
|
|
31
|
-
console.error('Error rendering video:', err);
|
|
32
|
-
res.status(500).send('Error rendering video');
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
const port = parseInt(process.env.PORT) || 8080;
|
|
37
|
-
app.listen(port, () => {
|
|
38
|
-
console.log(`listening on port ${port}`);
|
|
39
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 0,
|
|
3
|
-
"shared": {
|
|
4
|
-
"background": null,
|
|
5
|
-
"range": [
|
|
6
|
-
0,
|
|
7
|
-
null
|
|
8
|
-
],
|
|
9
|
-
"size": {
|
|
10
|
-
"x": 1920,
|
|
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/ffmpeg",
|
|
25
|
-
"options": {
|
|
26
|
-
"fastStart": true,
|
|
27
|
-
"includeAudio": true
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="@revideo/core/project" />
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import {Audio, Txt, Video, makeScene2D} from '@revideo/2d';
|
|
2
|
-
import {all, chain, createRef, waitFor, useScene} from '@revideo/core';
|
|
3
|
-
|
|
4
|
-
export default makeScene2D(function* (view) {
|
|
5
|
-
const textRef = createRef<Txt>();
|
|
6
|
-
|
|
7
|
-
yield view.add(
|
|
8
|
-
<>
|
|
9
|
-
<Video
|
|
10
|
-
src={'https://revideo-example-assets.s3.amazonaws.com/stars.mp4'}
|
|
11
|
-
size={['100%', '100%']}
|
|
12
|
-
play={true}
|
|
13
|
-
/>
|
|
14
|
-
<Audio
|
|
15
|
-
src={'https://revideo-example-assets.s3.amazonaws.com/chill-beat.mp3'}
|
|
16
|
-
play={true}
|
|
17
|
-
time={17.0}
|
|
18
|
-
/>
|
|
19
|
-
</>,
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
yield* waitFor(1);
|
|
23
|
-
|
|
24
|
-
view.add(
|
|
25
|
-
<Txt fontFamily={"Sans-Serif"} fill={"white"} fontSize={10} ref={textRef}>Hello {useScene().variables.get("username", "user")()}</Txt>
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
yield* textRef().scale(10, 1);
|
|
29
|
-
yield* waitFor(2);
|
|
30
|
-
});
|