@revideo/create 0.4.0 → 0.4.1-dog.994
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,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "stitching-videos",
|
|
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.3.1",
|
|
13
|
-
"@revideo/2d": "0.3.1",
|
|
14
|
-
"@revideo/renderer": "0.3.1",
|
|
15
|
-
"@revideo/vite-plugin": "0.3.1",
|
|
16
|
-
"@revideo/ffmpeg": "0.3.1"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@revideo/ui": "0.3.1",
|
|
20
|
-
"typescript": "^5.2.2",
|
|
21
|
-
"vite": "^4.5"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 0,
|
|
3
|
-
"shared": {
|
|
4
|
-
"background": "rgb(0,0,0)",
|
|
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,26 +0,0 @@
|
|
|
1
|
-
import {makeProject} from '@revideo/core';
|
|
2
|
-
|
|
3
|
-
import example from './scenes/example?scene';
|
|
4
|
-
|
|
5
|
-
export default makeProject({
|
|
6
|
-
scenes: [example],
|
|
7
|
-
variables: {
|
|
8
|
-
videos: [
|
|
9
|
-
{
|
|
10
|
-
src: "https://revideo-example-assets.s3.amazonaws.com/beach-3.mp4",
|
|
11
|
-
start: 1,
|
|
12
|
-
duration: 6
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
src: "https://revideo-example-assets.s3.amazonaws.com/beach-2.mp4",
|
|
16
|
-
start: 2,
|
|
17
|
-
duration: 10
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
src: "https://revideo-example-assets.s3.amazonaws.com/beach-1.mp4",
|
|
21
|
-
start: 1,
|
|
22
|
-
duration: 7
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
});
|
|
@@ -1,58 +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 += `${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
|
-
// This is the main function that renders the video
|
|
30
|
-
const file = await renderVideo(
|
|
31
|
-
'./vite.config.ts',
|
|
32
|
-
{
|
|
33
|
-
videos: [
|
|
34
|
-
{
|
|
35
|
-
src: "https://revideo-example-assets.s3.amazonaws.com/beach-3.mp4",
|
|
36
|
-
start: 2,
|
|
37
|
-
duration: 5
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
src: "https://revideo-example-assets.s3.amazonaws.com/beach-2.mp4",
|
|
41
|
-
start: 1,
|
|
42
|
-
duration: 4
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
src: "https://revideo-example-assets.s3.amazonaws.com/beach-1.mp4",
|
|
46
|
-
start: 3,
|
|
47
|
-
duration: 3
|
|
48
|
-
}
|
|
49
|
-
]},
|
|
50
|
-
trackProgress,
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
clearInterval(interval);
|
|
54
|
-
|
|
55
|
-
console.log(`Rendered video to ${file}`);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
render();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="@revideo/core/project" />
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { makeScene2D, Video } from '@revideo/2d';
|
|
2
|
-
import {createRef, waitFor, useScene} from '@revideo/core';
|
|
3
|
-
|
|
4
|
-
interface VideoObject {
|
|
5
|
-
src: string;
|
|
6
|
-
start: number;
|
|
7
|
-
duration: number;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default makeScene2D(function* (view) {
|
|
11
|
-
const videos: VideoObject[] = useScene().variables.get('videos', [])();
|
|
12
|
-
|
|
13
|
-
for(const vid of videos){
|
|
14
|
-
const videoRef = createRef<Video>();
|
|
15
|
-
yield view.add(<Video src={vid.src} time={vid.start} play={true} opacity={0} ref={videoRef} />)
|
|
16
|
-
|
|
17
|
-
if(view.width() / view.height() > videoRef().width() / videoRef().height()){
|
|
18
|
-
videoRef().width("100%");
|
|
19
|
-
} else {
|
|
20
|
-
videoRef().height("100%");
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// this is a fade-out / fade-in transition - the fade-out and in take 0.3 seconds each; just set the opacity of the video tag to 1 and only use yield* waitFor(vid.duration);
|
|
24
|
-
yield* videoRef().opacity(1,0.3);
|
|
25
|
-
yield* waitFor(vid.duration-0.6);
|
|
26
|
-
yield* videoRef().opacity(0,0.3);
|
|
27
|
-
videoRef().pause();
|
|
28
|
-
videoRef().remove();
|
|
29
|
-
}
|
|
30
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Youtube Shorts with Subtitles
|
|
2
|
-
|
|
3
|
-
This example project lets you generate Youtube Shorts with AI.
|
|
4
|
-
|
|
5
|
-
https://github.com/redotvideo/revideo-examples/assets/122226645/98bc202d-6b7d-4b8a-9a7f-c41533d8c760
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## Project Structure
|
|
9
|
-
|
|
10
|
-
There are two main files you should look at in this project:
|
|
11
|
-
|
|
12
|
-
- `src/scenes/example.tsx`: This file defines the flow of the video and its animations. It accepts variables such as a list of background images, a voiceover audio file, as well as a list of words along with their timestamps to display the video captions.
|
|
13
|
-
- `src/render.ts`: This is a node.js process which generates assets (script, voiceover, etc.) using AI services and consequently calls `renderVideo()` to export a video that uses the assets it generated as an input.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
## Getting Started
|
|
17
|
-
|
|
18
|
-
After cloning the repo, go inside the project folder and install all dependencies using `npm install`. Now you can preview an example video.
|
|
19
|
-
|
|
20
|
-
### Preview Video
|
|
21
|
-
|
|
22
|
-
You can start the editor using the following command:
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
npm start
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
The editor preview uses example assets (images and voiceovers) specified in `src/metadata.json` which are located in an AWS bucket we own. This way, you can test the template without having to generate your own assets.
|
|
29
|
-
|
|
30
|
-
When previewing the video in the editor, your browser will first have to load the assets, which can cause a bit of a lag - you might have to wait a few seconds. This will not be a problem when exporting the video though - when building a web app, this can also easily be avoided by preloading the assets (see our [docs](https://docs.re.video/preview-with-player/#preloading-assets) for info on this).
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
## Rendering your own Videos
|
|
34
|
-
If you want to render your own videos using ChatGPT, Dall-E and Elevenlabs voiceovers, you need to create a `.env` file in the project root directory and add the following environment variables:
|
|
35
|
-
|
|
36
|
-
```
|
|
37
|
-
OPENAI_API_KEY=<your-openai-key>
|
|
38
|
-
ELEVEN_API_KEY=<your-elevenlabs-key>
|
|
39
|
-
DEEPGRAM_API_KEY=<your-deepgram-key>
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Now you can run `npm run render`, which will execute `src/render.ts`.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
## Animating Subtitles
|
|
46
|
-
|
|
47
|
-
This project has a heavy emphasis on animating subtitles. It provides the option to stream subtitles word-by-word, to highlight the currently spoken word, or to let words fade into the image as they appear. To play around with the different caption animation options, you can modify the `textSettings` object in `src/scenes/example.tsx`:
|
|
48
|
-
|
|
49
|
-
```ts
|
|
50
|
-
const textSettings: captionSettings = {
|
|
51
|
-
fontSize: 80,
|
|
52
|
-
numSimultaneousWords: 4, // how many words are shown at most simultaneously
|
|
53
|
-
textColor: "white",
|
|
54
|
-
fontWeight: 800,
|
|
55
|
-
fontFamily: "Mulish",
|
|
56
|
-
stream: false, // if true, words appear one by one
|
|
57
|
-
textAlign: "center",
|
|
58
|
-
textBoxWidthInPercent: 70,
|
|
59
|
-
fadeInAnimation: true,
|
|
60
|
-
currentWordColor: "cyan",
|
|
61
|
-
currentWordBackgroundColor: "red", // adds a colored box to the word currently spoken
|
|
62
|
-
shadowColor: "black",
|
|
63
|
-
shadowBlur: 30
|
|
64
|
-
}
|
|
65
|
-
```
|