@revideo/create 0.5.10 → 0.5.11-alpha.1100
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 -43
- package/examples/avatar-with-background/package.json +0 -27
- 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 -14
- 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/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 -15
- 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/github-stars-celebration/package-lock.json +0 -3833
- package/examples/github-stars-celebration/package.json +0 -24
- package/examples/github-stars-celebration/src/global.css +0 -1
- 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/render.ts +0 -15
- 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/src/scenes/example.tsx +0 -51
- package/examples/github-stars-celebration/tsconfig.json +0 -9
- 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/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.json +0 -24
- 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/render.ts +0 -15
- 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.json +0 -24
- 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/render.ts +0 -15
- 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/minimal-drag-drop/README.md +0 -27
- package/examples/minimal-drag-drop/next/app/api/render/route.ts +0 -22
- package/examples/minimal-drag-drop/next/app/globals.css +0 -3
- package/examples/minimal-drag-drop/next/app/layout.tsx +0 -25
- package/examples/minimal-drag-drop/next/app/page.tsx +0 -277
- package/examples/minimal-drag-drop/next/next-env.d.ts +0 -5
- package/examples/minimal-drag-drop/next/next.config.mjs +0 -4
- package/examples/minimal-drag-drop/next/package-lock.json +0 -5577
- package/examples/minimal-drag-drop/next/package.json +0 -35
- package/examples/minimal-drag-drop/next/postcss.config.js +0 -6
- 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/next/tailwind.config.ts +0 -30
- package/examples/minimal-drag-drop/next/tsconfig.json +0 -26
- package/examples/minimal-drag-drop/next/utils/parse.ts +0 -35
- 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/global.css +0 -1
- 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/.dockerignore +0 -3
- package/examples/parallelized-aws-lambda/Dockerfile +0 -21
- package/examples/parallelized-aws-lambda/Dockerfile.base +0 -64
- package/examples/parallelized-aws-lambda/README.md +0 -197
- package/examples/parallelized-aws-lambda/revideo-project/.puppeteerrc.cjs +0 -9
- package/examples/parallelized-aws-lambda/revideo-project/package-lock.json +0 -4133
- package/examples/parallelized-aws-lambda/revideo-project/package.json +0 -28
- package/examples/parallelized-aws-lambda/revideo-project/src/lambda.ts +0 -157
- 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/render.ts +0 -17
- 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/src/scenes/example.tsx +0 -30
- package/examples/parallelized-aws-lambda/revideo-project/tsconfig.json +0 -10
- 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/README.md +0 -9
- package/examples/rive-explanation-video/package.json +0 -25
- package/examples/rive-explanation-video/src/global.css +0 -1
- 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/render.ts +0 -15
- 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/tsconfig.json +0 -9
- package/examples/rive-explanation-video/vite.config.ts +0 -8
- 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 -187
- 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 -27
- 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.json +0 -23
- package/examples/stitching-videos/src/project.meta +0 -28
- package/examples/stitching-videos/src/project.ts +0 -20
- package/examples/stitching-videos/src/render.ts +0 -27
- 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/three-js-example/README.md +0 -8
- package/examples/three-js-example/package-lock.json +0 -2753
- package/examples/three-js-example/package.json +0 -25
- package/examples/three-js-example/src/components/Three.ts +0 -166
- package/examples/three-js-example/src/global.css +0 -1
- 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/render.ts +0 -15
- 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/tsconfig.json +0 -9
- package/examples/three-js-example/vite.config.ts +0 -6
- package/examples/youtube-shorts/README.md +0 -65
- package/examples/youtube-shorts/package-lock.json +0 -3881
- package/examples/youtube-shorts/package.json +0 -30
- package/examples/youtube-shorts/src/get-assets.ts +0 -34
- 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 -28
- package/examples/youtube-shorts/src/project.ts +0 -9
- package/examples/youtube-shorts/src/render.ts +0 -12
- package/examples/youtube-shorts/src/revideo.d.ts +0 -1
- package/examples/youtube-shorts/src/scenes/example.tsx +0 -224
- 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,178 +0,0 @@
|
|
|
1
|
-
import {Gradient, Img, Layout, Line, Rect, Spline, Txt, makeScene2D} from '@revideo/2d';
|
|
2
|
-
import {all, createRef, useScene, Vector2, waitFor} from '@revideo/core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Some example data to use in the scene when no data is provided
|
|
6
|
-
*/
|
|
7
|
-
const exampleData = [
|
|
8
|
-
0, 105826000, 265664000, 265671000, 265684000, 265689000, 265694000, 335596000, 414108000,
|
|
9
|
-
416767000, 425249000, 674375000, 964912000, 1177339000, 1186686000, 1213498000, 1214781000,
|
|
10
|
-
1214895000, 1219921000, 1221668000, 1222281000, 1222410000, 1222433000, 1227527000, 1228300000,
|
|
11
|
-
1230497000, 1230501000, 1231234000, 1231239000, 1231314000, 1232727000, 1233520000, 1234669000,
|
|
12
|
-
1236349000, 1236806000, 1237795000, 1245092000, 1251533000, 1254263000, 1262147000, 1262899000,
|
|
13
|
-
1264370000, 1267519000, 1268870000, 1271198000, 1271847000, 1274347000, 1276515000, 1276671000,
|
|
14
|
-
1279966000, 1280551000, 1283338000, 1283777000, 1285088000, 1286336000, 1286728000, 1293071000,
|
|
15
|
-
1293863000, 1294963000, 1295005000, 1301398000, 1303551000, 1312541000, 1317615000, 1321096000,
|
|
16
|
-
1323718000, 1337789000, 1343521000, 1344711000, 1346543000, 1371003000, 1389862000, 1494428000,
|
|
17
|
-
1525657000, 1533978000, 1591597000, 1654009000, 1738062000, 1817754000, 1860276000, 1883450000,
|
|
18
|
-
1883998000, 1891635000, 1930667000, 2055652000, 2201181000, 2216214000, 2246708000, 2324529000,
|
|
19
|
-
2366960000, 2366996000, 2391904000, 2479357000, 2596772000, 2601046000, 2615944000, 2637502000,
|
|
20
|
-
2689660000, 2733368000, 2737046000, 2812890000, 2863564000, 2955232000, 2955857000, 2961163000,
|
|
21
|
-
2983003000, 2984020000, 2987437000, 2990281000, 2996230000, 3007072000, 3007175000, 3013062000,
|
|
22
|
-
3016417000, 3018616000, 3019154000, 3026357000, 3029804000, 3036897000, 3037202000, 3037298000,
|
|
23
|
-
3037737000, 3038639000, 3039016000, 3039322000, 3042145000, 3042529000, 3043490000, 3044558000,
|
|
24
|
-
3046472000, 3047534000, 3048199000, 3048524000, 3048862000, 3051935000, 3058895000, 3065009000,
|
|
25
|
-
3072790000, 3074109000, 3075041000, 3079153000, 3079875000, 3080083000, 3099026000, 3099874000,
|
|
26
|
-
3103039000, 3109664000, 3112885000, 3127743000, 3134934000, 3140075000, 3173641000, 3173788000,
|
|
27
|
-
3176205000, 3176720000, 3178996000, 3183882000, 3184287000, 3186716000, 3191153000, 3196320000,
|
|
28
|
-
3196620000, 3198638000, 3213076000, 3234269000, 3263068000, 3270668000, 3278896000, 3284646000,
|
|
29
|
-
3290556000, 3294331000, 3297742000, 3332896000, 3344044000, 3368767000, 3378844000, 3398863000,
|
|
30
|
-
3434188000, 3435264000, 3435696000, 3435803000, 3442071000, 3517995000, 3519849000, 3554474000,
|
|
31
|
-
3558289000, 3611948000, 3616675000, 3618144000, 3622775000, 3635577000, 3640600000, 3669592000,
|
|
32
|
-
3679346000, 3698749000, 3715355000, 3729047000, 3759434000, 3787838000, 3801028000, 3817911000,
|
|
33
|
-
3878742000, 3983973000, 4006119000, 4067980000, 4087451000, 4101992000, 4200703000, 4212009000,
|
|
34
|
-
4212143000, 4212882000, 4213748000, 4213977000, 4214180000, 4214445000, 4220193000, 4220422000,
|
|
35
|
-
4222468000, 4236874000, 4258899000, 4326288000, 4334389000, 4401276000, 4416803000, 4421444000,
|
|
36
|
-
4437462000, 4501703000, 4556531000, 4598409000, 4690540000, 4736772000, 4742561000, 4803793000,
|
|
37
|
-
4834054000, 4866127000, 4868886000, 4873958000, 4891455000, 4921352000, 4941837000, 4953890000,
|
|
38
|
-
4956018000, 4979428000, 4985123000, 5062420000, 5108308000, 5333539000, 5459835000, 5461002000,
|
|
39
|
-
5521826000, 5584695000, 5586217000, 5598497000, 5604962000, 5625413000, 5636146000, 5637453000,
|
|
40
|
-
5682023000, 5718405000, 5722303000, 5760543000, 5769209000, 5772790000, 5880569000, 6110458000,
|
|
41
|
-
6135651000, 6185575000, 6202790000, 6232205000, 6284650000, 6297771000, 6392835000, 6401789000,
|
|
42
|
-
6480914000, 6566872000, 6643031000, 6695443000, 6696088000, 6710689000, 6712966000, 6727715000,
|
|
43
|
-
6733098000, 6783253000, 6805478000, 6875821000, 6904033000, 6971558000, 6972735000,
|
|
44
|
-
];
|
|
45
|
-
|
|
46
|
-
const exampleRepoName = 'redotvideo/revideo';
|
|
47
|
-
const exampleRepoImage = 'https://avatars.githubusercontent.com/u/133898679';
|
|
48
|
-
|
|
49
|
-
export default makeScene2D(function* (view) {
|
|
50
|
-
// Get variables
|
|
51
|
-
const repoName = useScene().variables.get('repoName', exampleRepoName);
|
|
52
|
-
const repoImage = useScene().variables.get('repoImage', exampleRepoImage);
|
|
53
|
-
const data = useScene().variables.get('data', exampleData);
|
|
54
|
-
|
|
55
|
-
const max = Math.max(...data());
|
|
56
|
-
const videoLength = 5; // seconds
|
|
57
|
-
const totalValues = data().length;
|
|
58
|
-
|
|
59
|
-
// Black background
|
|
60
|
-
view.fill('#000000');
|
|
61
|
-
|
|
62
|
-
// Calculate coordinates for each timestamp
|
|
63
|
-
const linePoints = data().map((ms, i) => {
|
|
64
|
-
const x = (ms / max) * view.width();
|
|
65
|
-
const xShifted = x - view.width() / 2;
|
|
66
|
-
|
|
67
|
-
const y = ((-i / totalValues) * view.height()) / 2;
|
|
68
|
-
const yShifted = y + view.height() / 4;
|
|
69
|
-
|
|
70
|
-
return new Vector2(xShifted, yShifted);
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
// Coordinates of the bottom corners
|
|
74
|
-
const bottomCorners = [
|
|
75
|
-
new Vector2(view.width() / 2, view.height() / 2),
|
|
76
|
-
new Vector2(-view.width() / 2, view.height() / 2),
|
|
77
|
-
];
|
|
78
|
-
|
|
79
|
-
// Background gradient
|
|
80
|
-
const gradient = new Gradient({
|
|
81
|
-
type: 'linear',
|
|
82
|
-
from: [0, 0],
|
|
83
|
-
to: [0, view.height()],
|
|
84
|
-
stops: [
|
|
85
|
-
{offset: 0, color: '#000000'},
|
|
86
|
-
{offset: 1, color: 'green'},
|
|
87
|
-
],
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
// Refs, used to animate elements
|
|
91
|
-
const outerLayoutRef = createRef<Layout>();
|
|
92
|
-
const innerLayoutRef = createRef<Layout>();
|
|
93
|
-
const rectRef = createRef<Rect>();
|
|
94
|
-
|
|
95
|
-
// Add elements to the view
|
|
96
|
-
yield view.add(
|
|
97
|
-
<>
|
|
98
|
-
<>
|
|
99
|
-
<Line points={linePoints} lineWidth={30} stroke={'#3EAC45'} />
|
|
100
|
-
<Spline points={[...linePoints, ...bottomCorners]} fill={gradient} />
|
|
101
|
-
<Rect
|
|
102
|
-
ref={rectRef}
|
|
103
|
-
x={view.width() / 2}
|
|
104
|
-
y={0}
|
|
105
|
-
width={view.width() * 2}
|
|
106
|
-
height={view.height()}
|
|
107
|
-
fill={'#000000'}
|
|
108
|
-
/>
|
|
109
|
-
</>
|
|
110
|
-
<Layout
|
|
111
|
-
ref={outerLayoutRef}
|
|
112
|
-
layout
|
|
113
|
-
alignItems={'center'}
|
|
114
|
-
gap={40}
|
|
115
|
-
x={-870}
|
|
116
|
-
y={-400}
|
|
117
|
-
offset={[-1, 0]}
|
|
118
|
-
>
|
|
119
|
-
<Img
|
|
120
|
-
src={repoImage()}
|
|
121
|
-
width={100}
|
|
122
|
-
height={100}
|
|
123
|
-
stroke={'#555555'}
|
|
124
|
-
lineWidth={8}
|
|
125
|
-
strokeFirst={true}
|
|
126
|
-
radius={10}
|
|
127
|
-
/>
|
|
128
|
-
<Layout ref={innerLayoutRef} direction={'column'}>
|
|
129
|
-
<Txt
|
|
130
|
-
fontFamily={'Roboto'}
|
|
131
|
-
text={repoName()}
|
|
132
|
-
fill={'#ffffff'}
|
|
133
|
-
x={-520}
|
|
134
|
-
y={-395}
|
|
135
|
-
fontSize={50}
|
|
136
|
-
fontWeight={600}
|
|
137
|
-
/>
|
|
138
|
-
</Layout>
|
|
139
|
-
</Layout>
|
|
140
|
-
</>,
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
// Resize the rectangle to reveal the scene
|
|
144
|
-
yield* rectRef().width(0, videoLength);
|
|
145
|
-
|
|
146
|
-
// Make rectangle transparent and cover the scene again
|
|
147
|
-
rectRef().fill('#00000000');
|
|
148
|
-
rectRef().width(view.width() * 2);
|
|
149
|
-
|
|
150
|
-
// Cover the scene while the Layout block
|
|
151
|
-
// is centered
|
|
152
|
-
yield* all(
|
|
153
|
-
rectRef().fill('#000000', 2),
|
|
154
|
-
outerLayoutRef().x(0, 2),
|
|
155
|
-
outerLayoutRef().y(-50, 2),
|
|
156
|
-
outerLayoutRef().offset([0, 0], 2),
|
|
157
|
-
);
|
|
158
|
-
|
|
159
|
-
// Add text with the total number of stars
|
|
160
|
-
const starTextRef = createRef<Txt>();
|
|
161
|
-
innerLayoutRef().add(
|
|
162
|
-
<Txt
|
|
163
|
-
fontFamily={'Roboto'}
|
|
164
|
-
ref={starTextRef}
|
|
165
|
-
text={`${totalValues} stars`}
|
|
166
|
-
fill={'#000000'}
|
|
167
|
-
x={0}
|
|
168
|
-
y={0}
|
|
169
|
-
fontSize={40}
|
|
170
|
-
fontWeight={500}
|
|
171
|
-
marginBottom={-45}
|
|
172
|
-
/>,
|
|
173
|
-
);
|
|
174
|
-
yield* all(starTextRef().fill('#ffffff', 2), starTextRef().margin(0, 2));
|
|
175
|
-
|
|
176
|
-
// Wait for 2 seconds
|
|
177
|
-
yield* waitFor(2);
|
|
178
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Stitching Together Videos
|
|
2
|
-
|
|
3
|
-
This is a very simple example demonstrating how you can stitch together multiple videos into one. It also includes a transition animation between the videos.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
https://github.com/redotvideo/revideo-examples/assets/122226645/6ec23514-e699-4a17-a9a5-02e7e14b207e
|
|
7
|
-
|
|
@@ -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.5.10",
|
|
13
|
-
"@revideo/2d": "0.5.10",
|
|
14
|
-
"@revideo/renderer": "0.5.10",
|
|
15
|
-
"@revideo/vite-plugin": "0.5.10",
|
|
16
|
-
"@revideo/ffmpeg": "0.5.10"
|
|
17
|
-
},
|
|
18
|
-
"devDependencies": {
|
|
19
|
-
"@revideo/ui": "0.5.10",
|
|
20
|
-
"typescript": "5.5.4",
|
|
21
|
-
"vite": "^4.5"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,28 +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/wasm",
|
|
25
|
-
"options": {}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {makeProject} from '@revideo/core';
|
|
2
|
-
import example from './scenes/example?scene';
|
|
3
|
-
|
|
4
|
-
export default makeProject({
|
|
5
|
-
scenes: [example],
|
|
6
|
-
variables: {
|
|
7
|
-
videos: [
|
|
8
|
-
{
|
|
9
|
-
src: "https://revideo-example-assets.s3.amazonaws.com/beach-3.mp4",
|
|
10
|
-
start: 1,
|
|
11
|
-
duration: 6
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
src: "https://revideo-example-assets.s3.amazonaws.com/beach-2.mp4",
|
|
15
|
-
start: 2,
|
|
16
|
-
duration: 10
|
|
17
|
-
}
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {renderVideo} from '@revideo/renderer';
|
|
2
|
-
|
|
3
|
-
async function render() {
|
|
4
|
-
console.log('Rendering video...');
|
|
5
|
-
// This is the main function that renders the video
|
|
6
|
-
const file = await renderVideo({
|
|
7
|
-
projectFile: './src/project.ts',
|
|
8
|
-
variables: {
|
|
9
|
-
videos: [
|
|
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
|
-
});
|
|
23
|
-
|
|
24
|
-
console.log(`Rendered video to ${file}`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
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,8 +0,0 @@
|
|
|
1
|
-
# 3D Animations with Three JS
|
|
2
|
-
|
|
3
|
-
This example project demonstrates how you can build render 3d animations with [three.js](https://threejs.org/) Revideo.
|
|
4
|
-
|
|
5
|
-
The animation itself in this project is not very complex - its main purpose is to demonstrate how you can use three.js together with Revideo and make use of concepts such as [tweening](https://docs.re.video/tweening/) in 3D.
|
|
6
|
-
|
|
7
|
-
https://github.com/user-attachments/assets/41af8137-e16a-43b3-a3e1-01b9cc9b700b
|
|
8
|
-
|