Skip to content

πŸŽ₯ Make videos programmatically with React

update

Jonny Burger98ecaa964572
diff --git a/.prettierignore b/.prettierignore
index bf4ce5fbdd..3ce3a3b888 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,12 +1,3 @@
-packages/docs/docs/artifacts.mdx
-packages/docs/docs/calculate-metadata.mdx
-packages/docs/docs/transitions/transitionseries.mdx
-packages/docs/docs/transitions/presentations/custom.mdx
-packages/docs/docs/studio-app.mdx
-packages/docs/docs/cloudrun/cli/regions.mdx
-packages/docs/docs/flickering.mdx
-packages/docs/docs/lambda/feb-2023-incident.mdx
-packages/docs/docs/lambda/how-lambda-works.mdx
-packages/docs/docs/lambda/s3-public-access.mdx
-packages/docs/docs/player-into-remotion-project.mdx
-packages/docs/docs/miscellaneous/cloud-gpu-docker.mdx
+# Prettier for docs is temporarily disabled:
+# https://github.com/prettier/prettier/issues/12209
+packages/docs/docs
diff --git a/packages/docs/docs/artifacts.mdx b/packages/docs/docs/artifacts.mdx
index 1a670f7870..014c7f92dd 100644
--- a/packages/docs/docs/artifacts.mdx
+++ b/packages/docs/docs/artifacts.mdx
@@ -73,7 +73,6 @@ Use the [`onArtifact`](/docs/renderer/render-media#onartifact) callback to recei
// @module: es2022
// @target: es2017
import type {VideoConfig} from 'remotion';
-import fs from 'fs';
const composition: VideoConfig = {
width: 100,
@@ -87,103 +86,5 @@ const composition: VideoConfig = {
};
const serveUrl = 'http://localhost:8080';
const inputProps = {};
-// ---cut---
-import {renderMedia, OnArtifact} from '@remotion/renderer';
-
-const onArtifact: OnArtifact = (artifact) => {
- console.log(artifact.filename); // string
- console.log(artifact.content); // string | Uint8Array
- console.log(artifact.frame); // number, frame in the composition which emitted this
-
- // Example action: Write the artifact to disk
- fs.writeFileSync(artifact.filename, artifact.content);
-};
-await renderMedia({
- composition,
- serveUrl,
- onArtifact,
- codec: 'h264',
- inputProps,
-});
```
-
-### Using the Remotion Lambda CLI
-
-When using [`npx remotion lambda render`](/docs/lambda/cli/render) or [`npx remotion lambda still`](/docs/lambda/cli/still), artifacts get saved to the S3 bucket under the key `renders/[render-id]/artifacts/[filename]`.
-
-They will get logged to the console and you can click them to download them.
-The `--privacy` option also applies to artifacts.
-
-### Using `renderMediaOnLambda()`
-
-When using [`renderMediaOnLambda()`](/docs/lambda/rendermediaonlambda), artifacts get saved to the S3 bucket under the key `renders/[render-id]/artifacts/[filename]`.
-
-You can obtain a list of currently received assets from [`getRenderProgress()`](/docs/lambda/getrenderprogress#artifacts).
-
-```tsx twoslash title="progress.ts"
-// @module: es2022
-// @target: es2017
-import {getRenderProgress} from '@remotion/lambda/client';
-
-const renderProgress = await getRenderProgress({
- renderId: 'hi',
- functionName: 'hi',
- bucketName: 'hi',
- region: 'eu-central-1',
-});
-
-for (const artifact of renderProgress.artifacts) {
- console.log(artifact.filename); // "hello-world.txt"
- console.log(artifact.sizeInBytes); // 12
- console.log(artifact.s3Url); // "https://s3.eu-central-1.amazonaws.com/remotion-lambda-abcdef/renders/abcdef/artifacts/hello-world.txt"
- console.log(artifact.s3Key); // "renders/abcdef/artifacts/hello-world.txt"
-}
-```
-
-### Using `renderStillOnLambda()`
-
-When using [`renderStillOnLambda()`](/docs/lambda/renderstillonlambda), artifacts get saved to the S3 bucket under the key `renders/[render-id]/artifacts/[filename]`.
-
-You can obtain a list of received assets from [`artifacts`](/docs/lambda/renderstillonlambda#artifacts) field of `renderStillOnLambda()`.
-
-```tsx twoslash title="still.ts"
-const serveUrl = 'http://localhost:8080';
-const inputProps = {};
-const functionName = 'hi';
-const composition = 'hi';
-const privacy = 'public' as const;
-const imageFormat = 'png' as const;
-const region = 'eu-central-1' as const;
-
-// ---cut---
-// @module: es2022
-// @target: es2017
-import {renderStillOnLambda} from '@remotion/lambda/client';
-
-const stillResponse = await renderStillOnLambda({
- functionName,
- region,
- serveUrl,
- composition,
- inputProps,
- imageFormat,
- privacy,
-});
-
-for (const artifact of stillResponse.artifacts) {
- console.log(artifact.filename); // "hello-world.txt"
- console.log(artifact.sizeInBytes); // 12
- console.log(artifact.s3Url); // "https://s3.eu-central-1.amazonaws.com/remotion-lambda-abcdef/renders/abcdef/artifacts/hello-world.txt"
- console.log(artifact.s3Key); // "renders/abcdef/artifacts/hello-world.txt"
-}
-```
-
-### Using Cloud Run
-
-In the Cloud Run Alpha, emitting artifacts is not supported and will throw an error.
-We plan on revising Cloud Run to use the same runtime as Lambda in the future and will bring this feature along.
-
-## See also
-
-- [`<Artifact>`](/docs/artifact)
diff --git a/packages/docs/docs/cloudrun.mdx b/packages/docs/docs/cloudrun.mdx
index 9ed189d0e2..64653206ad 100644
--- a/packages/docs/docs/cloudrun.mdx
+++ b/packages/docs/docs/cloudrun.mdx
@@ -2,11 +2,13 @@
image: /generated/articles-docs-cloudrun.png
id: cloudrun
sidebar_label: Overview
-title: "@remotion/cloudrun"
+title: '@remotion/cloudrun'
---
<ExperimentalBadge>
-<p>Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the <a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.</p>
+ <p>
+ Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the{' '}<a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.
+ </p>
</ExperimentalBadge>
Render Remotion videos on [GCP Cloud Run](https://cloud.google.com/run).
@@ -67,7 +69,7 @@ Most of our users render multiple minutes of video for just a few pennies. The e
## GCP permissions
-Remotion Cloud Run requires you to create a GCP project and create a Service Account with some permissions attached to it. We require only the minimal amount of permissions required for operating Remotion Cloud Run. [Service Account permission list and reasons](docs/cloudrun/permissions).
+Remotion Cloud Run requires you to create a GCP project and create a Service Account with some permissions attached to it. We require only the minimal amount of permissions required for operating Remotion Cloud Run. [Service Account permission list and reasons](/docs/cloudrun/permissions).
## CLI
diff --git a/packages/docs/docs/cloudrun/cli/render.mdx b/packages/docs/docs/cloudrun/cli/render.mdx
index 808606e9b8..a371fe4602 100644
--- a/packages/docs/docs/cloudrun/cli/render.mdx
+++ b/packages/docs/docs/cloudrun/cli/render.mdx
@@ -9,12 +9,7 @@ crumb: "Cloud Run CLI Reference"
<ExperimentalBadge>
<p>
- Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs
- may change in any version and documentation is not yet finished. See the{" "}
- <a href="https://remotion.dev/changelog">
- changelog to stay up to date with breaking changes
- </a>
- .
+ Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the{' '}<a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.
</p>
</ExperimentalBadge>
diff --git a/packages/docs/docs/cloudrun/cli/sites.mdx b/packages/docs/docs/cloudrun/cli/sites.mdx
index 6c4564c311..239dc87027 100644
--- a/packages/docs/docs/cloudrun/cli/sites.mdx
+++ b/packages/docs/docs/cloudrun/cli/sites.mdx
@@ -9,12 +9,7 @@ crumb: 'Cloud Run CLI Reference'
<ExperimentalBadge>
<p>
- Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs
- may change in any version and documentation is not yet finished. See the{' '}
- <a href="https://remotion.dev/changelog">
- changelog to stay up to date with breaking changes
- </a>
- .
+ Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the{' '}<a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.
</p>
</ExperimentalBadge>
diff --git a/packages/docs/docs/cloudrun/generate-env.mdx b/packages/docs/docs/cloudrun/generate-env.mdx
index 7bdead3ec4..066692f6b4 100644
--- a/packages/docs/docs/cloudrun/generate-env.mdx
+++ b/packages/docs/docs/cloudrun/generate-env.mdx
@@ -7,12 +7,7 @@ crumb: "Cloud Run"
<ExperimentalBadge>
<p>
- Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs
- may change in any version and documentation is not yet finished. See the{" "}
- <a href="https://remotion.dev/changelog">
- changelog to stay up to date with breaking changes
- </a>
- .
+ Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the{' '}<a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.
</p>
</ExperimentalBadge>
diff --git a/packages/docs/docs/cloudrun/permissions.mdx b/packages/docs/docs/cloudrun/permissions.mdx
index b5dfa902f5..97ff0a59bb 100644
--- a/packages/docs/docs/cloudrun/permissions.mdx
+++ b/packages/docs/docs/cloudrun/permissions.mdx
@@ -7,12 +7,7 @@ crumb: 'Cloud Run'
<ExperimentalBadge>
<p>
- Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs
- may change in any version and documentation is not yet finished. See the{' '}
- <a href="https://remotion.dev/changelog">
- changelog to stay up to date with breaking changes
- </a>
- .
+ Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the{' '}<a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.
</p>
</ExperimentalBadge>
diff --git a/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx b/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx
index 746dd27938..5c4d44edf0 100644
--- a/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx
+++ b/packages/docs/docs/cloudrun/rendermediaoncloudrun.mdx
@@ -7,12 +7,7 @@ crumb: "Cloud Run API"
<ExperimentalBadge>
<p>
- Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs
- may change in any version and documentation is not yet finished. See the{" "}
- <a href="https://remotion.dev/changelog">
- changelog to stay up to date with breaking changes
- </a>
- .
+ Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the{' '}<a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.
</p>
</ExperimentalBadge>
diff --git a/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx b/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx
index 33dae4bf17..72d75e3881 100644
--- a/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx
+++ b/packages/docs/docs/cloudrun/renderstilloncloudrun.mdx
@@ -7,12 +7,7 @@ crumb: "Cloud Run API"
<ExperimentalBadge>
<p>
- Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs
- may change in any version and documentation is not yet finished. See the{" "}
- <a href="https://remotion.dev/changelog">
- changelog to stay up to date with breaking changes
- </a>
- .
+ Cloud Run is in <a href="/docs/cloudrun-alpha">Alpha</a>, which means APIs may change in any version and documentation is not yet finished. See the{' '}<a href="https://remotion.dev/changelog">changelog to stay up to date with breaking changes</a>.
</p>
</ExperimentalBadge>
diff --git a/packages/docs/docs/how-props-flow.mdx b/packages/docs/docs/how-props-flow.mdx
index 5b543f7580..c326c9536e 100644
--- a/packages/docs/docs/how-props-flow.mdx
+++ b/packages/docs/docs/how-props-flow.mdx
@@ -18,9 +18,6 @@ Three factors play a role:
<Step>3</Step> <a href="/docs/composition#calculatemetadata"><code>calculateMetadata()</code></a> may be used to dynamically transform the props, as well as the metadata of the composition.
-<br/>
-<br/>
-
The following diagram shows how the props get resolved:
<HowPropsFlow/>
diff --git a/packages/docs/docs/lambda/getrenderprogress.mdx b/packages/docs/docs/lambda/getrenderprogress.mdx
index 49561b6511..60f57ecab0 100644
--- a/packages/docs/docs/lambda/getrenderprogress.mdx
+++ b/packages/docs/docs/lambda/getrenderprogress.mdx
@@ -3,7 +3,7 @@ image: /generated/articles-docs-lambda-getrenderprogress.png
id: getrenderprogress
title: getRenderProgress()
slug: /lambda/getrenderprogress
-crumb: "Lambda API"
+crumb: 'Lambda API'
---
Gets the current status of a non-[still](https://www.remotion.dev/docs/lambda/renderstillonlambda) render originally triggered via [`renderMediaOnLambda()`](/docs/lambda/rendermediaonlambda).
@@ -14,13 +14,13 @@ Gets the current status of a non-[still](https://www.remotion.dev/docs/lambda/re
// @module: esnext
// @target: es2017
-import { getRenderProgress } from "@remotion/lambda/client";
+import {getRenderProgress} from '@remotion/lambda/client';
const progress = await getRenderProgress({
- renderId: "d7nlc2y",
- bucketName: "remotionlambda-d9mafgx",
- functionName: "remotion-render-la8ffw",
- region: "us-east-1",
+ renderId: 'd7nlc2y',
+ bucketName: 'remotionlambda-d9mafgx',
+ functionName: 'remotion-render-la8ffw',
+ region: 'us-east-1',
});
```
@@ -38,7 +38,7 @@ Call the function by passing an object with the following properties:
### `renderId`
-The unique identifier for the render that you want to get the progress for. You can get the renderId from the return value of [`renderMediaOnLambda()`](/docs/lambda/renderMediaonlambda).
+The unique identifier for the render that you want to get the progress for. You can get the renderId from the return value of [`renderMediaOnLambda()`](/docs/lambda/rendermediaonlambda).
### `bucketName`
diff --git a/packages/docs/docs/lambda/how-lambda-works.mdx b/packages/docs/docs/lambda/how-lambda-works.mdx
index 98cf6b2c13..10eff89fe9 100644
--- a/packages/docs/docs/lambda/how-lambda-works.mdx
+++ b/packages/docs/docs/lambda/how-lambda-works.mdx
@@ -15,8 +15,7 @@ Previously, Lambda functions did not use Response Streaming, and instead saved c
<Step>1</Step> A single Lambda function is invoked using <a href="/docs/lambda/rendermediaonlambda">
<code>renderMediaOnLambda()</code>
</a> - either directly or via the CLI which also calls this API. This invocation
-is called the <strong>main function</strong>.
-<br />
+is called the <strong>main function</strong>.<br />
<Step>2</Step> The main function visits the <a href="/docs/terminology/serve-url">
Serve URL
</a> that it is being passed in a headless browser. <br />
@@ -24,28 +23,22 @@ is called the <strong>main function</strong>.
that was passed and runs the <a href="/docs/props-resolution">
props resolution
</a> algorithm to determine the props that should be passed to the video as well
-as the metadata (such as the duration in frames).
-<br />
+as the metadata (such as the duration in frames).<br />
<Step>4</Step> Based on the determined duration of the video and the <a href="/docs/lambda/concurrency">
concurrency
</a>, several <strong>renderer functions</strong> are spawned, which are tasked to
-render a portion of the video.
-<br />
+render a portion of the video.<br />
<Step>5</Step> The renderer functions use <a href="https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/">
AWS Lambda Response Streaming
</a> to report progress as well as the binary video chunks. <br />
<Step>6</Step> The main function concatenates the progress reports into a
-concise <code>progress.json</code> file and periodically uploads it to S3.
-<br />
+concise <code>progress.json</code> file and periodically uploads it to S3.<br />
<Step>7</Step> The <a href="/docs/lambda/getrenderprogress">
- <code>getRenderProgress()</code>
-</a> API queries the S3 bucket for the <code>progress.json</code> file and returns
-the progress of the render.
-<br />
+ <code>getRenderProgress()</code></a> API queries the S3 bucket for the <code>progress.json</code> file and returns
+the progress of the render.<br />
<Step>8</Step> As soon as all chunks have arrived in the main function, they
get <a href="/blog/faster-lambda">seamlessly concatenated</a>. The concatenation
-algorithm is not a public API at the moment.
-<br />
+algorithm is not a public API at the moment.<br />
<Step>9</Step> The main function uploads the final video to S3 and shuts down.
## FAQ
diff --git a/packages/docs/docs/lambda/naming-convention.mdx b/packages/docs/docs/lambda/naming-convention.mdx
index 52671ad88d..9b5c06ae34 100644
--- a/packages/docs/docs/lambda/naming-convention.mdx
+++ b/packages/docs/docs/lambda/naming-convention.mdx
@@ -3,7 +3,7 @@ image: /generated/articles-docs-lambda-naming-convention.png
id: naming-convention
title: Function naming convention
slug: /lambda/naming-convention
-crumb: "Lambda"
+crumb: 'Lambda'
---
A Remotion Lambda function has the following naming convention:
@@ -19,8 +19,7 @@ remotion-render-4-0-140-mem2048mb-disk2048mb-240sec
When you deploy a function, the name is hardcoded. This has two functions:
-<Step>1</Step> Avoid having multiple functions with the same configuration unnecessarily.
-<br />
+<Step>1</Step> Avoid having multiple functions with the same configuration unnecessarily.<br />
<Step>2</Step> Being able to guess the function name using <a href="/docs/lambda/speculatefunctionname">
<code>speculateFunctionName()</code>
</a> so you don't have to fetch a list of functions in your AWS account.
diff --git a/packages/docs/docs/lambda/serverless-framework-integration.mdx b/packages/docs/docs/lambda/serverless-framework-integration.mdx
index ea622ee9b6..8082be218a 100644
--- a/packages/docs/docs/lambda/serverless-framework-integration.mdx
+++ b/packages/docs/docs/lambda/serverless-framework-integration.mdx
@@ -3,7 +3,7 @@ image: /generated/articles-docs-lambda-serverless-framework-integration.png
title: Using the Serverless Framework with Remotion Lambda
slug: /lambda/serverless-framework-integration
sidebar_label: Serverless.com integration
-crumb: "@remotion/lambda"
+crumb: '@remotion/lambda'
---
import Tabs from '@theme/Tabs';
@@ -368,9 +368,10 @@ From the `serverless-app` directory.
### Interacting with the API
-The API requires an authorization token to interact with it. To obtain the token, first go to the serverless dashboard to retrieve outputs such as `UserPoolRegion`, `UserPoolId`, and `UserPoolClientId`, which are used to authenticate with Cognito. If you do not have a frontend application, you can create a user and an authentication token manually for the API by following this [guide](docs/lambda/without-iam/example#test-your-endpoint).
+The API requires an authorization token to interact with it. To obtain the token, first go to the serverless dashboard to retrieve outputs such as `UserPoolRegion`, `UserPoolId`, and `UserPoolClientId`, which are used to authenticate with Cognito. If you do not have a frontend application, you can create a user and an authentication token manually for the API by following this [guide](/docs/lambda/without-iam/example#test-your-endpoint).
-<img src="/img/serverless-com-integration-serverlesss-output.png" /> <br/><br/>
+<img src="/img/serverless-com-integration-serverlesss-output.png" /> <br />
+<br />
From the guide, `YOUR_USER_POOL_CLIENT_ID` is `UserpoolClientId` and `YOUR_USER_POOL_ID` is the `UserPoolId`, the steps should be followed up to retrieving the `IdToken`.
diff --git a/packages/docs/docs/lambda/sqs.mdx b/packages/docs/docs/lambda/sqs.mdx
index 405290dcf5..85c5a7ee61 100644
--- a/packages/docs/docs/lambda/sqs.mdx
+++ b/packages/docs/docs/lambda/sqs.mdx
@@ -3,7 +3,7 @@ image: /generated/articles-docs-lambda-sqs.png
title: Using Lambda with SQS
slug: /lambda/sqs
sidebar_label: Queueing with SQS
-crumb: "@remotion/lambda"
+crumb: '@remotion/lambda'
---
import Tabs from '@theme/Tabs';
@@ -101,17 +101,17 @@ The `remotion-executionrole-policy` is referenced from [here](https://github.com
```ts
// πŸ‘‡ Create a role with custom name
-const renderFunctionLambdaRole = new Role(this, "remotionSQSLambdaRole", {
- roleName: "remotionSQSLambdaRole",
- assumedBy: new ServicePrincipal("lambda.amazonaws.com"),
+const renderFunctionLambdaRole = new Role(this, 'remotionSQSLambdaRole', {
+ roleName: 'remotionSQSLambdaRole',
+ assumedBy: new ServicePrincipal('lambda.amazonaws.com'),
managedPolicies: [
ManagedPolicy.fromAwsManagedPolicyName(
- "service-role/AWSLambdaBasicExecutionRole"
+ 'service-role/AWSLambdaBasicExecutionRole',
),
ManagedPolicy.fromManagedPolicyName(
this,
- "remotion-executionrole-policy",
- "remotion-executionrole-policy"
+ 'remotion-executionrole-policy',
+ 'remotion-executionrole-policy',
),
],
});
@@ -273,9 +273,9 @@ From [CDK stack code](https://github.com/alexfernandez803/remotion-serverless/bl
```js title="create queue"
// πŸ‘‡ create the queue
-const remotionQueue = new sqs.Queue(this, "queue", {
+const remotionQueue = new sqs.Queue(this, 'queue', {
encryption: sqs.QueueEncryption.KMS_MANAGED,
- queueName: "remotion_queue",
+ queueName: 'remotion_queue',
});
```
@@ -283,11 +283,11 @@ const remotionQueue = new sqs.Queue(this, "queue", {
```js title="apiIntegrationRole"
// πŸ‘‡ create the apiIntegrationRole role
- const apiIntegrationRole = new IAM.Role(this, "api-integration-role", {
- assumedBy: new IAM.ServicePrincipal("lambda.amazonaws.com"),
+ const apiIntegrationRole = new IAM.Role(this, 'api-integration-role', {
+ assumedBy: new IAM.ServicePrincipal('lambda.amazonaws.com'),
managedPolicies: [
ManagedPolicy.fromAwsManagedPolicyName(
- "service-role/AWSLambdaBasicExecutionRole"
+ 'service-role/AWSLambdaBasicExecutionRole',
),
],
});
@@ -297,17 +297,17 @@ const remotionQueue = new sqs.Queue(this, "queue", {
```js title="remotionSQSLambdaRole"
// πŸ‘‡ create a role with custom name
- const renderFunctionLambdaRole = new Role(this, "remotionSQSLambdaRole", {
- roleName: "remotionSQSLambdaRole",
- assumedBy: new ServicePrincipal("lambda.amazonaws.com"),
+ const renderFunctionLambdaRole = new Role(this, 'remotionSQSLambdaRole', {
+ roleName: 'remotionSQSLambdaRole',
+ assumedBy: new ServicePrincipal('lambda.amazonaws.com'),
managedPolicies: [
ManagedPolicy.fromAwsManagedPolicyName(
- "service-role/AWSLambdaBasicExecutionRole"
+ 'service-role/AWSLambdaBasicExecutionRole',
),
ManagedPolicy.fromManagedPolicyName(
this,
- "remotion-executionrole-policy",
- "remotion-executionrole-policy"
+ 'remotion-executionrole-policy',
+ 'remotion-executionrole-policy',
),
],
});
@@ -330,7 +330,7 @@ const remotionQueue = new sqs.Queue(this, "queue", {
batchSize: 1,
maxBatchingWindow: Duration.minutes(5),
reportBatchItemFailures: true, // default to false
- })
+ }),
);
```
@@ -339,7 +339,7 @@ const remotionQueue = new sqs.Queue(this, "queue", {
The API requires an authorization token to interact with it. To obtain the token:
- After successful deployment you will be given out outputs such as `apigw-sqs-app-stack.region`, `apigw-sqs-app-stack.userPoolClientId`, and `apigw-sqs-app-stack.userPoolId`, which are used to authenticate with Cognito.
-- If you don't have a frontend which user needs to login, you can create a user and an authentication token manually for the API by following this [guide](docs/lambda/without-iam/example#test-your-endpoint).
+- If you don't have a frontend which user needs to login, you can create a user and an authentication token manually for the API by following this [guide](/docs/lambda/without-iam/example#test-your-endpoint).
From the guide, `YOUR_USER_POOL_CLIENT_ID` is `apigw-sqs-app-stack.userPoolClientId` and `YOUR_USER_POOL_ID` is the `apigw-sqs-app-stack.userPoolId`, the steps should be followed up to retrieving the `IdToken`.
diff --git a/packages/docs/docs/miscellaneous/linux-single-process.mdx b/packages/docs/docs/miscellaneous/linux-single-process.mdx
index 27db5afdc5..eb1d4ee32e 100644
--- a/packages/docs/docs/miscellaneous/linux-single-process.mdx
+++ b/packages/docs/docs/miscellaneous/linux-single-process.mdx
@@ -2,9 +2,14 @@
image: /generated/articles-docs-miscellaneous-linux-single-process.png
sidebar_label: Multiple cores on Linux
title: Multiple cores on Linux
-crumb: "Server-side rendering"
+crumb: 'Server-side rendering'
---
+:::info
+This document is outdated. As of 4.0.137, the default behavior is to use multi-process mode.
+The setting still exists, but is `true` by default.
+:::
+
By default, Remotion starts the Chromium browser on Linux with the `--single-process` flag. This is because:
- The sandboxing feature of Chromium is not supported on all Linux distributions
diff --git a/packages/docs/docs/player/buffer-state.mdx b/packages/docs/docs/player/buffer-state.mdx
index 9bd01158f9..13e0628ad5 100644
--- a/packages/docs/docs/player/buffer-state.mdx
+++ b/packages/docs/docs/player/buffer-state.mdx
@@ -161,9 +161,7 @@ By default, Remotion will display the following UI based on the state of the pla
<p>
When in State <InlineStep>2</InlineStep> at first a Pause button, then after{' '}
<a href="#indicating-buffering-in-the-ui">a delay</a>, a{' '}
- <a href="/docs/player/buffer-state#indicating-buffering-in-the-ui">
- customizable spinner
- </a>{' '}
+ <a href="/docs/player/buffer-state#indicating-buffering-in-the-ui">customizable spinner</a>{' '}
is shown.
</p>
diff --git a/packages/docs/docs/player/player-integration.mdx b/packages/docs/docs/player/player-integration.mdx
index 6974e893eb..34f4a2701d 100644
--- a/packages/docs/docs/player/player-integration.mdx
+++ b/packages/docs/docs/player/player-integration.mdx
@@ -1,11 +1,11 @@
---
image: /generated/articles-docs-player-player-integration.png
id: integration
-title: "Code sharing"
-crumb: "@remotion/player"
+title: 'Code sharing'
+crumb: '@remotion/player'
---
-import Tabs from "@theme/Tabs";
+import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
If you are using the player, a common desire is to share the code with your Remotion Studio and/or server-side rendering. With the correct setup, you can write the component once and use it for previewing, displaying and rendering.
@@ -86,7 +86,7 @@ Afterwards, create a subfolder for Remotion within your project and add three fi
Your composition (`remotion/MyComp.tsx` in the example) could look for example like this:
```tsx twoslash
-export const MyComp: React.FC<{ text: string }> = ({ text }) => {
+export const MyComp: React.FC<{text: string}> = ({text}) => {
return <div>Hello {text}!</div>;
};
```
@@ -100,8 +100,8 @@ export const MyComp = () => <></>;
// @filename: index.tsx
// ---cut---
-import { Composition } from "remotion";
-import { MyComp } from "./MyComp";
+import {Composition} from 'remotion';
+import {MyComp} from './MyComp';
export const MyVideo = () => {
return (
@@ -113,7 +113,7 @@ export const MyVideo = () => {
height={1080}
fps={30}
id="my-comp"
- defaultProps={{ text: "World" }}
+ defaultProps={{text: 'World'}}
/>
</>
);
@@ -124,11 +124,11 @@ Your index file (`remotion/index.ts` in the example) could look like this:
```tsx twoslash
// @filename: ./Root.tsx
-export const MyVideo: React.FC<{ text: string }> = () => <></>;
+export const MyVideo: React.FC<{text: string}> = () => <></>;
// ---cut---
-import { registerRoot } from "remotion";
-import { MyVideo } from "./Video";
+import {registerRoot} from 'remotion';
+import {MyVideo} from './Video';
registerRoot(MyVideo);
```
@@ -153,7 +153,7 @@ We recommend adding a new script into your package.json for easy access:
```diff
"scripts": {
-+ "video": "remotion studio src/remotion/index.ts"
++ "remotion": "remotion studio src/remotion/index.ts"
}
```
@@ -168,14 +168,14 @@ export const MyComp = () => <></>;
// @filename: index.tsx
// ---cut---
-import { Player } from "@remotion/player";
-import { MyComp } from "./remotion/MyComp";
+import {Player} from '@remotion/player';
+import {MyComp} from './remotion/MyComp';
export const App: React.FC = () => {
return (
<Player
component={MyComp}
- inputProps={{ text: "World" }}
+ inputProps={{text: 'World'}}
durationInFrames={120}
compositionWidth={1920}
compositionHeight={1080}
@@ -204,11 +204,11 @@ In any Node.JS context, you can call [`bundle()`](/docs/bundle) to bundle your v
// @module: ESNext
// @target: ESNext
-import path from "path";
-import { bundle } from "@remotion/bundler";
+import path from 'path';
+import {bundle} from '@remotion/bundler';
const bundled = await bundle(
- path.join(process.cwd(), "src", "remotion", "index.ts"),
+ path.join(process.cwd(), 'src', 'remotion', 'index.ts'),
);
```
diff --git a/packages/docs/docs/sequences.mdx b/packages/docs/docs/sequences.mdx
index 1b4119ba3b..edaa1c681e 100644
--- a/packages/docs/docs/sequences.mdx
+++ b/packages/docs/docs/sequences.mdx
@@ -3,7 +3,7 @@ image: /generated/articles-docs-sequences.png
id: reusability
title: Making components reusable
sidebar_label: Reuse components
-crumb: "The power of React"
+crumb: 'The power of React'
---
```twoslash include example
@@ -25,16 +25,16 @@ React components allow us to encapsulate video logic and reuse the same visuals
Consider a title - to make it reusable, factor it out into its own component:
```tsx twoslash title="MyComposition.tsx"
-import { AbsoluteFill, interpolate, useCurrentFrame } from "remotion";
+import {AbsoluteFill, interpolate, useCurrentFrame} from 'remotion';
-const Title: React.FC<{ title: string }> = ({ title }) => {
+const Title: React.FC<{title: string}> = ({title}) => {
const frame = useCurrentFrame();
const opacity = interpolate(frame, [0, 20], [0, 1], {
- extrapolateRight: "clamp",
+ extrapolateRight: 'clamp',
});
return (
- <div style={{ opacity, textAlign: "center", fontSize: "7em" }}>{title}</div>
+ <div style={{opacity, textAlign: 'center', fontSize: '7em'}}>{title}</div>
);
};
@@ -49,12 +49,12 @@ export const MyVideo = () => {
To render multiple instances of the title, duplicate the `<Title>` component.
-You can also use the `<Sequence>` component to limit the duration of the first title and time-shift the appearance of the second title.
+You can also use the [`<Sequence>`](/docs/sequence) component to limit the duration of the first title and time-shift the appearance of the second title.
```tsx twoslash
// @include: example-Title
// ---cut---
-import { Sequence } from "remotion";
+import {Sequence} from 'remotion';
export const MyVideo = () => {
return (
@@ -72,7 +72,7 @@ export const MyVideo = () => {
You should see two titles appearing after each other.
-Note that the value of `useCurrentFrame()` has been shifted in the second instance, so that it returns `0` only when the absolute time is `40`. Before that, the sequence was not mounted at all.
+Note that the value of [`useCurrentFrame()`](/docs/use-current-frame) has been shifted in the second instance, so that it returns `0` only when the absolute time is `40`. Before that, the sequence was not mounted at all.
Sequences by default are absolutely positioned - you can use [`layout="none"`](/docs/sequence#layout) to make them render like a regular `<div>`.
diff --git a/packages/docs/docs/ssr-node.mdx b/packages/docs/docs/ssr-node.mdx
index 51337740cc..09cc558e23 100644
--- a/packages/docs/docs/ssr-node.mdx
+++ b/packages/docs/docs/ssr-node.mdx
@@ -2,7 +2,7 @@
image: /generated/articles-docs-ssr-node.png
id: ssr-node
title: Rendering using SSR APIs
-crumb: "Server-side rendering"
+crumb: 'Server-side rendering'
sidebar_label: Example
---
@@ -11,11 +11,11 @@ These functions can be used in Node.js and Bun.
Rendering a video takes three steps:
-<Step>1</Step> Creating a <a href="/docs/terminology/bundle">Remotion Bundle</a>
-<br />
-<Step>2</Step> Select the composition to render and calculate its metadata
-<br />
-<Step>3</Step> Render the video, audio, still or image sequence.
+<div>
+ <Step>1</Step> Creating a{' '}<a href="/docs/terminology/bundle">Remotion Bundle</a><br />
+ <Step>2</Step> Select the composition to render and calculate its metadata<br />
+ <Step>3</Step> Render the video, audio, still or image sequence.{' '}
+</div>
## Example script
@@ -24,24 +24,24 @@ Follow this commented example to see how to render a video:
```tsx twoslash title="render.mjs"
// @module: ESNext
// @target: ESNext
-import { bundle } from "@remotion/bundler";
-import { renderMedia, selectComposition } from "@remotion/renderer";
-import path from "path";
+import {bundle} from '@remotion/bundler';
+import {renderMedia, selectComposition} from '@remotion/renderer';
+import path from 'path';
// The composition you want to render
-const compositionId = "HelloWorld";
+const compositionId = 'HelloWorld';
// You only have to create a bundle once, and you may reuse it
// for multiple renders that you can parametrize using input props.
const bundleLocation = await bundle({
- entryPoint: path.resolve("./src/index.ts"),
+ entryPoint: path.resolve('./src/index.ts'),
// If you have a webpack override in remotion.config.ts, pass it here as well.
webpackOverride: (config) => config,
});
// Parametrize the video by passing props to your component.
const inputProps = {
- foo: "bar",
+ foo: 'bar',
};
// Get the composition you want to render. Pass `inputProps` if you
@@ -57,12 +57,12 @@ const composition = await selectComposition({
await renderMedia({
composition,
serveUrl: bundleLocation,
- codec: "h264",
+ codec: 'h264',
outputLocation: `out/${compositionId}.mp4`,
inputProps,
});
-console.log("Render done!");
+console.log('Render done!');
```
This flow is customizable. Click on one of the SSR APIs to read about its options:
diff --git a/packages/docs/docs/the-fundamentals.mdx b/packages/docs/docs/the-fundamentals.mdx
index c216c4b4f2..890ef7d908 100644
--- a/packages/docs/docs/the-fundamentals.mdx
+++ b/packages/docs/docs/the-fundamentals.mdx
@@ -10,8 +10,6 @@ crumb: Getting started
```twoslash include example
import { AbsoluteFill, useCurrentFrame } from "remotion";
-
-
export const MyComposition = () => {
const frame = useCurrentFrame();
diff --git a/packages/docs/docs/troubleshooting/could-not-be-parsed-as-a-value-list.mdx b/packages/docs/docs/troubleshooting/could-not-be-parsed-as-a-value-list.mdx
index fd350372b2..269805ec37 100644
--- a/packages/docs/docs/troubleshooting/could-not-be-parsed-as-a-value-list.mdx
+++ b/packages/docs/docs/troubleshooting/could-not-be-parsed-as-a-value-list.mdx
@@ -2,7 +2,7 @@
image: /generated/articles-docs-troubleshooting-could-not-be-parsed-as-a-value-list.png
sidebar_label: Source could not be parsed
title: The source provided could not be parsed as a value list
-crumb: "Browser quirks"
+crumb: 'Browser quirks'
---
The following error message:
@@ -24,4 +24,4 @@ src: url('font.woff2') format('woff2');
```
To fix the issue, always include quotes.
-Use [`@remotion/fonts`](docs/fonts-api) to use an abstraction that helps you avoid this mistake.
+Use [`@remotion/fonts`](/docs/fonts-api) to use an abstraction that helps you avoid this mistake.
diff --git a/packages/docs/package.json b/packages/docs/package.json
index 01d0f9fb0c..4e7f7b8473 100644
--- a/packages/docs/package.json
+++ b/packages/docs/package.json
@@ -90,6 +90,7 @@
"@types/color-namer": "^1.3.0",
"@types/hls.js": "^0.13.3",
"@types/unist": "^2.0.0",
+ "@types/node": "20.14.11",
"lodash.sortby": "^4.7.0",
"url-loader": "^4.1.1"
}
diff --git a/packages/docs/tsconfig.json b/packages/docs/tsconfig.json
index e69b2f5f42..0ff50b14ea 100644
--- a/packages/docs/tsconfig.json
+++ b/packages/docs/tsconfig.json
@@ -21,6 +21,7 @@
"@docusaurus/module-type-aliases",
"@docusaurus/theme-classic"
],
+
"references": [
{"path": "../player"},
{"path": "../core"},
diff --git a/packages/docusaurus-plugin/package.json b/packages/docusaurus-plugin/package.json
index 3d895b66de..d403bab93c 100644
--- a/packages/docusaurus-plugin/package.json
+++ b/packages/docusaurus-plugin/package.json
@@ -19,8 +19,7 @@
"fenceparser": "^2.2.0",
"shiki": "0.10.1",
"@typescript/twoslash": "3.2.1",
- "@docusaurus/types": "3.4.0",
- "@types/node": "^20.14.11"
+ "@docusaurus/types": "3.4.0"
},
"private": true
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 27a75cbf82..457d56af40 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -598,6 +598,9 @@ importers:
'@types/hls.js':
specifier: ^0.13.3
version: 0.13.3
+ '@types/node':
+ specifier: 20.14.11
+ version: 20.14.11
'@types/unist':
specifier: ^2.0.0
version: 2.0.6
@@ -613,9 +616,6 @@ importers:
'@docusaurus/types':
specifier: 3.4.0
- '@types/node':
- specifier: ^20.14.11
- version: 20.14.11
'@typescript/twoslash':
specifier: 3.2.1
version: 3.2.1