Skip to content

🎥 Make videos programmatically with React

no esnext

Jonny Burger48734ab87e25
diff --git a/packages/docs/blog/2021-08-11-remotion-2-3.md b/packages/docs/blog/2021-08-11-remotion-2-3.md
index 1857f2d0b5..09171bcaf3 100644
--- a/packages/docs/blog/2021-08-11-remotion-2-3.md
+++ b/packages/docs/blog/2021-08-11-remotion-2-3.md
@@ -17,7 +17,7 @@ So far we focused on streamlining the workflow for making videos. While it was a
[This new component](/docs/still) is the same as [`<Composition />`](/docs/composition) but is meant for defining a compositions that output a still image. Since it's already implied, you don't have to define the `fps` and `durationInFrames` properties.
```tsx twoslash
-import {Still} from 'remotion';
+import { Still } from "remotion";
const Thumbnail: React.FC = () => null;
// ---cut---
<Still
@@ -26,11 +26,11 @@ const Thumbnail: React.FC = () => null;
width={1200}
height={627}
defaultProps={{
- title: 'Welcome to Remotion',
- description: 'Edit Video.tsx to change template',
- slogan: 'Write videos\nin React',
+ title: "Welcome to Remotion",
+ description: "Edit Video.tsx to change template",
+ slogan: "Write videos\nin React",
}}
-/>
+/>;
```
## Optimized editor for stills
@@ -61,28 +61,23 @@ npx remotion still --props='{"custom": "data"}' src/index.tsx my-comp out.png
If you render using the Node.JS APIs, we have a new equivalent API for rendering stills as well.
```ts twoslash
-// @module: ESNext
-// @target: ESNext
-import {bundle} from '@remotion/bundler';
-import {
- getCompositions,
- renderStill
-} from '@remotion/renderer';
+import { bundle } from "@remotion/bundler";
+import { getCompositions, renderStill } from "@remotion/renderer";
// The composition you want to render
-const compositionId = 'HelloWorld'
+const compositionId = "HelloWorld";
-const bundleLocation = await bundle(require.resolve('./src/index'))
+const bundleLocation = await bundle(require.resolve("./src/index"));
const comps = await getCompositions(bundleLocation, {
inputProps: {
- custom: 'data',
+ custom: "data",
},
-})
-const composition = comps.find((c) => c.id === compositionId)
+});
+const composition = comps.find((c) => c.id === compositionId);
if (!composition) {
- throw new Error(`No composition with the ID ${compositionId} found`)
+ throw new Error(`No composition with the ID ${compositionId} found`);
}
// ---cut---
@@ -90,14 +85,17 @@ if (!composition) {
await renderStill({
composition,
serveUrl: bundleLocation,
- output: '/tmp/still.png',
+ output: "/tmp/still.png",
onError: (error) => {
- console.error("The following error occured when rendering the still: ", error.message)
+ console.error(
+ "The following error occured when rendering the still: ",
+ error.message
+ );
},
inputProps: {
- custom: 'data'
- }
-})
+ custom: "data",
+ },
+});
```
## New Stills template with server rendering
diff --git a/packages/docs/docs/deletefunction.md b/packages/docs/docs/deletefunction.md
index 3b40db6baa..8c151d3753 100644
--- a/packages/docs/docs/deletefunction.md
+++ b/packages/docs/docs/deletefunction.md
@@ -11,19 +11,16 @@ To retrieve a list of functions, call [`getFunctions()`](/docs/lambda/getfunctio
## Example
```ts twoslash
-// @module: esnext
-// @target: es2017
-
-import {deleteFunction, getFunctions} from '@remotion/lambda';
+import { deleteFunction, getFunctions } from "@remotion/lambda";
const functions = await getFunctions({
- region: 'us-east-1',
- compatibleOnly: false
+ region: "us-east-1",
+ compatibleOnly: false,
});
for (const fn of functions) {
await deleteFunction({
- region: 'us-east-1',
- functionName: fn.functionName
+ region: "us-east-1",
+ functionName: fn.functionName,
});
}
```
diff --git a/packages/docs/docs/deployfunction.md b/packages/docs/docs/deployfunction.md
index 58835d78bd..58fc7aca84 100644
--- a/packages/docs/docs/deployfunction.md
+++ b/packages/docs/docs/deployfunction.md
@@ -9,17 +9,14 @@ Creates an [AWS Lambda](https://aws.amazon.com/lambda/) function in your AWS acc
## Example
```ts twoslash
-// @module: esnext
-// @target: es2017
+import { deployFunction } from "@remotion/lambda";
-import {deployFunction} from '@remotion/lambda';
-
-const {functionName} = await deployFunction({
- region: 'us-east-1',
+const { functionName } = await deployFunction({
+ region: "us-east-1",
timeoutInSeconds: 120,
- memorySizeInMb: 1024
+ memorySizeInMb: 1024,
});
-console.log(functionName)
+console.log(functionName);
```
## Arguments
diff --git a/packages/docs/docs/deploysite.md b/packages/docs/docs/deploysite.md
index 2a478d343e..8fc93a129f 100644
--- a/packages/docs/docs/deploysite.md
+++ b/packages/docs/docs/deploysite.md
@@ -13,24 +13,29 @@ Before calling this function, you should create a bucket, see [`getOrCreateBucke
## Example
```ts twoslash
-// @module: esnext
-// @target: es2017
-import {deploySite} from '@remotion/lambda';
-
-const {url} = await deploySite({
- entryPoint: '/Users/jonnyburger/my-remotion-video/src/index.tsx',
- bucketName: 'remotionlambda-c7fsl3d',
- region: 'us-east-1',
+import { deploySite } from "@remotion/lambda";
+
+const { url } = await deploySite({
+ entryPoint: "/Users/jonnyburger/my-remotion-video/src/index.tsx",
+ bucketName: "remotionlambda-c7fsl3d",
+ region: "us-east-1",
options: {
onBundleProgress: (progress) => {
// Progress is between 0 and 100
- console.log(`Bundle progress: ${progress}%`)
+ console.log(`Bundle progress: ${progress}%`);
+ },
+ onUploadProgress: ({
+ totalFiles,
+ filesUploaded,
+ totalSize,
+ sizeUploaded,
+ }) => {
+ console.log(
+ `Upload progress: Total files ${totalFiles}, Files uploaded ${filesUploaded}, Total size ${totalSize}, Size uploaded ${sizeUploaded}`
+ );
},
- onUploadProgress: ({totalFiles, filesUploaded, totalSize, sizeUploaded}) => {
- console.log(`Upload progress: Total files ${totalFiles}, Files uploaded ${filesUploaded}, Total size ${totalSize}, Size uploaded ${sizeUploaded}`, )
- }
- }
-})
+ },
+});
console.log(url);
```
diff --git a/packages/docs/docs/get-audio-data.md b/packages/docs/docs/get-audio-data.md
index 965924a2e7..1aa93241ba 100644
--- a/packages/docs/docs/get-audio-data.md
+++ b/packages/docs/docs/get-audio-data.md
@@ -27,8 +27,6 @@ A string pointing to an audio asset.
## Example
```ts twoslash
-// @module: ESNext
-// @target: ESNext
import { Audio } from "remotion";
// ---cut---
import { getAudioData } from "@remotion/media-utils";
diff --git a/packages/docs/docs/get-audio-duration.md b/packages/docs/docs/get-audio-duration.md
index 8c3c89aeae..234494d4de 100644
--- a/packages/docs/docs/get-audio-duration.md
+++ b/packages/docs/docs/get-audio-duration.md
@@ -20,8 +20,6 @@ A string pointing to an audio asset
## Example
```tsx twoslash
-// @module: ESNext
-// @target: ESNext
import { Audio } from "remotion";
// ---cut---
import { getAudioDuration } from "@remotion/media-utils";
diff --git a/packages/docs/docs/get-video-metadata.md b/packages/docs/docs/get-video-metadata.md
index d2a7218005..3d6e348ad3 100644
--- a/packages/docs/docs/get-video-metadata.md
+++ b/packages/docs/docs/get-video-metadata.md
@@ -26,8 +26,6 @@ A string pointing to an asset.
## Example
```tsx twoslash
-// @module: ESNext
-// @target: ESNext
import { Audio } from "remotion";
// ---cut---
import { getVideoMetadata } from "@remotion/media-utils";
diff --git a/packages/docs/docs/getfunctioninfo.md b/packages/docs/docs/getfunctioninfo.md
index 6018d12107..c60ae646c4 100644
--- a/packages/docs/docs/getfunctioninfo.md
+++ b/packages/docs/docs/getfunctioninfo.md
@@ -13,19 +13,16 @@ To deploy a function, use [`deployFunction()`](/docs/lambda/deployfunction).
## Example
```ts twoslash
-// @module: esnext
-// @target: es2017
-
-import {getFunctionInfo} from '@remotion/lambda';
+import { getFunctionInfo } from "@remotion/lambda";
const info = await getFunctionInfo({
- functionName: 'remotion-render-d7nd2a9f',
- region: 'eu-central-1'
+ functionName: "remotion-render-d7nd2a9f",
+ region: "eu-central-1",
});
-console.log(info.functionName) // remotion-render-d7nd2a9f
-console.log(info.memorySizeInMb) // 1500
-console.log(info.version) // '2021-07-14'
-console.log(info.timeoutInSeconds) // 120
+console.log(info.functionName); // remotion-render-d7nd2a9f
+console.log(info.memorySizeInMb); // 1500
+console.log(info.version); // '2021-07-14'
+console.log(info.timeoutInSeconds); // 120
```
## Arguments
diff --git a/packages/docs/docs/getfunctions.md b/packages/docs/docs/getfunctions.md
index f1b664e429..7514261862 100644
--- a/packages/docs/docs/getfunctions.md
+++ b/packages/docs/docs/getfunctions.md
@@ -13,21 +13,18 @@ To get information about only a single function, use [`getFunctionInfo()`](/docs
## Example
```ts twoslash
-// @module: esnext
-// @target: es2017
-
-import {getFunctions} from '@remotion/lambda';
+import { getFunctions } from "@remotion/lambda";
const info = await getFunctions({
- region: 'eu-central-1',
- compatibleOnly: true
+ region: "eu-central-1",
+ compatibleOnly: true,
});
for (const fn of info) {
- console.log(fn.functionName) // "remotion-render-d8a03x"
- console.log(fn.memorySizeInMb) // 1536
- console.log(fn.timeoutInSeconds) // 120
- console.log(fn.version) // "2021-07-25"
+ console.log(fn.functionName); // "remotion-render-d8a03x"
+ console.log(fn.memorySizeInMb); // 1536
+ console.log(fn.timeoutInSeconds); // 120
+ console.log(fn.version); // "2021-07-25"
}
```
diff --git a/packages/docs/docs/getorcreatebucket.md b/packages/docs/docs/getorcreatebucket.md
index 8a2c3b9327..fc00ee0863 100644
--- a/packages/docs/docs/getorcreatebucket.md
+++ b/packages/docs/docs/getorcreatebucket.md
@@ -9,13 +9,11 @@ Creates a bucket for Remotion Lambda in your S3 account. If one already exists,
**Only 1 bucket per region** is necessary for Remotion Lambda to function.
```ts twoslash
-// @module: ESNext
-// @target: ESNext
-import {getOrCreateBucket} from '@remotion/lambda';
+import { getOrCreateBucket } from "@remotion/lambda";
-const {bucketName} = await getOrCreateBucket({region: 'us-east-1'})
+const { bucketName } = await getOrCreateBucket({ region: "us-east-1" });
-console.log(bucketName) // "remtionlambda-32df3p"
+console.log(bucketName); // "remtionlambda-32df3p"
```
## Arguments
diff --git a/packages/docs/docs/getrenderprogress.md b/packages/docs/docs/getrenderprogress.md
index 94835bde60..30ffe27da5 100644
--- a/packages/docs/docs/getrenderprogress.md
+++ b/packages/docs/docs/getrenderprogress.md
@@ -9,18 +9,16 @@ Gets the current status of a render originally triggered via [`renderVideoOnLamb
## Example
```tsx twoslash
-// @module: esnext
-// @target: es2017
-import {getRenderProgress} from '@remotion/lambda';
+import { getRenderProgress } from "@remotion/lambda";
// ---cut---
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",
+});
```
## API
diff --git a/packages/docs/docs/lambda-deletesite.md b/packages/docs/docs/lambda-deletesite.md
index 5c94b12a67..0d9927e509 100644
--- a/packages/docs/docs/lambda-deletesite.md
+++ b/packages/docs/docs/lambda-deletesite.md
@@ -13,23 +13,21 @@ Each project is located in the `sites/` subdirectory of your S3 bucket. Calling
Gets all sites and deletes them.
```ts twoslash
-// @module: ESNext
-// @target: ESNext
-import {AwsRegion, deleteSite, getSites} from '@remotion/lambda';
+import { AwsRegion, deleteSite, getSites } from "@remotion/lambda";
-const region: AwsRegion = 'eu-central-1';
+const region: AwsRegion = "eu-central-1";
-const {sites} = await getSites({
- region
+const { sites } = await getSites({
+ region,
});
for (const site of sites) {
await deleteSite({
bucketName: site.bucketName,
siteName: site.id,
- region
- })
- console.log(`Site ${site.id} deleted.`)
+ region,
+ });
+ console.log(`Site ${site.id} deleted.`);
}
```
diff --git a/packages/docs/docs/lambda-getsites.md b/packages/docs/docs/lambda-getsites.md
index 702b4e6938..b6c7fe8e8a 100644
--- a/packages/docs/docs/lambda-getsites.md
+++ b/packages/docs/docs/lambda-getsites.md
@@ -13,25 +13,23 @@ The projects are located in the `sites/` subdirectory of your S3 bucket. Remembe
Gets all sites and logs information about them.
```ts twoslash
-// @module: ESNext
-// @target: ESNext
-import {getSites} from '@remotion/lambda';
+import { getSites } from "@remotion/lambda";
-const {sites, buckets} = await getSites({
- region: 'eu-central-1'
-})
+const { sites, buckets } = await getSites({
+ region: "eu-central-1",
+});
for (const site of sites) {
- console.log(site.id) // A unique ID for referring to that project
- console.log(site.bucketName) // In which bucket the site resides in.
- console.log(site.lastModified) // A unix timestamp, but may also be null
- console.log(site.sizeInBytes) // Size of all contents in the folder
+ console.log(site.id); // A unique ID for referring to that project
+ console.log(site.bucketName); // In which bucket the site resides in.
+ console.log(site.lastModified); // A unix timestamp, but may also be null
+ console.log(site.sizeInBytes); // Size of all contents in the folder
}
for (const bucket of buckets) {
- console.log(bucket.region) // 'eu-central-1'
- console.log(bucket.name) // The name of the S3 bucket.
- console.log(bucket.creationDate) // A unix timestamp of when the site was created.
+ console.log(bucket.region); // 'eu-central-1'
+ console.log(bucket.name); // The name of the S3 bucket.
+ console.log(bucket.creationDate); // A unix timestamp of when the site was created.
}
```
diff --git a/packages/docs/docs/lambda-setup.md b/packages/docs/docs/lambda-setup.md
index 6e010a3e2d..c1d09b4554 100644
--- a/packages/docs/docs/lambda-setup.md
+++ b/packages/docs/docs/lambda-setup.md
@@ -104,16 +104,14 @@ npx remotion lambda functions deploy
You can deploy a function using [`deployFunction()`](/docs/lambda/deployfunction).
```ts twoslash
-// @module: ESNext
-// @target: ESNext
-import {deployFunction} from '@remotion/lambda';
+import { deployFunction } from "@remotion/lambda";
// ---cut---
-const {functionName} = await deployFunction({
- region: 'us-east-1',
+const { functionName } = await deployFunction({
+ region: "us-east-1",
timeoutInSeconds: 120,
- memorySizeInMb: 1536
-})
+ memorySizeInMb: 1536,
+});
```
The function name is returned which you'll need for rendering.
@@ -145,33 +143,29 @@ A URL will be printed pointing to the deployed project.
First, you need to create an S3 bucket in your preferred region. If one already exists, it will be used instead:
```ts twoslash
-// @module: ESNext
-// @target: ESNext
-import path from 'path';
-import {deploySite, getOrCreateBucket} from '@remotion/lambda';
-
-const {bucketName} = await getOrCreateBucket({
- region: 'us-east-1'
-})
+import path from "path";
+import { deploySite, getOrCreateBucket } from "@remotion/lambda";
+
+const { bucketName } = await getOrCreateBucket({
+ region: "us-east-1",
+});
```
Next, upload your Remotion project to an S3 bucket. Specify the entry point of your Remotion project, this is the file where [`registerRoot()`](/docs/register-root) is called.
```ts twoslash
-// @module: ESNext
-// @target: ESNext
-import path from 'path';
-import {deploySite, getOrCreateBucket} from '@remotion/lambda';
-
-const {bucketName} = await getOrCreateBucket({
- region: 'us-east-1'
-})
+import path from "path";
+import { deploySite, getOrCreateBucket } from "@remotion/lambda";
+
+const { bucketName } = await getOrCreateBucket({
+ region: "us-east-1",
+});
// ---cut---
-const {url} = await deploySite({
+const { url } = await deploySite({
bucketName,
- entryPoint: path.resolve(process.cwd(), 'src/index.tsx'),
- region: 'us-east-1'
-})
+ entryPoint: path.resolve(process.cwd(), "src/index.tsx"),
+ region: "us-east-1",
+});
```
You are now ready to render a video.
@@ -204,87 +198,93 @@ Progress will be printed until the video finished rendering. Congrats! You rende
You already have the function name from a previous step. But since you only need to deploy a function once, it's useful to retrieve the name of your deployed function programmatically before rendering a video in case your Node.JS program restarts. We can call [`getFunctions()`](/docs/lambda/getfunctions) with the `compatibleOnly` flag to get only functions with a matching version.
```ts twoslash
-// @module: ESNext
-// @target: ESNext
-import {getFunctions, renderVideoOnLambda, getRenderProgress} from '@remotion/lambda';
+import {
+ getFunctions,
+ renderVideoOnLambda,
+ getRenderProgress,
+} from "@remotion/lambda";
const functions = await getFunctions({
- region: 'us-east-1',
- compatibleOnly: true
-})
+ region: "us-east-1",
+ compatibleOnly: true,
+});
-const functionName = functions[0].functionName
+const functionName = functions[0].functionName;
```
We can now trigger a render using the [`renderVideoOnLambda()`](/docs/lambda/rendervideoonlambda) function.
```ts twoslash
-// @module: ESNext
-// @target: ESNext
-import {getFunctions, renderVideoOnLambda, getRenderProgress} from '@remotion/lambda';
+import {
+ getFunctions,
+ renderVideoOnLambda,
+ getRenderProgress,
+} from "@remotion/lambda";
-const url = 'string'
+const url = "string";
const functions = await getFunctions({
- region: 'us-east-1',
- compatibleOnly: true
-})
+ region: "us-east-1",
+ compatibleOnly: true,
+});
-const functionName = functions[0].functionName
+const functionName = functions[0].functionName;
// ---cut---
-const {renderId, bucketName} = await renderVideoOnLambda({
- region: 'us-east-1',
+const { renderId, bucketName } = await renderVideoOnLambda({
+ region: "us-east-1",
functionName,
serveUrl: url,
- composition: 'HelloWorld',
+ composition: "HelloWorld",
inputProps: {},
- codec: 'h264-mkv',
- imageFormat: 'jpeg',
- maxRetries: 3
-})
+ codec: "h264-mkv",
+ imageFormat: "jpeg",
+ maxRetries: 3,
+});
```
The render will now run and after a while the video will be available in your S3 bucket. You can at any time get the status of the video render by calling [`getRenderProgress()`](/docs/lambda/getrenderprogress).
```ts twoslash
-// @module: ESNext
-// @target: ESNext
-import {getFunctions, renderVideoOnLambda, getRenderProgress} from '@remotion/lambda';
+import {
+ getFunctions,
+ renderVideoOnLambda,
+ getRenderProgress,
+} from "@remotion/lambda";
-const url = 'string'
+const url = "string";
const functions = await getFunctions({
- region: 'us-east-1',
- compatibleOnly: true
-})
+ region: "us-east-1",
+ compatibleOnly: true,
+});
-const functionName = functions[0].functionName
+const functionName = functions[0].functionName;
-const {renderId, bucketName} = await renderVideoOnLambda({
- region: 'us-east-1',
+const { renderId, bucketName } = await renderVideoOnLambda({
+ region: "us-east-1",
functionName,
serveUrl: url,
- composition: 'HelloWorld',
+ composition: "HelloWorld",
inputProps: {},
- codec: 'h264-mkv',
- imageFormat: 'jpeg',
- maxRetries: 3
-})
+ codec: "h264-mkv",
+ imageFormat: "jpeg",
+ maxRetries: 3,
+});
// ---cut---
while (true) {
- await new Promise(resolve => setTimeout(resolve, 1000))
+ await new Promise((resolve) => setTimeout(resolve, 1000));
const progress = await getRenderProgress({
renderId,
bucketName,
functionName,
- region: 'us-east-1'
- })
+ region: "us-east-1",
+ });
if (progress.done) {
- console.log('Render finished!', progress.outputFile)
- process.exit(0)
+ console.log("Render finished!", progress.outputFile);
+ process.exit(0);
}
if (progress.fatalErrorEncountered) {
- console.error('Error enountered', progress.errors)
- process.exit(1)
+ console.error("Error enountered", progress.errors);
+ process.exit(1);
}
}
```
diff --git a/packages/docs/docs/parametrized-rendering.md b/packages/docs/docs/parametrized-rendering.md
index afac450ce3..cd48c7e56c 100644
--- a/packages/docs/docs/parametrized-rendering.md
+++ b/packages/docs/docs/parametrized-rendering.md
@@ -90,8 +90,6 @@ npx remotion render src/index.tsx HelloWorld out/helloworld.mp4 --props=./path/t
When server-rendering using `renderFrames`, you can pass props using the `inputProps` option:
```tsx twoslash {9-11}
-// @module: esnext
-// @target: es2017
const video = { fps: 30, durationInFrames: 30, width: 1080, height: 1080 };
const bundled = "/path/to/bundle";
const framesDir = "/path/to/frames";
diff --git a/packages/docs/docs/render-still.md b/packages/docs/docs/render-still.md
index 34a281acfd..700e9aa8ed 100644
--- a/packages/docs/docs/render-still.md
+++ b/packages/docs/docs/render-still.md
@@ -14,8 +14,6 @@ If you want to render a full image sequence and possibly encode it to a video la
You first need to bundle the project and fetch the compositions. Read [the code snippet on the site for server-side rendering](/docs/ssr/#render-a-video-programmatically) for an example how to come up with the `bundleLocation` and `composition` variables.
```ts twoslash
-// @module: ESNext
-// @target: ESNext
import { bundle } from "@remotion/bundler";
import { getCompositions, renderStill } from "@remotion/renderer";
@@ -118,16 +116,14 @@ _optional_
Allows you to react to an exception thrown in your React code. The callback has an argument which is the error.
```tsx twoslash
-const renderStill = (options: {
- onError: (err: Error) => void;
-}) => {}
+const renderStill = (options: { onError: (err: Error) => void }) => {};
// ---cut---
renderStill({
// ... other arguments
onError: (err: Error) => {
// Handle error here
- }
-})
+ },
+});
```
### `overwrite?`
diff --git a/packages/docs/docs/renderstillonlambda.md b/packages/docs/docs/renderstillonlambda.md
index d380e51d91..daf1c55843 100644
--- a/packages/docs/docs/renderstillonlambda.md
+++ b/packages/docs/docs/renderstillonlambda.md
@@ -13,27 +13,22 @@ If you want to render a still locally instead, use [`renderStill()`](/docs/rende
## Example
```tsx twoslash
-// @module: esnext
-// @target: es2017
-import {renderStillOnLambda} from '@remotion/lambda';
+import { renderStillOnLambda } from "@remotion/lambda";
// ---cut---
-const {
- estimatedPrice,
- url,
- size
-} = await renderStillOnLambda({
- region: 'us-east-1',
- functionName: 'remotion-render-bds9aab',
- serveUrl: 'https://remotionlambda-qg35eyp1s1.s3.eu-central-1.amazonaws.com/sites/bf2jrbfkw',
- composition: 'MyVideo',
+const { estimatedPrice, url, size } = await renderStillOnLambda({
+ region: "us-east-1",
+ functionName: "remotion-render-bds9aab",
+ serveUrl:
+ "https://remotionlambda-qg35eyp1s1.s3.eu-central-1.amazonaws.com/sites/bf2jrbfkw",
+ composition: "MyVideo",
inputProps: {},
- imageFormat: 'png',
+ imageFormat: "png",
maxRetries: 3,
- privacy: 'public',
+ privacy: "public",
envVariables: {},
- frame: 10
-})
+ frame: 10,
+});
```
## Arguments
diff --git a/packages/docs/docs/rendervideoonlambda.md b/packages/docs/docs/rendervideoonlambda.md
index 7b138f4aba..c19afa8a8a 100644
--- a/packages/docs/docs/rendervideoonlambda.md
+++ b/packages/docs/docs/rendervideoonlambda.md
@@ -11,23 +11,22 @@ Triggers a render on a lambda given a composition and a lambda function.
## Example
```tsx twoslash
-// @module: esnext
-// @target: es2017
-import {renderVideoOnLambda} from '@remotion/lambda';
+import { renderVideoOnLambda } from "@remotion/lambda";
// ---cut---
-const {bucketName, renderId} = await renderVideoOnLambda({
- region: 'us-east-1',
- functionName: 'remotion-render-bds9aab',
- composition: 'MyVideo',
+const { bucketName, renderId } = await renderVideoOnLambda({
+ region: "us-east-1",
+ functionName: "remotion-render-bds9aab",
+ composition: "MyVideo",
framesPerLambda: 20,
- serveUrl: 'https://remotionlambda-qg35eyp1s1.s3.eu-central-1.amazonaws.com/sites/bf2jrbfkw',
+ serveUrl:
+ "https://remotionlambda-qg35eyp1s1.s3.eu-central-1.amazonaws.com/sites/bf2jrbfkw",
inputProps: {},
- codec: 'h264-mkv',
- imageFormat: 'jpeg',
+ codec: "h264-mkv",
+ imageFormat: "jpeg",
maxRetries: 3,
- privacy: 'public'
-})
+ privacy: "public",
+});
```
## Arguments
diff --git a/packages/docs/docs/simulatepermissions.md b/packages/docs/docs/simulatepermissions.md
index d0c8559ab9..02063533b9 100644
--- a/packages/docs/docs/simulatepermissions.md
+++ b/packages/docs/docs/simulatepermissions.md
@@ -15,18 +15,15 @@ The function does reject with an error if a permission is missing, rather the mi
## Example
```ts twoslash
-// @module: esnext
-// @target: es2017
-
-import {simulatePermissions} from '@remotion/lambda';
+import { simulatePermissions } from "@remotion/lambda";
-const {results} = await simulatePermissions({
- region: 'us-east-1',
+const { results } = await simulatePermissions({
+ region: "us-east-1",
});
for (const result of results) {
- console.log(result.decision) // "allowed"
- console.log(result.name) // "iam:GetUser"
+ console.log(result.decision); // "allowed"
+ console.log(result.name); // "iam:GetUser"
}
```
@@ -48,14 +45,14 @@ A callback function that gets called every time a new simulation has been execut
// @module: esnext
// @target: es2017
-import {simulatePermissions} from '@remotion/lambda';
+import { simulatePermissions } from "@remotion/lambda";
-const {results} = await simulatePermissions({
- region: 'us-east-1',
+const { results } = await simulatePermissions({
+ region: "us-east-1",
onSimulation: (result) => {
- console.log(result.decision) // "allowed"
- console.log(result.name) // "iam:GetUser"
- }
+ console.log(result.decision); // "allowed"
+ console.log(result.name); // "iam:GetUser"
+ },
});
```
diff --git a/packages/lambda/remotionlambda.zip b/packages/lambda/remotionlambda.zip
index 45c70f30ac..153c18d6d9 100644
Binary files a/packages/lambda/remotionlambda.zip and b/packages/lambda/remotionlambda.zip differ