Skip to content

🎥 Make videos programmatically with React

update runtime

Jonny Burgerebbe23294e5f
diff --git a/packages/lambda/src/api/create-function.ts b/packages/lambda/src/api/create-function.ts
index 70390e6375..5429ca29e6 100644
--- a/packages/lambda/src/api/create-function.ts
+++ b/packages/lambda/src/api/create-function.ts
@@ -14,7 +14,7 @@ import {VERSION} from 'remotion/version';
import {LOG_GROUP_PREFIX} from '../defaults';
import type {AwsRegion} from '../pricing/aws-regions';
import {getCloudWatchLogsClient, getLambdaClient} from '../shared/aws-clients';
-import {hostedLayers} from '../shared/hosted-layers';
+import {hostedLayers, v5HostedLayers} from '../shared/hosted-layers';
import {lambdaInsightsExtensions} from '../shared/lambda-insights-extensions';
import {ROLE_NAME} from './iam-validation/suggested-policy';
@@ -31,6 +31,7 @@ export const createFunction = async ({
ephemerealStorageInMb,
customRoleArn,
enableLambdaInsights,
+ enableV5Runtime,
}: {
createCloudWatchLogGroup: boolean;
region: AwsRegion;
@@ -44,6 +45,7 @@ export const createFunction = async ({
ephemerealStorageInMb: number;
customRoleArn: string;
enableLambdaInsights: boolean;
+ enableV5Runtime: boolean;
}): Promise<{FunctionName: string}> => {
if (createCloudWatchLogGroup) {
try {
@@ -73,6 +75,10 @@ export const createFunction = async ({
const defaultRoleName = `arn:aws:iam::${accountId}:role/${ROLE_NAME}`;
+ const layers = enableV5Runtime
+ ? v5HostedLayers[region]
+ : hostedLayers[region];
+
const {FunctionName, FunctionArn} = await getLambdaClient(region).send(
new CreateFunctionCommand({
Code: {
@@ -81,22 +87,17 @@ export const createFunction = async ({
FunctionName: functionName,
Handler: 'index.handler',
Role: customRoleArn ?? defaultRoleName,
- Runtime: 'nodejs20.x',
+ Runtime: enableV5Runtime ? 'nodejs20.x' : 'nodejs18.x',
Description: 'Renders a Remotion video.',
MemorySize: memorySizeInMb,
Timeout: timeoutInSeconds,
- Layers: hostedLayers[region]
+ Layers: layers
.map(({layerArn, version}) => `${layerArn}:${version}`)
.concat(enableLambdaInsights ? lambdaInsightsExtensions[region] : []),
Architectures: ['arm64'],
EphemeralStorage: {
Size: ephemerealStorageInMb,
},
- Environment: {
- Variables: {
- NODE_EXTRA_CA_CERTS: '/var/runtime/ca-cert.pem',
- },
- },
}),
);
@@ -141,12 +142,16 @@ export const createFunction = async ({
state = getFn.Configuration?.State as string;
}
+ const RuntimeVersionArn = enableV5Runtime
+ ? `arn:aws:lambda:${region}::runtime:da57c20c4b965d5b75540f6865a35fc8030358e33ec44ecfed33e90901a27a72`
+ : `arn:aws:lambda:${region}::runtime:da57c20c4b965d5b75540f6865a35fc8030358e33ec44ecfed33e90901a27a72`;
+
try {
await getLambdaClient(region).send(
new PutRuntimeManagementConfigCommand({
FunctionName,
UpdateRuntimeOn: 'Manual',
- RuntimeVersionArn: `arn:aws:lambda:${region}::runtime:da57c20c4b965d5b75540f6865a35fc8030358e33ec44ecfed33e90901a27a72`,
+ RuntimeVersionArn,
}),
);
} catch (err) {
diff --git a/packages/lambda/src/shared/hosted-layers.ts b/packages/lambda/src/shared/hosted-layers.ts
index 405b5169cd..348fae076d 100644
--- a/packages/lambda/src/shared/hosted-layers.ts
+++ b/packages/lambda/src/shared/hosted-layers.ts
@@ -15,12 +15,12 @@ export const hostedLayers: HostedLayers = {
{
layerArn:
'arn:aws:lambda:eu-central-1:678892195805:layer:remotion-binaries-fonts-arm64',
- version: 26,
+ version: 31,
},
{
layerArn:
'arn:aws:lambda:eu-central-1:678892195805:layer:remotion-binaries-chromium-arm64',
- version: 27,
+ version: 32,
},
],
'eu-west-1': [],
@@ -40,3 +40,5 @@ export const hostedLayers: HostedLayers = {
'sa-east-1': [],
'us-west-1': [],
};
+
+export const v5HostedLayers = hostedLayers;
diff --git a/packages/renderer/src/open-browser.ts b/packages/renderer/src/open-browser.ts
index 643f5ad551..638e07c892 100644
--- a/packages/renderer/src/open-browser.ts
+++ b/packages/renderer/src/open-browser.ts
@@ -122,6 +122,7 @@ export const internalOpenBrowser = async ({
);
}
+ console.log('look mom, no single process!');
const browserInstance = await puppeteer.launch({
executablePath,
dumpio: isEqualOrBelowLogLevel(logLevel, 'verbose'),
@@ -151,6 +152,7 @@ export const internalOpenBrowser = async ({
'--disable-sync',
'--force-color-profile=srgb',
'--metrics-recording-only',
+ '--mute-audio',
'--no-first-run',
'--video-threads=' + getIdealVideoThreadsFlag(logLevel),
'--enable-automation',
@@ -160,15 +162,10 @@ export const internalOpenBrowser = async ({
'--export-tagged-pdf',
'--intensive-wake-up-throttling-policy=0',
chromiumOptions.headless ?? true ? '--headless=old' : null,
- '--no-sandbox',
'--disable-setuid-sandbox',
+ '--disable-gpu',
...customGlRenderer,
'--disable-background-media-suspend',
- process.platform === 'linux' &&
- chromiumOptions.gl !== 'vulkan' &&
- !enableMultiProcessOnLinux
- ? '--single-process'
- : null,
'--allow-running-insecure-content', // https://source.chromium.org/search?q=lang:cpp+symbol:kAllowRunningInsecureContent&ss=chromium
'--disable-component-update', // https://source.chromium.org/search?q=lang:cpp+symbol:kDisableComponentUpdate&ss=chromium
'--disable-domain-reliability', // https://source.chromium.org/search?q=lang:cpp+symbol:kDisableDomainReliability&ss=chromium
@@ -180,9 +177,9 @@ export const internalOpenBrowser = async ({
'--no-default-browser-check', // https://source.chromium.org/search?q=lang:cpp+symbol:kNoDefaultBrowserCheck&ss=chromium
'--no-pings', // https://source.chromium.org/search?q=lang:cpp+symbol:kNoPings&ss=chromium
'--font-render-hinting=none',
- '--no-zygote', // https://source.chromium.org/search?q=lang:cpp+symbol:kNoZygote&ss=chromium,
- '--ignore-gpu-blocklist',
- '--enable-unsafe-webgpu',
+ '--no-sandbox',
+ '--network-service-in-process',
+ '--in-process-gpu',
typeof forceDeviceScaleFactor === 'undefined'
? null
: `--force-device-scale-factor=${forceDeviceScaleFactor}`,