Skip to content

🎥 Make videos programmatically with React

fixes

Jonny Burger01707836d39b
diff --git a/packages/docs/docs/lambda/deployfunction.md b/packages/docs/docs/lambda/deployfunction.md
index 9bb68d617c..a653874e5f 100644
--- a/packages/docs/docs/lambda/deployfunction.md
+++ b/packages/docs/docs/lambda/deployfunction.md
@@ -21,6 +21,7 @@ const { functionName } = await deployFunction({
timeoutInSeconds: 120,
memorySizeInMb: 1024,
createCloudWatchLogGroup: true,
+ architecture: "arm64",
});
console.log(functionName);
```
diff --git a/packages/docs/docs/lambda/feb-2022-outage.md b/packages/docs/docs/lambda/feb-2022-outage.md
new file mode 100644
index 0000000000..5ea5416876
--- /dev/null
+++ b/packages/docs/docs/lambda/feb-2022-outage.md
@@ -0,0 +1,55 @@
+---
+id: feb-2022-outage
+sidebar_label: 02/2022 Outage
+title: February 2022 Outage
+---
+
+On February 3rd 2022, AWS made a change to their Lambda micro-VMs that breaks Remotion Lambda. This document contains information for affected users.
+
+## Hotfix solution
+
+[Upgrade](/docs/lambda/upgrading) your Lambda functions to the latest version and deploy them with a `x86_64` architecture.
+
+Via CLI:
+
+```
+npx remotion lambda functions deploy --architecture=x86_64
+```
+
+Via Node.JS:
+
+## Example
+
+```ts twoslash
+// @module: esnext
+// @target: es2017
+
+import { deployFunction } from "@remotion/lambda";
+
+const { functionName } = await deployFunction({
+ region: "us-east-1",
+ timeoutInSeconds: 120,
+ memorySizeInMb: 1024,
+ createCloudWatchLogGroup: true,
+ architecture: "x86_64",
+});
+console.log(functionName);
+```
+
+## Caveat
+
+The x86_64 version **does not contain fonts for Japanese/Chinese/Korean**! Since the binaries are bigger on the **x86_64** version, we exceeded the file limit and had to delete the biggest font in order to stay within the AWS bounds.
+
+x86_64 is also slower and has about a 30% higher cost/performance ratio.
+
+## AWS mitigation
+
+We contacted AWS and hope to receive an answer soon.
+
+## Long-term solution
+
+ARM64 is the preferred and default solution. Once the problem is solved, we recommend everyone to switch back.
+
+## Contact
+
+Join the discussion in our Discord channel if you have questions.
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 31b5a41d7d..3d59aa2532 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -96,6 +96,7 @@ module.exports = {
],
},
"lambda/checklist",
+ "lambda/feb-2022-outage",
{
collapsed: false,
type: "category",
diff --git a/packages/example/ggg.mp4 b/packages/example/ggg.mp4
new file mode 100644
index 0000000000..729f406897
Binary files /dev/null and b/packages/example/ggg.mp4 differ
diff --git a/packages/lambda/remotionlambda.zip b/packages/lambda/remotionlambda.zip
index 0d3658fc2c..f3932ce749 100644
Binary files a/packages/lambda/remotionlambda.zip and b/packages/lambda/remotionlambda.zip differ
diff --git a/packages/lambda/src/admin/make-layer-public.ts b/packages/lambda/src/admin/make-layer-public.ts
index 47800caa0f..771c2ecfd5 100644
--- a/packages/lambda/src/admin/make-layer-public.ts
+++ b/packages/lambda/src/admin/make-layer-public.ts
@@ -3,8 +3,8 @@ import {
PublishLayerVersionCommand,
} from '@aws-sdk/client-lambda';
import {lambda} from 'aws-policies';
+import {getRegions} from '..';
import {quit} from '../cli/helpers/quit';
-import {AwsRegion} from '../pricing/aws-regions';
import {getLambdaClient} from '../shared/aws-clients';
import {CURRENT_VERSION} from '../shared/constants';
import {HostedLayers} from '../shared/hosted-layers';
@@ -14,8 +14,6 @@ const runtimes: string[] = ['nodejs14.x'];
const archictures: LambdaArchitecture[] = ['arm64', 'x86_64'];
-const region: AwsRegion = 'us-east-1';
-
const layerInfo: HostedLayers = {
arm64: {
'ap-northeast-1': [],
@@ -46,51 +44,53 @@ const layerInfo: HostedLayers = {
const makeLayerPublic = async () => {
const layers = ['remotion', 'ffmpeg', 'chromium'] as const;
for (const architecture of archictures) {
- for (const layer of layers) {
- const layerName = `remotion-binaries-${layer}-${architecture}`;
- const {Version, LayerArn} = await getLambdaClient(region).send(
- new PublishLayerVersionCommand({
- Content: {
- S3Bucket: 'remotionlambda-binaries-' + region,
- S3Key: `remotion-layer-${layer}-v4-${architecture}.zip`,
- },
- LayerName: layerName,
- LicenseInfo:
- layer === 'chromium'
- ? 'Compiled from Chromium source. Read Chromium License: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/LICENSE'
- : layer === 'ffmpeg'
- ? 'Compiled from FFMPEG source. Read FFMPEG license: https://ffmpeg.org/legal.html'
- : 'Contains UNIX .so files and Noto Sans font. Read Noto Sans License: https://fonts.google.com/noto/specimen/Noto+Sans/about',
- CompatibleRuntimes: runtimes,
- Description: CURRENT_VERSION,
- })
- );
- await getLambdaClient(region).send(
- new AddLayerVersionPermissionCommand({
- Action: lambda.GetLayerVersion,
- LayerName: layerName,
- Principal: '*',
- VersionNumber: Version,
- StatementId: 'public-layer',
- })
- );
- if (!layerInfo[architecture][region]) {
- layerInfo[architecture][region] = [];
- }
+ for (const region of getRegions()) {
+ for (const layer of layers) {
+ const layerName = `remotion-binaries-${layer}-${architecture}`;
+ const {Version, LayerArn} = await getLambdaClient(region).send(
+ new PublishLayerVersionCommand({
+ Content: {
+ S3Bucket: 'remotionlambda-binaries-' + region,
+ S3Key: `remotion-layer-${layer}-v4-${architecture}.zip`,
+ },
+ LayerName: layerName,
+ LicenseInfo:
+ layer === 'chromium'
+ ? 'Compiled from Chromium source. Read Chromium License: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/LICENSE'
+ : layer === 'ffmpeg'
+ ? 'Compiled from FFMPEG source. Read FFMPEG license: https://ffmpeg.org/legal.html'
+ : 'Contains UNIX .so files and Noto Sans font. Read Noto Sans License: https://fonts.google.com/noto/specimen/Noto+Sans/about',
+ CompatibleRuntimes: runtimes,
+ Description: CURRENT_VERSION,
+ })
+ );
+ await getLambdaClient(region).send(
+ new AddLayerVersionPermissionCommand({
+ Action: lambda.GetLayerVersion,
+ LayerName: layerName,
+ Principal: '*',
+ VersionNumber: Version,
+ StatementId: 'public-layer',
+ })
+ );
+ if (!layerInfo[architecture][region]) {
+ layerInfo[architecture][region] = [];
+ }
- if (!LayerArn) {
- throw new Error('layerArn is null');
- }
+ if (!LayerArn) {
+ throw new Error('layerArn is null');
+ }
- if (!Version) {
- throw new Error('Version is null');
- }
+ if (!Version) {
+ throw new Error('Version is null');
+ }
- layerInfo[architecture][region].push({
- layerArn: LayerArn,
- version: Version,
- });
- console.log({LayerArn, Version});
+ layerInfo[architecture][region].push({
+ layerArn: LayerArn,
+ version: Version,
+ });
+ console.log({LayerArn, Version});
+ }
}
}
};
diff --git a/packages/lambda/src/shared/hosted-layers.ts b/packages/lambda/src/shared/hosted-layers.ts
index ea5032e5b2..46a32aa4a2 100644
--- a/packages/lambda/src/shared/hosted-layers.ts
+++ b/packages/lambda/src/shared/hosted-layers.ts
@@ -22,17 +22,17 @@ export const hostedLayers: HostedLayers = {
{
layerArn:
'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-remotion-arm64',
- version: 2,
+ version: 4,
},
{
layerArn:
'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-ffmpeg-arm64',
- version: 2,
+ version: 4,
},
{
layerArn:
'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-chromium-arm64',
- version: 2,
+ version: 4,
},
],
'us-east-2': [],
@@ -50,17 +50,17 @@ export const hostedLayers: HostedLayers = {
{
layerArn:
'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-remotion-x86_64',
- version: 2,
+ version: 4,
},
{
layerArn:
'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-ffmpeg-x86_64',
- version: 2,
+ version: 4,
},
{
layerArn:
'arn:aws:lambda:us-east-1:678892195805:layer:remotion-binaries-chromium-x86_64',
- version: 2,
+ version: 4,
},
],
'us-east-2': [],