@revideo/create 0.3.7-alpha.975 → 0.3.7-beta.987

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.
Files changed (120) hide show
  1. package/package.json +9 -9
  2. package/examples/README.md +0 -39
  3. package/examples/avatar-with-background/package-lock.json +0 -3162
  4. package/examples/avatar-with-background/package.json +0 -26
  5. package/examples/avatar-with-background/src/project.meta +0 -31
  6. package/examples/avatar-with-background/src/project.ts +0 -6
  7. package/examples/avatar-with-background/src/render.ts +0 -36
  8. package/examples/avatar-with-background/src/revideo.d.ts +0 -1
  9. package/examples/avatar-with-background/src/scenes/example.tsx +0 -28
  10. package/examples/avatar-with-background/tsconfig.json +0 -9
  11. package/examples/avatar-with-background/vite.config.ts +0 -8
  12. package/examples/default/package.json +0 -24
  13. package/examples/default/src/project.meta +0 -31
  14. package/examples/default/src/project.ts +0 -7
  15. package/examples/default/src/render.ts +0 -17
  16. package/examples/default/src/revideo.d.ts +0 -1
  17. package/examples/default/src/scenes/example.tsx +0 -38
  18. package/examples/default/tsconfig.json +0 -9
  19. package/examples/google-cloud-run/Dockerfile +0 -56
  20. package/examples/google-cloud-run/README.md +0 -35
  21. package/examples/google-cloud-run/package-lock.json +0 -3862
  22. package/examples/google-cloud-run/package.json +0 -28
  23. package/examples/google-cloud-run/src/index.ts +0 -39
  24. package/examples/google-cloud-run/src/project.meta +0 -31
  25. package/examples/google-cloud-run/src/project.ts +0 -7
  26. package/examples/google-cloud-run/src/revideo.d.ts +0 -1
  27. package/examples/google-cloud-run/src/scenes/example.meta +0 -5
  28. package/examples/google-cloud-run/src/scenes/example.tsx +0 -30
  29. package/examples/google-cloud-run/tsconfig.json +0 -9
  30. package/examples/google-cloud-run/vite.config.ts +0 -9
  31. package/examples/google-cloud-run-parallelized/README.md +0 -127
  32. package/examples/google-cloud-run-parallelized/render-orchestrator/Dockerfile +0 -56
  33. package/examples/google-cloud-run-parallelized/render-orchestrator/package-lock.json +0 -2588
  34. package/examples/google-cloud-run-parallelized/render-orchestrator/package.json +0 -22
  35. package/examples/google-cloud-run-parallelized/render-orchestrator/src/index.ts +0 -72
  36. package/examples/google-cloud-run-parallelized/render-orchestrator/src/revideo.d.ts +0 -1
  37. package/examples/google-cloud-run-parallelized/render-orchestrator/tsconfig.json +0 -10
  38. package/examples/google-cloud-run-parallelized/render-worker/.gcloudignore +0 -17
  39. package/examples/google-cloud-run-parallelized/render-worker/.puppeteerrc.cjs +0 -9
  40. package/examples/google-cloud-run-parallelized/render-worker/package-lock.json +0 -4871
  41. package/examples/google-cloud-run-parallelized/render-worker/package.json +0 -30
  42. package/examples/google-cloud-run-parallelized/render-worker/src/index.ts +0 -39
  43. package/examples/google-cloud-run-parallelized/render-worker/src/project.ts +0 -6
  44. package/examples/google-cloud-run-parallelized/render-worker/src/revideo.d.ts +0 -1
  45. package/examples/google-cloud-run-parallelized/render-worker/src/scenes/example.tsx +0 -30
  46. package/examples/google-cloud-run-parallelized/render-worker/tsconfig.json +0 -13
  47. package/examples/google-cloud-run-parallelized/render-worker/vite.config.ts +0 -9
  48. package/examples/logo.svg +0 -6
  49. package/examples/logo_dark.svg +0 -6
  50. package/examples/marketing-templates/README.md +0 -10
  51. package/examples/marketing-templates/marketing-template/package-lock.json +0 -3824
  52. package/examples/marketing-templates/marketing-template/package.json +0 -24
  53. package/examples/marketing-templates/marketing-template/src/globals.css +0 -0
  54. package/examples/marketing-templates/marketing-template/src/project.meta +0 -31
  55. package/examples/marketing-templates/marketing-template/src/project.ts +0 -9
  56. package/examples/marketing-templates/marketing-template/src/render.ts +0 -17
  57. package/examples/marketing-templates/marketing-template/src/revideo.d.ts +0 -1
  58. package/examples/marketing-templates/marketing-template/src/scenes/example.meta +0 -5
  59. package/examples/marketing-templates/marketing-template/src/scenes/example.tsx +0 -67
  60. package/examples/marketing-templates/marketing-template/tsconfig.json +0 -9
  61. package/examples/marketing-templates/marketing-template/vite.config.ts +0 -9
  62. package/examples/marketing-templates/multiple-videos-in-one/package-lock.json +0 -3824
  63. package/examples/marketing-templates/multiple-videos-in-one/package.json +0 -24
  64. package/examples/marketing-templates/multiple-videos-in-one/src/project.meta +0 -31
  65. package/examples/marketing-templates/multiple-videos-in-one/src/project.ts +0 -9
  66. package/examples/marketing-templates/multiple-videos-in-one/src/render.ts +0 -17
  67. package/examples/marketing-templates/multiple-videos-in-one/src/revideo.d.ts +0 -1
  68. package/examples/marketing-templates/multiple-videos-in-one/src/scenes/example.meta +0 -5
  69. package/examples/marketing-templates/multiple-videos-in-one/src/scenes/example.tsx +0 -122
  70. package/examples/marketing-templates/multiple-videos-in-one/tsconfig.json +0 -9
  71. package/examples/marketing-templates/multiple-videos-in-one/vite.config.ts +0 -9
  72. package/examples/saas-template/.prettierrc +0 -9
  73. package/examples/saas-template/README.md +0 -28
  74. package/examples/saas-template/next/app/actions.tsx +0 -113
  75. package/examples/saas-template/next/app/api/render/route.ts +0 -22
  76. package/examples/saas-template/next/app/globals.css +0 -3
  77. package/examples/saas-template/next/app/layout.tsx +0 -25
  78. package/examples/saas-template/next/app/page.tsx +0 -182
  79. package/examples/saas-template/next/next.config.mjs +0 -4
  80. package/examples/saas-template/next/package.json +0 -34
  81. package/examples/saas-template/next/postcss.config.js +0 -6
  82. package/examples/saas-template/next/public/favicon.ico +0 -0
  83. package/examples/saas-template/next/public/next.svg +0 -1
  84. package/examples/saas-template/next/public/vercel.svg +0 -1
  85. package/examples/saas-template/next/tailwind.config.ts +0 -30
  86. package/examples/saas-template/next/tsconfig.json +0 -26
  87. package/examples/saas-template/next/utils/parse.ts +0 -35
  88. package/examples/saas-template/revideo/package.json +0 -24
  89. package/examples/saas-template/revideo/src/global.css +0 -1
  90. package/examples/saas-template/revideo/src/project.meta +0 -31
  91. package/examples/saas-template/revideo/src/project.ts +0 -9
  92. package/examples/saas-template/revideo/src/render.ts +0 -14
  93. package/examples/saas-template/revideo/src/revideo.d.ts +0 -1
  94. package/examples/saas-template/revideo/src/scenes/example.meta +0 -5
  95. package/examples/saas-template/revideo/src/scenes/example.tsx +0 -178
  96. package/examples/saas-template/revideo/tsconfig.json +0 -9
  97. package/examples/saas-template/revideo/vite.config.ts +0 -6
  98. package/examples/stitching-videos/README.md +0 -7
  99. package/examples/stitching-videos/package-lock.json +0 -2801
  100. package/examples/stitching-videos/package.json +0 -23
  101. package/examples/stitching-videos/src/project.meta +0 -31
  102. package/examples/stitching-videos/src/project.ts +0 -26
  103. package/examples/stitching-videos/src/render.ts +0 -58
  104. package/examples/stitching-videos/src/revideo.d.ts +0 -1
  105. package/examples/stitching-videos/src/scenes/example.tsx +0 -30
  106. package/examples/stitching-videos/tsconfig.json +0 -9
  107. package/examples/stitching-videos/vite.config.ts +0 -8
  108. package/examples/youtube-shorts/README.md +0 -65
  109. package/examples/youtube-shorts/package-lock.json +0 -3914
  110. package/examples/youtube-shorts/package.json +0 -30
  111. package/examples/youtube-shorts/src/global.css +0 -3
  112. package/examples/youtube-shorts/src/metadata.json +0 -635
  113. package/examples/youtube-shorts/src/project.meta +0 -31
  114. package/examples/youtube-shorts/src/project.ts +0 -9
  115. package/examples/youtube-shorts/src/render.ts +0 -40
  116. package/examples/youtube-shorts/src/revideo.d.ts +0 -1
  117. package/examples/youtube-shorts/src/scenes/example.tsx +0 -211
  118. package/examples/youtube-shorts/src/utils.ts +0 -123
  119. package/examples/youtube-shorts/tsconfig.json +0 -9
  120. package/examples/youtube-shorts/vite.config.ts +0 -8
@@ -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.3",
13
- "@revideo/core": "0.3.3",
14
- "@revideo/ffmpeg": "0.3.3",
15
- "@revideo/renderer": "0.3.3",
16
- "@revideo/vite-plugin": "0.3.3",
17
- "express": "^4.19.2",
18
- "uuid": "^9.0.1"
19
- },
20
- "devDependencies": {
21
- "@revideo/cli": "^0.3.3",
22
- "@revideo/ui": "0.3.3",
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,7 +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
- });
@@ -1 +0,0 @@
1
- /// <reference types="@revideo/core/project" />
@@ -1,5 +0,0 @@
1
- {
2
- "version": 0,
3
- "timeEvents": [],
4
- "seed": 2544124688
5
- }
@@ -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
- });
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "@revideo/2d/tsconfig.project.json",
3
- "include": ["src"],
4
- "compilerOptions": {
5
- "noEmit": false,
6
- "outDir": "dist",
7
- "module": "CommonJS"
8
- }
9
- }
@@ -1,9 +0,0 @@
1
- import {defineConfig} from 'vite';
2
- import motionCanvas from '@revideo/vite-plugin';
3
-
4
-
5
- export default defineConfig({
6
- plugins: [
7
- motionCanvas(),
8
- ],
9
- });
@@ -1,127 +0,0 @@
1
- # Parallel Rendering with Cloud Functions
2
-
3
- This project shows you how you can parallelize rendering across multiple Google Cloud functions to get much faster rendering speeds. Instead of rendering, say, 60 seconds of video in one process, we can also use 30 cloud functions to render 2s of video each, and afterwards stitch together the resulting partial videos.
4
-
5
- In this example, we are going to deploy two services to Google Cloud:
6
-
7
- - `/render-worker`: This is a Google Cloud Function that is responsible for rendering a partial video. It has access to your video template (`/render-worker/src/scenes`) and receives the number of total workers as well as its worker ID as an input. It accordingly exports the audio and visuals of the partial video.
8
-
9
- - `/render-orchestrator`: This is a minimal Google Cloud Run service that manages the render workers and is your entrypoint to start rendering jobs. It receives rendering requests along with the number of desired workers, accordingly sends partial render requests to the render workers and merges their results together to obtain the final video
10
-
11
- ## Getting Started
12
-
13
- To get started, clone the `revideo-examples` repository and navigate to the `google-cloud-run-parallelized` directory.
14
-
15
- ### Enable gcloud services
16
-
17
- To set up your Google Cloud services, ensure that you have the gcloud CLI installed ([guide](https://cloud.google.com/sdk/docs/install)). Then, enable the required services to deploy Cloud Functions:
18
-
19
- ```
20
- gcloud services enable run.googleapis.com
21
- gcloud services enable cloudfunctions.googleapis.com
22
- gcloud services enable storage.googleapis.com
23
- gcloud services enable cloudbuild.googleapis.com
24
- ```
25
-
26
- ### Create Storage Bucket
27
-
28
- You'll need a storage bucket to save your videos as well as partial videos to. To create one, run the following command and replace `<your-region>` with your desired region (e.g. `us-east1`):
29
-
30
- ```
31
- gsutil mb -l <your-region> gs://<your-bucket-name>/
32
- ```
33
-
34
- Now enable public read access by running the following command:
35
-
36
- ```
37
- gsutil iam ch allUsers:objectViewer gs://<your-bucket-name>/
38
- ```
39
-
40
- Finally, you need to modify the CORS settings of your bucket. To do so, create the following file `cors_config.json`:
41
-
42
- ```
43
- [
44
- {
45
- "origin": ["*"],
46
- "responseHeader": ["Content-Type"],
47
- "method": ["GET", "HEAD", "DELETE"],
48
- "maxAgeSeconds": 3600
49
- }
50
- ]
51
- ```
52
-
53
- Now run:
54
-
55
- ```
56
- gsutil cors set cors_config.json gs://<your-bucket-name>/
57
- ```
58
-
59
- Now you can deploy your render worker cloud function.
60
-
61
-
62
- ### Deploy Render Worker Cloud Function
63
-
64
- To deploy the render worker cloud function, navigate to `/render-worker` and run `npm install`. Now run the following command:
65
-
66
- 🚨 **Note:** In the commands below, make sure to select the same region (<your-region>) as the bucket you just created. Otherwise, your render jobs will run much slower.
67
-
68
- ```
69
- gcloud functions deploy render-worker \
70
- --runtime nodejs18 \
71
- --trigger-http \
72
- --allow-unauthenticated \
73
- --gen2 \
74
- --memory 4Gi \
75
- --cpu 2 \
76
- --concurrency=1 \
77
- --timeout=3600s \
78
- --region=<your-region> \
79
- --set-env-vars=FFMPEG_PATH=ffmpeg,FFPROBE_PATH=ffprobe,GCP_BUCKET_NAME=<your-bucket-name>
80
- ```
81
-
82
- You'll now have to wait some time for the deployment. Once your cloud function is deployed, its URL will be logged to the terminal (we will reference it as `<your-render-function-url>`). You will need this URL to configure your cloud run service that calls the cloud function you just deployed.
83
-
84
-
85
- ### Deploy Render Orchestrator Cloud Run Service
86
-
87
- To deploy the service that orchestrates the cloud functions, navigate to `/render-orchestrator`, then run `npm install` and the following command:
88
-
89
- ```
90
- gcloud run deploy render-orchestrator \
91
- --source . \
92
- --memory 8Gi \
93
- --cpu 4 \
94
- --allow-unauthenticated \
95
- --concurrency=1 \
96
- --timeout=3600s \
97
- --region <your-region> \
98
- --set-env-vars=FFMPEG_PATH=ffmpeg,FFPROBE_PATH=ffprobe,GCP_BUCKET_NAME=<your-bucket-name>,RENDER_WORKER_URL=<your-render-function-url>
99
- ```
100
-
101
- Again, you'll have to wait a bit for the service to be deployed. Once that is done, you can send a request to its url `<your-render-orchestrator-url>`.
102
-
103
- ### Sending a Request
104
-
105
- Once the render worker and orchestrator are running, you can send a render request as follows:
106
-
107
- ```
108
- curl -X POST <your-render-orchestrator-url>/render \
109
- -H "Content-Type: application/json" \
110
- -d '{"variables": {"username": "John"}, "numWorkers": 5}'
111
- ```
112
-
113
- This will distribute the rendering work across five cloud functions. You can check out the logs and rendering progress in the Google Cloud Function logs.
114
-
115
-
116
- ## Usage Notes
117
-
118
- Some useful information, as well as considerations on what parameters to use:
119
-
120
- **Cold Start times:**
121
- Depending on your previous usage, your Google Cloud account & project might not be prioritized for cold start times, and thus the bottleneck of your render speeds might be cold start tiems. You can check the logs of your render worker function to see how fast the render workers spin up after sending the request. For example, we have noticed that after creating a new Google Cloud project, we sometimes had to wait for 30s+ for a render worker to spin up, whereas cold start times were very fast on a project that we had been using for a lot of time already.
122
-
123
- **Video Duration:**
124
- Parallel rendering is especially effective for longer videos (>1 min). For short videos, the overhead of waiting for a bunch of cloud functions to cold boot may not be worth it
125
-
126
- **Choosing the number of workers:**
127
- Depending on the length of the video you're going to render, you might want to adjust the `numWorkers` parameter. A single worker should not render less than a second of video
@@ -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