🎥 Make videos programmatically with React
pass executable path to lambda
Jonny Burger9d8f0e6e5176
diff --git a/packages/lambda/src/functions/helpers/get-browser-instance.ts b/packages/lambda/src/functions/helpers/get-browser-instance.tsindex d413e0807b..71726209c4 100644--- a/packages/lambda/src/functions/helpers/get-browser-instance.ts+++ b/packages/lambda/src/functions/helpers/get-browser-instance.ts@@ -42,7 +42,7 @@ export const getBrowserInstance = async (launching = true;- const execPath = await executablePath();+ const execPath = executablePath();const actualChromiumOptions: ChromiumOptions = {...chromiumOptions,diff --git a/packages/lambda/src/functions/helpers/get-chromium-executable-path.ts b/packages/lambda/src/functions/helpers/get-chromium-executable-path.tsindex de089cdf29..9bd73172ce 100644--- a/packages/lambda/src/functions/helpers/get-chromium-executable-path.ts+++ b/packages/lambda/src/functions/helpers/get-chromium-executable-path.ts@@ -11,6 +11,6 @@ if (process.env.LD_LIBRARY_PATH = '/opt/lib:/opt/bin';}-export const executablePath = async (): Promise<string | undefined> => {+export const executablePath = (): string => {return '/opt/bin/chromium';};diff --git a/packages/lambda/src/functions/helpers/validate-composition.ts b/packages/lambda/src/functions/helpers/validate-composition.tsindex 44d51f888b..93383b56fe 100644--- a/packages/lambda/src/functions/helpers/validate-composition.ts+++ b/packages/lambda/src/functions/helpers/validate-composition.ts@@ -7,6 +7,7 @@ import type {import {getCompositions} from '@remotion/renderer';import type {TCompMetadata} from 'remotion';import type {Await} from '../../shared/await';+import {executablePath} from './get-chromium-executable-path';type ValidateCompositionOptions = {serveUrl: string;@@ -49,6 +50,7 @@ export const validateComposition = async ({chromiumOptions,port,downloadMap,+ browserExecutable: executablePath(),});const found = compositions.find((c) => c.id === composition);diff --git a/packages/lambda/src/functions/renderer.ts b/packages/lambda/src/functions/renderer.tsindex bf8fa179b5..efc8dc7467 100644--- a/packages/lambda/src/functions/renderer.ts+++ b/packages/lambda/src/functions/renderer.ts@@ -19,6 +19,7 @@ import type {ObjectChunkTimingData,} from './chunk-optimization/types';import {getBrowserInstance} from './helpers/get-browser-instance';+import {executablePath} from './helpers/get-chromium-executable-path';import {getCurrentRegionInFunction} from './helpers/get-current-region';import {lambdaWriteFile} from './helpers/io';import {@@ -228,6 +229,7 @@ const renderHandler = async (// Special flag only in Lambda renderer which improves the audio qualityaudioCodec: null,preferLossless: true,+ browserExecutable: executablePath(),}).then(() => resolve()).catch((err) => reject(err));diff --git a/packages/lambda/src/functions/still.ts b/packages/lambda/src/functions/still.tsindex 6edd0c83f8..fc6db7bf61 100644--- a/packages/lambda/src/functions/still.ts+++ b/packages/lambda/src/functions/still.ts@@ -31,6 +31,7 @@ import {} from './helpers/expected-out-name';import {formatCostsInfo} from './helpers/format-costs-info';import {getBrowserInstance} from './helpers/get-browser-instance';+import {executablePath} from './helpers/get-chromium-executable-path';import {getCurrentArchitecture} from './helpers/get-current-architecture';import {getCurrentRegionInFunction} from './helpers/get-current-region';import {getOutputUrlFromMetadata} from './helpers/get-output-url-from-metadata';@@ -173,6 +174,7 @@ const innerStillHandler = async (scale: lambdaParams.scale,timeoutInMilliseconds: lambdaParams.timeoutInMilliseconds,downloadMap,+ browserExecutable: executablePath(),});const {key, renderBucketName, customCredentials} = getExpectedOutName(