Skip to content

🎥 Make videos programmatically with React

`@remotion/renderer`: Disable `fromSurface` only on Lambda, not on Linux in general

Jonny Burgerfe9459499055
diff --git a/packages/lambda/src/functions/helpers/get-chromium-executable-path.ts b/packages/lambda/src/functions/helpers/get-chromium-executable-path.ts
index 04faa9d074..03f5d4675f 100644
--- a/packages/lambda/src/functions/helpers/get-chromium-executable-path.ts
+++ b/packages/lambda/src/functions/helpers/get-chromium-executable-path.ts
@@ -6,6 +6,7 @@ if (
process.env.FONTCONFIG_FILE = '/opt/fonts.conf';
process.env.READ_ONLY_FS = '1';
+ process.env.DISABLE_FROM_SURFACE = '1';
process.env.NO_COLOR = '1';
}
diff --git a/packages/renderer/src/screenshot-task.ts b/packages/renderer/src/screenshot-task.ts
index 60ca1a6cff..d9ce420d50 100644
--- a/packages/renderer/src/screenshot-task.ts
+++ b/packages/renderer/src/screenshot-task.ts
@@ -78,9 +78,10 @@ export const screenshotTask = async ({
optimizeForSpeed: false,
// We find that there is a 0.1% framedrop when rendering under memory pressure
// which can be circumvented by disabling this option on Lambda.
- // To be determined: Is this a problem with Lambda, Linux, or the Chrome version
+ // To be determined: Is this a problem with Lambda, or the Chrome version
// we are using on Lambda?
- fromSurface: process.platform !== 'linux',
+ // We already found out that the problem is not a general Linux problem.
+ fromSurface: !process.env.DISABLE_FROM_SURFACE,
});
result = value;
}