🎥 Make videos programmatically with React
add to docs
Jonny Burgerc3dcff2c9142
diff --git a/packages/docs/docs/cli/benchmark.mdx b/packages/docs/docs/cli/benchmark.mdxindex ef3a42b9c7..6ab9f1c73e 100644--- a/packages/docs/docs/cli/benchmark.mdx+++ b/packages/docs/docs/cli/benchmark.mdx@@ -231,6 +231,10 @@ Inherited from [`npx remotion render`](/docs/cli/render#--audio-bitrate)<Options id="offthreadvideo-cache-size-in-bytes" />+### `--media-cache-size-in-bytes`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `--binaries-directory`<AvailableFrom v="4.0.120" /><Options cli id="binaries-directory" />diff --git a/packages/docs/docs/cli/compositions.mdx b/packages/docs/docs/cli/compositions.mdxindex b602c1929c..3d407c8e23 100644--- a/packages/docs/docs/cli/compositions.mdx+++ b/packages/docs/docs/cli/compositions.mdx@@ -86,6 +86,10 @@ This will most notably disable CORS in Chrome among other security features.Lets you set a custom user agent that the headless Chrome browser assumes.+### `--media-cache-size-in-bytes`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `--offthreadvideo-cache-size-in-bytes`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/cli/render.mdx b/packages/docs/docs/cli/render.mdxindex 91bce0e9ac..6cca62e64d 100644--- a/packages/docs/docs/cli/render.mdx+++ b/packages/docs/docs/cli/render.mdx@@ -216,6 +216,10 @@ This will most notably disable CORS in Chrome among other security features.Lets you set a custom user agent that the headless Chrome browser assumes.+### `--media-cache-size-in-bytes`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `--offthreadvideo-cache-size-in-bytes`<AvailableFrom v="4.0.23"/><Options cli id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/cli/still.mdx b/packages/docs/docs/cli/still.mdxindex f4dcb0f262..10ab71a0e1 100644--- a/packages/docs/docs/cli/still.mdx+++ b/packages/docs/docs/cli/still.mdx@@ -120,6 +120,10 @@ This will most notably disable CORS in Chrome among other security features.Lets you set a custom user agent that the headless Chrome browser assumes.+### `--media-cache-size-in-bytes`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `--offthreadvideo-cache-size-in-bytes`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/cloudrun/cli/render.mdx b/packages/docs/docs/cloudrun/cli/render.mdxindex 47188a35b3..a55a81a2cf 100644--- a/packages/docs/docs/cloudrun/cli/render.mdx+++ b/packages/docs/docs/cloudrun/cli/render.mdx@@ -191,6 +191,10 @@ For example only every second frame, every third frame and so on. Only works for[Render a subset of a video](/docs/config#setframerange). Example: `--frames=0-9` to select the first 10 frames.+### `--media-cache-size-in-bytes`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `--offthreadvideo-cache-size-in-bytes`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/cloudrun/cli/still.mdx b/packages/docs/docs/cloudrun/cli/still.mdxindex 655f205b1c..4b709e17a3 100644--- a/packages/docs/docs/cloudrun/cli/still.mdx+++ b/packages/docs/docs/cloudrun/cli/still.mdx@@ -101,6 +101,10 @@ Specify the url of the service which should be used to perform the render. You mSpecify the name of the service which should be used to perform the render. This is used in conjunction with the region to determine the service endpoint, as the same service name can exist across multiple regions. You must set either `cloud-run-url` _or_ `service-name`, but not both.+### `--media-cache-size-in-bytes`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `--offthreadvideo-cache-size-in-bytes`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx b/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdxindex d14f73e092..13f0b0b3a6 100644--- a/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx+++ b/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx@@ -359,6 +359,10 @@ Render a silent audio track if there wouldn't be any otherwise.<Options id="prefer-lossless" />+### `mediaCacheSizeInBytes?`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `offthreadVideoCacheSizeInBytes?`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx b/packages/docs/docs/cloudrun/renderstilloncloudrun.mdxindex 2c56f9e0c9..a059fc1c4e 100644--- a/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx+++ b/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx@@ -190,6 +190,10 @@ _optional_A number describing how long the render may take to resolve all [`delayRender()`](/docs/delay-render) calls [before it times out](/docs/timeout). Default: `30000`+### `mediaCacheSizeInBytes?`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `offthreadVideoCacheSizeInBytes?`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/lambda/cli/compositions.mdx b/packages/docs/docs/lambda/cli/compositions.mdxindex 3ff71cfad0..6f99c20b70 100644--- a/packages/docs/docs/lambda/cli/compositions.mdx+++ b/packages/docs/docs/lambda/cli/compositions.mdx@@ -123,6 +123,10 @@ Specify a specific bucket name to be used. [This is not recommended](/docs/lambdLets you set a custom user agent that the headless Chrome browser assumes.+### `--media-cache-size-in-bytes`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `--offthreadvideo-cache-size-in-bytes`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/lambda/cli/render.mdx b/packages/docs/docs/lambda/cli/render.mdxindex 880f1ebe5b..ae9312963d 100644--- a/packages/docs/docs/lambda/cli/render.mdx+++ b/packages/docs/docs/lambda/cli/render.mdx@@ -262,6 +262,10 @@ This will most notably disable CORS in Chrome among other security features.Lets you set a custom user agent that the headless Chrome browser assumes.+### `--media-cache-size-in-bytes`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `--offthreadvideo-cache-size-in-bytes`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/lambda/cli/still.mdx b/packages/docs/docs/lambda/cli/still.mdxindex 6988bff422..832c854438 100644--- a/packages/docs/docs/lambda/cli/still.mdx+++ b/packages/docs/docs/lambda/cli/still.mdx@@ -110,6 +110,10 @@ This will most notably disable CORS in Chrome among other security features.Lets you set a custom user agent that the headless Chrome browser assumes.+### `--media-cache-size-in-bytes`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `--offthreadvideo-cache-size-in-bytes`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/lambda/getcompositionsonlambda.mdx b/packages/docs/docs/lambda/getcompositionsonlambda.mdxindex 0109552ce0..2cb3e902e5 100644--- a/packages/docs/docs/lambda/getcompositionsonlambda.mdx+++ b/packages/docs/docs/lambda/getcompositionsonlambda.mdx@@ -103,6 +103,10 @@ Specify a specific bucket name to be used. [This is not recommended](/docs/lambdLogs can be read through the CloudWatch URL that this function returns.+### `mediaCacheSizeInBytes?`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `offthreadVideoCacheSizeInBytes?`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/lambda/rendermediaonlambda.mdx b/packages/docs/docs/lambda/rendermediaonlambda.mdxindex 4be8696932..a3eda124b7 100644--- a/packages/docs/docs/lambda/rendermediaonlambda.mdx+++ b/packages/docs/docs/lambda/rendermediaonlambda.mdx@@ -362,6 +362,10 @@ Specify a specific bucket name to be used. [This is not recommended](/docs/lambdIf the `logLevel` is set to `verbose`, the Lambda function will not clean up artifacts, to aid debugging. Do not use it unless you are debugging a problem.+### `mediaCacheSizeInBytes?`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `offthreadVideoCacheSizeInBytes?`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/lambda/renderstillonlambda.mdx b/packages/docs/docs/lambda/renderstillonlambda.mdxindex bc02ccefca..bcfe218c6d 100644--- a/packages/docs/docs/lambda/renderstillonlambda.mdx+++ b/packages/docs/docs/lambda/renderstillonlambda.mdx@@ -199,6 +199,10 @@ Either:- `{"type": "play-in-browser"}` - the default. The video will play in the browser.- `{"type": "download", fileName: null}` or `{"type": "download", fileName: "download.mp4"}` - a `Content-Disposition` header will be added which makes the browser download the file. You can optionally override the filename.+### `mediaCacheSizeInBytes?`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `offthreadVideoCacheSizeInBytes?`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/docs/docs/renderer/select-composition.mdx b/packages/docs/docs/renderer/select-composition.mdxindex 6531363a36..96cc6a33bc 100644--- a/packages/docs/docs/renderer/select-composition.mdx+++ b/packages/docs/docs/renderer/select-composition.mdx@@ -85,6 +85,10 @@ An object containing environment variables to be injected in your project.See: [Environment variables](/docs/env-variables/)+### `mediaCacheSizeInBytes?`<AvailableFrom v="4.0.352"/>++<Options id="media-cache-size-in-bytes" />+### `offthreadVideoCacheSizeInBytes?`<AvailableFrom v="4.0.23"/><Options id="offthreadvideo-cache-size-in-bytes" />diff --git a/packages/renderer/src/options/video-cache-size.tsx b/packages/renderer/src/options/video-cache-size.tsxindex ab55614280..b11627c3be 100644--- a/packages/renderer/src/options/video-cache-size.tsx+++ b/packages/renderer/src/options/video-cache-size.tsx@@ -46,29 +46,3 @@ export const mediaCacheSizeInBytesOption = {mediaCacheSizeInBytes = size ?? null;},} satisfies AnyRemotionOption<number | null>;--export const validateMediaCacheSizeInBytes = (option: unknown) => {- if (option === undefined || option === null) {- return;- }-- if (typeof option !== 'number') {- throw new Error('Expected a number');- }-- if (option < 0 || option === 0) {- throw new Error('Expected a positive number');- }-- if (Number.isNaN(option)) {- throw new Error('Expected a number');- }-- if (!Number.isFinite(option)) {- throw new Error('Expected a finite number');- }-- if (option % 1 !== 0) {- throw new Error('Expected a whole number');- }-};