Skip to content

🎥 Make videos programmatically with React

Merge branch 'main' into lambda-testing

Jonny Burger03695ea3cbc6
diff --cc package.json
index ea52710e07,ee48096cb3..3c59072caf
--- a/package.json
+++ b/package.json
@@@ -1,5 -1,5 +1,5 @@@
{
- "version": "2.6.1",
- "version": "1.0.0-alpha.4",
++ "version": "2.6.3",
"private": true,
"license": "SEE LICENSE IN LICENSE.md",
"scripts": {
@@@ -30,19 -28,17 +30,19 @@@
"prettier": "^2.2.1",
"prettier-plugin-organize-imports": "^1.1.1",
"sharp": "^0.29.0",
- "@remotion/babel-loader": "2.6.1",
- "@remotion/three": "2.6.1",
- "@remotion/player": "2.6.1",
- "@remotion/gif": "2.6.1",
- "@remotion/cli": "2.6.1",
- "@remotion/lambda": "2.6.1",
- "@remotion/media-utils": "2.6.1",
- "@remotion/renderer": "2.6.1",
- "@remotion/bundler": "2.6.1",
- "remotion": "2.6.1",
+ "@remotion/babel-loader": "2.6.3",
+ "@remotion/three": "2.6.3",
+ "@remotion/player": "2.6.3",
+ "@remotion/gif": "2.6.3",
+ "@remotion/cli": "2.6.3",
++ "@remotion/lambda": "2.6.3",
+ "@remotion/media-utils": "2.6.3",
+ "@remotion/renderer": "2.6.3",
+ "@remotion/bundler": "2.6.3",
+ "remotion": "2.6.3",
"ts-jest": "^27.0.5",
- "typescript": "^4.4.2"
+ "typescript": "^4.4.2",
+ "esbuild": "^0.11.12"
},
"dependencies": {
"@react-three/fiber": "^7.0.19",
diff --cc packages/cli/package.json
index 2606965112,9a083b9baa..f047fe5528
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@@ -26,10 -26,9 +26,10 @@@
"better-opn": "^2.1.1",
"chalk": "^4.1.0",
"dotenv": "^9.0.0",
+ "esbuild": "^0.11.12",
"execa": "^4.0.2",
"minimist": "^1.2.5",
- "remotion": "2.6.1",
+ "remotion": "2.6.3",
"semver": "^7.3.4",
"webpack": "5.60.0"
},
diff --cc packages/docs/docs/render-frames.md
index 2bcd61fadf,f907885fa1..0b34a14653
--- a/packages/docs/docs/render-frames.md
+++ b/packages/docs/docs/render-frames.md
@@@ -205,15 -156,9 +205,15 @@@ _optional, available from v2.3.1
A string defining the absolute path on disk of the browser executable that should be used. By default Remotion will try to detect it automatically and download one if none is available. If `puppeteerInstance` is defined, it will take precedence over `browserExecutable`.
+### `onFrameBuffer?`
+
+_optional, available from 3.0_
+
+If you passed `null` to `outputDir`, this method will be called passing a buffer of the current frame. This is mostly used internally by Remotion to implement [`renderMedia()`](/docs/renderer/render-media) and might have limited usefulness for end users.
+
### `timeoutInMilliseconds?`
- _optional, available from v2.6.2_
+ _optional, available from v2.6.3_
A number describing how long one frame may take to resolve all `delayRender()` calls before the render times out and fails. Default: `30000`
diff --cc packages/docs/docs/timeout.md
index 9ce5d7506c,2e12d41360..9cefbc4b79
--- a/packages/docs/docs/timeout.md
+++ b/packages/docs/docs/timeout.md
@@@ -57,10 -57,10 +57,10 @@@ Sometimes, you cannot avoid a render ta
- Expensive WebGL scenes
- Expensive preprocessing of data
- You can increase the default timeout from v2.6.2 on:
+ You can increase the default timeout from v2.6.3 on:
- Using the [`--timeout`](/docs/cli#--timeout) CLI flag
-- Using the `timeoutInMilliseconds` option in [`renderStill()`](/docs/render-still#timeoutinmilliseconds), [`renderFrames()`](/docs/render-frames#timeoutinmilliseconds) and [`getCompositions()`](/docs/get-compositions#timeoutinmilliseconds)
+- Using the `timeoutInMilliseconds` option in [`renderStill()`](/docs/render-still#timeoutinmilliseconds), [`renderFrames()`](/docs/render-frames#timeoutinmilliseconds), [`getCompositions()`](/docs/get-compositions#timeoutinmilliseconds), [`renderMedia()`](/docs/renderer/render-media#timeoutinmilliseconds), [`renderMediaOnLambda()`](/docs/lambda/rendermediaonlambda#timeoutinmilliseconds) and [`renderStillOnLambda()`](/docs/lambda/renderstillonlambda#timeoutinmilliseconds)
- Using the [`Config.Puppeteer.setTimeoutInMilliseconds()`](/docs/config#settimeoutinmilliseconds) option in the config file
## See also
diff --cc packages/example/package.json
index 40e22450d6,bf93ab0389..86a10eaf58
--- a/packages/example/package.json
+++ b/packages/example/package.json
@@@ -23,17 -23,16 +23,17 @@@
"@babel/preset-env": "7.12.13",
"@babel/preset-react": "7.12.13",
"@mdx-js/react": "^1.6.21",
- "@react-three/drei": "^7.22.9",
- "@remotion/babel-loader": "2.6.1",
- "@remotion/bundler": "2.6.1",
- "@remotion/cli": "2.6.1",
- "@remotion/eslint-config": "2.6.1",
- "@remotion/eslint-plugin": "2.6.1",
- "@remotion/gif": "2.6.1",
- "@remotion/lambda": "2.6.1",
- "@remotion/media-utils": "2.6.1",
- "@remotion/renderer": "2.6.1",
- "@remotion/three": "2.6.1",
- "@react-three/drei": "^7.22.7",
++ "@react-three/drei": "^7.22.79",
+ "@remotion/babel-loader": "2.6.3",
+ "@remotion/bundler": "2.6.3",
+ "@remotion/cli": "2.6.3",
+ "@remotion/eslint-config": "2.6.3",
+ "@remotion/eslint-plugin": "2.6.3",
+ "@remotion/gif": "2.6.3",
++ "@remotion/lambda": "2.6.3",
+ "@remotion/media-utils": "2.6.3",
+ "@remotion/renderer": "2.6.3",
+ "@remotion/three": "2.6.3",
"@types/express": "^4.17.11",
"@types/node": "^16.7.5",
"@types/styled-components": "^5.1.1",
diff --cc packages/renderer/src/assets/download-and-map-assets-to-file.ts
index 57114ae634,a63862520c..3f81619349
--- a/packages/renderer/src/assets/download-and-map-assets-to-file.ts
+++ b/packages/renderer/src/assets/download-and-map-assets-to-file.ts
@@@ -4,12 -4,7 +4,12 @@@ import got from 'got'
import path from 'path';
import {Internals, random, TAsset} from 'remotion';
- import sanitizeFilename from 'sanitize-filename';
+import {ensureOutputDirectory} from '../ensure-output-directory';
+
+export type RenderMediaOnDownload = (
+ src: string
+) => ((progress: {percent: number}) => void) | undefined | void;
+ import {sanitizeFilePath} from './sanitize-filepath';
const isDownloadingMap: {[key: string]: boolean} = {};
const hasBeenDownloadedMap: {[key: string]: boolean} = {};
@@@ -173,8 -172,8 +173,8 @@@ export const getSanitizedFilenameForAss
''
);
return path.join(
- webpackBundle,
+ downloadDir,
- sanitizeFilename(hashedFileName + fileExtension)
+ sanitizeFilePath(hashedFileName + fileExtension)
);
};
diff --cc pnpm-lock.yaml
index 34155540b9,98b7ba9955..2162a0ae88
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@@ -6,15 -6,14 +6,15 @@@ importers
specifiers:
'@jonny/eslint-config': ^2.1.248
'@react-three/fiber': ^7.0.19
- '@remotion/babel-loader': 2.6.1
- '@remotion/bundler': 2.6.1
- '@remotion/cli': 2.6.1
- '@remotion/gif': 2.6.1
- '@remotion/lambda': 2.6.1
- '@remotion/media-utils': 2.6.1
- '@remotion/player': 2.6.1
- '@remotion/renderer': 2.6.1
- '@remotion/three': 2.6.1
+ '@remotion/babel-loader': 2.6.3
+ '@remotion/bundler': 2.6.3
+ '@remotion/cli': 2.6.3
+ '@remotion/gif': 2.6.3
++ '@remotion/lambda': 2.6.3
+ '@remotion/media-utils': 2.6.3
+ '@remotion/player': 2.6.3
+ '@remotion/renderer': 2.6.3
+ '@remotion/three': 2.6.3
'@types/jest': ^27.0.2
'@types/minimist': ^1.2.1
'@types/node': ^16.7.5
@@@ -399,17 -395,16 +403,17 @@@
'@babel/preset-env': 7.12.13
'@babel/preset-react': 7.12.13
'@mdx-js/react': ^1.6.21
- '@react-three/drei': ^7.22.9
- '@remotion/babel-loader': 2.6.1
- '@remotion/bundler': 2.6.1
- '@remotion/cli': 2.6.1
- '@remotion/eslint-config': 2.6.1
- '@remotion/eslint-plugin': 2.6.1
- '@remotion/gif': 2.6.1
- '@remotion/lambda': 2.6.1
- '@remotion/media-utils': 2.6.1
- '@remotion/renderer': 2.6.1
- '@remotion/three': 2.6.1
- '@react-three/drei': ^7.22.7
++ '@react-three/drei': ^7.22.79
+ '@remotion/babel-loader': 2.6.3
+ '@remotion/bundler': 2.6.3
+ '@remotion/cli': 2.6.3
+ '@remotion/eslint-config': 2.6.3
+ '@remotion/eslint-plugin': 2.6.3
+ '@remotion/gif': 2.6.3
++ '@remotion/lambda': 2.6.3
+ '@remotion/media-utils': 2.6.3
+ '@remotion/renderer': 2.6.3
+ '@remotion/three': 2.6.3
'@types/babel__core': ^7.1.12
'@types/babel__template': ^7.4.0
'@types/express': ^4.17.11
@@@ -436,7 -431,7 +440,7 @@@
'@babel/preset-env': 7.12.13
'@babel/preset-react': 7.12.13
'@mdx-js/react': [email protected]
- '@react-three/drei': 7.22.9_97399ed2f1f8f5fafe21a20596301067
- '@react-three/drei': 7.22.7_97399ed2f1f8f5fafe21a20596301067
++ '@react-three/drei': 7.27.5_97399ed2f1f8f5fafe21a20596301067
'@remotion/babel-loader': link:../babel-loader
'@remotion/bundler': link:../bundler
'@remotion/cli': link:../cli
@@@ -503,68 -497,7 +507,68 @@@
prettier-plugin-organize-imports: [email protected][email protected]
ts-jest: 27.0.5_52a571d76319e63aeaa66dc9db9e90cc
typescript: 4.4.3
- webpack: 5.60.0
+ webpack: [email protected]
+
+ packages/lambda:
+ specifiers:
+ '@aws-sdk/abort-controller': 3.40.0
+ '@aws-sdk/client-cloudwatch-logs': 3.42.0
+ '@aws-sdk/client-iam': 3.42.0
+ '@aws-sdk/client-lambda': 3.42.0
+ '@aws-sdk/client-s3': 3.42.0
+ '@aws-sdk/lib-storage': 3.42.0
+ '@aws-sdk/s3-request-presigner': 3.42.0
+ '@jonny/eslint-config': ^2.1.242
- '@remotion/bundler': 2.6.1
- '@remotion/cli': 2.6.1
- '@remotion/renderer': 2.6.1
++ '@remotion/bundler': 2.6.3
++ '@remotion/cli': 2.6.3
++ '@remotion/renderer': 2.6.3
+ '@types/jest': ^27.0.2
+ '@types/node': ^14.14.14
+ '@types/prompt': ^1.1.0
+ aws-policies: ^1.0.1
+ dotenv: ^10.0.0
+ esbuild: ^0.11.12
+ eslint: ^7.32.0
+ jest: ^27.2.4
+ minimist: ^1.2.5
+ p-limit: ^3.1.0
+ prettier: ^2.4.1
+ prettier-plugin-organize-imports: ^2.3.4
- remotion: 2.6.1
++ remotion: 2.6.3
+ ts-jest: ^27.0.5
+ ts-node: ^9.1.1
+ typescript: ^4.4.3
+ zip-lib: ^0.7.2
+ dependencies:
+ '@aws-sdk/abort-controller': 3.40.0
+ '@aws-sdk/client-cloudwatch-logs': 3.42.0
+ '@aws-sdk/client-iam': 3.42.0
+ '@aws-sdk/client-lambda': 3.42.0
+ '@aws-sdk/client-s3': 3.42.0
+ '@aws-sdk/lib-storage': 3.42.0_ed4f376b350c0d63a41a72f2ea3ac6e2
+ '@aws-sdk/s3-request-presigner': 3.42.0
+ '@remotion/bundler': link:../bundler
+ '@remotion/cli': link:../cli
+ '@remotion/renderer': link:../renderer
+ aws-policies: 1.0.1
+ dotenv: 10.0.0
+ minimist: 1.2.5
+ p-limit: 3.1.0
+ remotion: link:../core
+ devDependencies:
+ '@jonny/eslint-config': [email protected][email protected]
+ '@types/jest': 27.0.2
+ '@types/node': 14.17.20
+ '@types/prompt': 1.1.1
+ esbuild: 0.11.23
+ eslint: 7.32.0
+ prettier: 2.4.1
+ prettier-plugin-organize-imports: [email protected][email protected]
+ ts-jest: 27.0.5_51c11d010e286a135a5a392005601a98
+ ts-node: [email protected]
+ typescript: 4.4.4
+ zip-lib: 0.7.2
packages/media-utils:
specifiers:
@@@ -7311,8 -6283,8 +7313,64 @@@ packages
react-dom: [email protected]
dev: false
- /@react-three/drei/7.22.9_97399ed2f1f8f5fafe21a20596301067:
- resolution: {integrity: sha512-+SJZlrkU9XCnpSxgbrH93E8WHIPF6oysorku5dV3ppQ7xcvmQ664Dzd3k6Q1WuIgMwuci9sjqhVeEI+6mx215A==}
- /@react-three/drei/7.22.7_97399ed2f1f8f5fafe21a20596301067:
- resolution: {integrity: sha512-z4fENOytRsv0cAMuP5aj9tXVyDfp0nl0NC5PSyKtZZbBe05ObwQx7VFIbYybEW7eROryKGD7o3Vbs5POTenlYw==}
++ /@react-spring/animated/[email protected]:
++ resolution: {integrity: sha512-Dzum5Ho8e+LIAegAqRyoQFakD2IVH3ZQ2nsFXJorAFq3Xjv6IVPz/+TNxb/wSvnsMludfoF+ZIf319FSFmgD5w==}
++ peerDependencies:
++ react: ^16.8.0 || ^17.0.0
++ dependencies:
++ '@react-spring/shared': [email protected]
++ '@react-spring/types': 9.4.2
++ react: 17.0.2
++ dev: false
++
++ /@react-spring/core/[email protected]:
++ resolution: {integrity: sha512-Ej/ULwdx8rQtMAWEpLgwbKcQEx6vPfjyG3cxLP05zAInpCoWkYpl+sXOp9tn3r99mTNQPTTt7BgQsSnmQA8+rQ==}
++ peerDependencies:
++ react: ^16.8.0 || ^17.0.0
++ dependencies:
++ '@react-spring/animated': [email protected]
++ '@react-spring/rafz': 9.4.2
++ '@react-spring/shared': [email protected]
++ '@react-spring/types': 9.4.2
++ react: 17.0.2
++ dev: false
++
++ /@react-spring/rafz/9.4.2:
++ resolution: {integrity: sha512-rSm+G8E/XEEpnCGtT/xYN6o8VvEXlU8wN/hyKp4Q44XAZzGSMHLIFP7pY94/MmWsxCxjkw1AxUWhiFYxWrnI5Q==}
++ dev: false
++
++ /@react-spring/shared/[email protected]:
++ resolution: {integrity: sha512-mZtbQLpMm6Vy5+O1MSlY9KuAcMO8rdUQvtdnC7Or7y7xiZlnzj8oAILyO6Y2rD2ZC1PmgVS0gMev/8T+MykW+Q==}
++ peerDependencies:
++ react: ^16.8.0 || ^17.0.0
++ dependencies:
++ '@react-spring/rafz': 9.4.2
++ '@react-spring/types': 9.4.2
++ react: 17.0.2
++ dev: false
++
++ /@react-spring/three/9.4.2_d666031339b56f8d2964a0706e6252a7:
++ resolution: {integrity: sha512-qAPHOMjQjl9V3Eh4Xbdsdx9mAMe+rtSBfEuZGfoF5l8P8zC42gxggbyM1sKUOip3yyz76YTPiosWkmvgCVxMng==}
++ peerDependencies:
++ '@react-three/fiber': '>=6.0'
++ react: '>=16.11'
++ three: '>=0.126'
++ dependencies:
++ '@react-spring/animated': [email protected]
++ '@react-spring/core': [email protected]
++ '@react-spring/shared': [email protected]
++ '@react-spring/types': 9.4.2
++ '@react-three/fiber': 7.0.19_907a6f2f9ddb15de374f8d77b33fd4f4
++ react: 17.0.2
++ three: 0.134.0
++ dev: false
++
++ /@react-spring/types/9.4.2:
++ resolution: {integrity: sha512-GGiIscTM+CEUNV52anj3g5FqAZKL2+eRKtvBOAlC99qGBbvJ3qTLImrUR/I3lXY7PRuLgzI6kh34quA1oUxWYQ==}
++ dev: false
++
++ /@react-three/drei/7.27.5_97399ed2f1f8f5fafe21a20596301067:
++ resolution: {integrity: sha512-LD0BvN+toHnyn7TV+M50+MbtVIX1PXwHX9RXRa6wgBBDFWBRXNUQb37401+vgzqYV61/JZtxd+b4kM+OYZGpkg==}
peerDependencies:
'@react-three/fiber': '>=6.0'
react: '>=17.0'
@@@ -7323,8 -6295,8 +7381,10 @@@
optional: true
dependencies:
'@babel/runtime': 7.15.4
++ '@react-spring/three': 9.4.2_d666031339b56f8d2964a0706e6252a7
'@react-three/fiber': 7.0.19_907a6f2f9ddb15de374f8d77b33fd4f4
-- detect-gpu: 3.1.27
++ '@use-gesture/react': [email protected]
++ detect-gpu: 3.1.30
glsl-noise: 0.0.0
lodash.omit: 4.5.0
lodash.pick: 4.4.0
@@@ -7335,8 -6307,8 +7395,8 @@@
stats.js: 0.17.0
three: 0.134.0
three-mesh-bvh: [email protected]
-- three-stdlib: [email protected]
-- troika-three-text: [email protected]
++ three-stdlib: [email protected]
++ troika-three-text: [email protected]
use-asset: [email protected]
utility-types: 3.10.0
@@@ -8378,6 -7341,6 +8438,19 @@@
- supports-color
dev: false
++ /@use-gesture/core/10.2.4:
++ resolution: {integrity: sha512-fk1LjCBj43BKb8NE05qkdtPOR0ngA7PwgvEqfFap/h+s7QHi+JTv4/mtDQ4wI9zzem+Ry5EKrHS/cVdBehI4wA==}
++ dev: false
++
++ /@use-gesture/react/[email protected]:
++ resolution: {integrity: sha512-CbqyRj+qNbRBOGmS8OWtaOa29fxEr7bKTYHvPuMQ1wsgQDh2/DqQxbp7cFxAg6WZ8oZjppDj/EkWnw22WpIIWQ==}
++ peerDependencies:
++ react: '>= 16.8.0'
++ dependencies:
++ '@use-gesture/core': 10.2.4
++ react: 17.0.2
++ dev: false
++
/@webassemblyjs/ast/1.11.1:
resolution: {integrity: sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==}
dependencies:
@@@ -11596,8 -10543,8 +11669,8 @@@
repeat-string: 1.6.1
dev: false
-- /detect-gpu/3.1.27:
-- resolution: {integrity: sha512-uIZUG25pt0ArIJjFEBYYzigoWe4gyEa4MzHpi9wXIVJw9LvznSHimvfjchOQJ6oJ55oMlEIt3WJ+Mt58nDm8qg==}
++ /detect-gpu/3.1.30:
++ resolution: {integrity: sha512-WUOk8imHH56AWVt6iHry69qbNEFsPjtS6qsinurfxeI3bVYQZzFk8zECTaodLxfeRad7QspDjjkJWkp5vBo8WA==}
dependencies:
webgl-constants: 1.1.1
dev: false
@@@ -21989,8 -20901,8 +22056,8 @@@
three: 0.134.0
dev: false
-- /three-stdlib/[email protected]:
-- resolution: {integrity: sha512-z9lqprjZLIu2lTd9+ux2208uNPY7ZXJoo7Q/ObcT1YFfJKrm0kOCKa09GDt9CpB75ddUKhgAaJm6T9T3o1ofgA==}
++ /three-stdlib/[email protected]:
++ resolution: {integrity: sha512-vc+/op2LYGnSN4y2QhxyyFm6WvdLQ/M0vpPxT0anB40lpA3t5+B9R9so/X53BOP8SiENG5YKVNQGXhqwTJJHGw==}
peerDependencies:
three: '>=0.128.0'
dependencies:
@@@ -22176,27 -21088,27 +22243,27 @@@
resolution: {integrity: sha1-WFhUf2spB1fulczMZm+1AITEYN0=}
dev: false
-- /troika-three-text/[email protected]:
-- resolution: {integrity: sha512-lZcTImvd5VkrZGA1qQx8zRs20Eel5Ue4ZpxnHtvgpGHi+lJemNIpkwtGOgk73DmLAkBm6it3nG5RCE5IxufqCg==}
++ /troika-three-text/[email protected]:
++ resolution: {integrity: sha512-YwqXczjXQ4yq2a2ufO9icOIjeJutE/ODS8PHmmt/WAzVFqoiqeemclp/Ewiqm0+sdI1KnWRm6lj8df/zmhU3Og==}
peerDependencies:
three: '>=0.103.0'
dependencies:
bidi-js: 1.0.2
three: 0.134.0
-- troika-three-utils: [email protected]
-- troika-worker-utils: 0.43.0
++ troika-three-utils: [email protected]
++ troika-worker-utils: 0.44.0
dev: false
-- /troika-three-utils/[email protected]:
-- resolution: {integrity: sha512-UVc4jOob1VjrX0awA0dHxmHZ8yvgq8W/kmtihMnMeObm0HNOobPKAWm/N6o34/k/FPgOtUMDHYgkw+TG2RNouA==}
++ /troika-three-utils/[email protected]:
++ resolution: {integrity: sha512-gaEpqrlWnkrVU5UgUx+YZTC8NrhsA2Tt6zEIbn3WNuom7pLtrgjuHpAM72gif7DoYdOWEyFco3Zb6rpJh9Fodg==}
peerDependencies:
three: '>=0.103.0'
dependencies:
three: 0.134.0
dev: false
-- /troika-worker-utils/0.43.0:
-- resolution: {integrity: sha512-8YXWwfviJ1N/9+nuE5dT9RFttmDsIF8CP7d6rRsBBhH55il3fBqpFSuzTlOcdgC1yq8Hmhi6GgIl6eK4Zt+hTw==}
++ /troika-worker-utils/0.44.0:
++ resolution: {integrity: sha512-/ETcH1rUoO9hVBL6Ifea2WOoGPw90ncrk8b8SJKTLtzcQvEWRIZ4eUxlVCtU93fLechCV+DWPs1y8+Bjh1WaJg==}
dev: false
/trough/1.0.5: