Skip to content

🎥 Make videos programmatically with React

Upgrade Chromium downloads to 157 and document shared-memory capture

Jonny Burgerfb609ebac54e
diff --git a/packages/docs/docs/lambda/custom-layers.mdx b/packages/docs/docs/lambda/custom-layers.mdx
index 69064f4d05..325c4e00d1 100644
--- a/packages/docs/docs/lambda/custom-layers.mdx
+++ b/packages/docs/docs/lambda/custom-layers.mdx
@@ -17,7 +17,7 @@ In some advanced use cases, you want to replace certain parts of the stack:
Before you create a custom stack, feel free to contact us to see if Remotion can provide the changes upstream.
-Also consider that the AWS Lambda layers cumulatively may not exceed 250MB extracted, so you need to sacrifice an equal amount of other files.
+[AWS Lambda limits](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html) the combined uncompressed size of the function ZIP and all attached layers to 250 MiB (262,144,000 bytes). The compressed ZIP sizes do not determine whether a deployment fits.
If you just want to add fonts, we recommend to use [Web fonts](/docs/fonts) instead.
@@ -25,32 +25,33 @@ If you just want to add fonts, we recommend to use [Web fonts](/docs/fonts) inst
Consider using our layer options before creating a custom stack:
+The following sizes are for the v23 layers with Chromium 157.0.8080.0, used from Remotion v4.0.534. Sizes are uncompressed; 1 MiB is 1,048,576 bytes.
+
With the default option (`--runtime-preference=cjk` or no option):
-| Item | Size |
-| ------------ | -------- |
-| chromium | 196 MB |
-| emoji-google | 9.9 MB |
-| fonts | 1.9 MB |
-| cjk | 16 MB |
-| **Total** | 223.8 MB |
+| Item | Size |
+| ------------ | ---------- |
+| chromium | 218.65 MiB |
+| emoji-google | 4.76 MiB |
+| fonts | 1.87 MiB |
+| cjk | 14.07 MiB |
+| Total layers | 239.35 MiB |
With the option [`--runtime-preference=apple-emojis`](/docs/lambda/deployfunction#runtimepreference):
-| Item | Size |
-| ----------- | -------- |
-| chromium | 196 MB |
-| emoji-apple | 45 MB |
-| fonts | 1.9 MB |
-| **Total** | 242.9 MB |
+| Item | Size |
+| ------------ | ---------- |
+| chromium | 218.65 MiB |
+| emoji-apple | 8.57 MiB |
+| fonts | 1.87 MiB |
+| Total layers | 229.09 MiB |
-:::note
-Numbers are currently outdated since the last Chromium update.
+:::warning
+The totals above exclude the function ZIP, which also counts toward the 250 MiB limit. The default layers leave 10.65 MiB for the function; the Apple Emoji layers leave 20.91 MiB. The current function exceeds the remaining space with the default v23 layers, so their deployment requires a size reduction.
:::
:::note
-Note that by enabling the Apple Emojis, to stay under the 250 MB limit, support for CJK (Chinese, Japanese, Korean) characters will be removed.
-Google Emojis are also removed.
+Enabling Apple Emojis replaces the Google Emoji and CJK (Chinese, Japanese, Korean) layers. Load additional fonts as [Web fonts](/docs/fonts) if you need CJK characters with Apple Emojis.
:::
## Ensure Remotion version
@@ -66,7 +67,7 @@ The folders `chromium` and `fonts` contain the binaries for the ARM version. The
Put the files that you want in the corresponding folders - for example, add the Apple Emoji Font `AppleColorEmoji.ttf` into the `fonts/.fonts/NotoSans/` folder.
-Since the AWS Lambda layers may not exceed 250MB extracted, we need to sacrifice an equal amount of other files - for example by removing `fonts/.fonts/NotoColorEmoji.ttf` and `fonts/.fonts/NotoSansCJKjp-Regular.otf`.
+Keep the function ZIP and all layers within the combined 250 MiB uncompressed limit. Remove other files if needed, such as `fonts/.fonts/NotoColorEmoji.ttf` and `fonts/.fonts/NotoSansCJKjp-Regular.otf`.
You can see the size of the folders by running:
diff --git a/packages/docs/docs/lambda/runtime.mdx b/packages/docs/docs/lambda/runtime.mdx
index 9f09ecc309..96acc0f545 100644
--- a/packages/docs/docs/lambda/runtime.mdx
+++ b/packages/docs/docs/lambda/runtime.mdx
@@ -63,6 +63,7 @@ The browser was compiled including the proprietary codecs, so you can include MP
| Remotion version | Chrome version |
| ---------------- | -------------- |
+| From 4.0.534 | 157.0.8080.0 |
| From 4.0.452 | 149.0.7790.0 |
| From 4.0.415 | 144.0.7559.20 |
| From 4.0.274 | 133.0.6943.141 |
diff --git a/packages/docs/docs/miscellaneous/chrome-headless-shell.mdx b/packages/docs/docs/miscellaneous/chrome-headless-shell.mdx
index 9123e29c9b..4ced0bf7db 100644
--- a/packages/docs/docs/miscellaneous/chrome-headless-shell.mdx
+++ b/packages/docs/docs/miscellaneous/chrome-headless-shell.mdx
@@ -18,6 +18,8 @@ The following platforms are supported:
- Linux x64 - [install the Linux dependencies](/docs/miscellaneous/linux-dependencies)
- Linux arm64 - only for "Chrome Headless Shell"
+On Apple Silicon, the default Chrome Headless Shell requires macOS 13 or later from Remotion v4.0.534.
+
## Ensure Chrome is installed
There are two ways to ensure Chrome Headless Shell is installed:
@@ -82,7 +84,7 @@ node_modules/.remotion/chrome-headless-shell/VERSION
node_modules/.remotion/chrome-for-testing/VERSION
```
-The file contains the Chrome version string, e.g. `149.0.7790.0`.
+The file contains the Chrome version string, e.g. `157.0.8080.0`. Remotion's builds that enable shared-memory capture include a `-remotion-v3` suffix.
If the `VERSION` file is missing (e.g. when upgrading from an older version of Remotion) or does not match the expected version, Remotion will delete the existing browser and download the correct version.
@@ -144,6 +146,7 @@ Remotion will download a well-tested Chrome version:
| Remotion version | Chrome version |
| ---------------- | --------------------------------- |
+| From 4.0.534 | 157.0.8080.0 |
| From 4.0.452 | 149.0.7790.0 |
| From 4.0.414 | 144.0.7559.97 |
| From 4.0.315 | 134.0.6998.35 (skipped on Lambda) |
@@ -152,6 +155,14 @@ Remotion will download a well-tested Chrome version:
Upgrades may happen in a patch release and will be listed here.
+Linux ARM64 systems with glibc below 2.35 continue using the Playwright Chromium 149 fallback. The Amazon Linux 2023 build uses Chromium 157. Chrome for Testing on Linux ARM64 also continues using the Playwright build.
+
+## Shared-memory capture<AvailableFrom v="4.0.534" />
+
+Video renders with Remotion's Chrome Headless Shell builds on Apple Silicon and Linux can capture frames through shared memory when parallel encoding is available. This avoids compressing each frame as JPEG or PNG before encoding the video.
+
+When shared-memory capture is used, frames are captured without JPEG compression, even when `imageFormat` is set to `"jpeg"`. Chrome for Testing and browsers without shared-memory capture continue using JPEG or PNG screenshots.
+
## Changing the Chrome version
On Lambda, it is not possible to change the Chrome version.
diff --git a/packages/docs/docs/renderer/ensure-browser.mdx b/packages/docs/docs/renderer/ensure-browser.mdx
index 26d2261040..bf8fb7f49d 100644
--- a/packages/docs/docs/renderer/ensure-browser.mdx
+++ b/packages/docs/docs/renderer/ensure-browser.mdx
@@ -23,7 +23,7 @@ await ensureBrowser({
console.log('Downloading browser');
return {
- version: '149.0.7790.0',
+ version: '157.0.8080.0',
onProgress: ({percent}) => {
console.log(`${Math.round(percent * 100)}% downloaded`);
},
@@ -67,7 +67,7 @@ const onBrowserDownload: OnBrowserDownload = () => {
return {
// Pass `null` to use Remotion's recommendation.
- version: '149.0.7790.0',
+ version: '157.0.8080.0',
onProgress,
};
};
diff --git a/packages/renderer/src/browser/BrowserFetcher.ts b/packages/renderer/src/browser/BrowserFetcher.ts
index 193092614a..7038ae8836 100644
--- a/packages/renderer/src/browser/BrowserFetcher.ts
+++ b/packages/renderer/src/browser/BrowserFetcher.ts
@@ -29,6 +29,7 @@ import {
getChromeDownloadUrl,
isAmazonLinux2023,
logDownloadUrl,
+ PLAYWRIGHT_CHROMIUM_VERSION,
type Platform,
TESTED_VERSION,
} from './get-chrome-download-url';
@@ -97,17 +98,24 @@ export const getExpectedVersion = ({
// Remotion-patched builds get their own cache marker so an existing stock or
// older patched download of the same Chromium version is replaced once.
- // Every default headless-shell download served from remotion.media is a v3
- // build; the Playwright/Chrome for Testing fallbacks are stock Chromium.
+ // Remotion builds include the v3 shared-memory patch; the Playwright/Chrome
+ // for Testing fallbacks are stock Chromium.
+ const downloadUrl = getChromeDownloadUrl({
+ platform,
+ version: null,
+ chromeMode,
+ });
if (
chromeMode === 'headless-shell' &&
- getChromeDownloadUrl({platform, version: null, chromeMode}).startsWith(
- 'https://remotion.media/',
- )
+ downloadUrl.startsWith('https://remotion.media/')
) {
return `${TESTED_VERSION}-remotion-v3`;
}
+ if (downloadUrl.startsWith('https://playwright.azureedge.net/')) {
+ return PLAYWRIGHT_CHROMIUM_VERSION;
+ }
+
return TESTED_VERSION;
};
diff --git a/packages/renderer/src/browser/get-chrome-download-url.ts b/packages/renderer/src/browser/get-chrome-download-url.ts
index 9e1bbba5be..7883f3b4a8 100644
--- a/packages/renderer/src/browser/get-chrome-download-url.ts
+++ b/packages/renderer/src/browser/get-chrome-download-url.ts
@@ -4,10 +4,11 @@ import type {LogLevel} from '../log-level';
import {Log} from '../logger';
import type {ChromeMode} from '../options/chrome-mode';
-export const TESTED_VERSION = '149.0.7790.0';
+export const TESTED_VERSION = '157.0.8080.0';
// https://github.com/microsoft/playwright/blame/e76ca6cba40c26bf22c19cf37398d2b9da9ed465/packages/playwright-core/browsers.json
// packages/playwright-core/browsers.json
const PLAYWRIGHT_VERSION = '1421'; // 149.0.7790.0
+export const PLAYWRIGHT_CHROMIUM_VERSION = '149.0.7790.0';
export type Platform =
| 'linux64'
@@ -108,9 +109,7 @@ export function getChromeDownloadUrl({
// Amazon Linux 2023 on arm64 needs a special build.
// This binary is compatible with older glibc (no 2.35 requirement).
if (isAmazonLinux2023() && chromeMode === 'headless-shell' && !version) {
- // v3 of the Remotion shared-memory patch: file-backed frame pools for hosts
- // without /dev/shm, such as AWS Lambda.
- return 'https://remotion.media/chromium-headless-shell-amazon-linux-arm64-149.0.7790.0-v3.zip?clear';
+ return `https://remotion.media/chromium-headless-shell-amazon-linux-arm64-${TESTED_VERSION}.zip?clear`;
}
if (chromeMode === 'chrome-for-testing') {
@@ -123,7 +122,7 @@ export function getChromeDownloadUrl({
// Regular arm64 binary requires glibc 2.35+
if (canUseRemotionMediaBinaries()) {
- return `https://remotion.media/chromium-headless-shell-linux-arm64-${TESTED_VERSION}-v3.zip?clear`;
+ return `https://remotion.media/chromium-headless-shell-linux-arm64-${TESTED_VERSION}.zip?clear`;
}
// Fall back to Playwright for older glibc (non-Amazon Linux systems)
@@ -132,18 +131,18 @@ export function getChromeDownloadUrl({
if (chromeMode === 'headless-shell') {
if (platform === 'mac-arm64' && version === null) {
- return `https://remotion.media/chromium-headless-shell-mac-arm64-${TESTED_VERSION}-v3.zip?clear`;
+ return `https://remotion.media/chromium-headless-shell-mac-arm64-${TESTED_VERSION}.zip?clear`;
}
// Amazon Linux 2023 needs a special build.
// This binary is compatible with older glibc (no 2.35 requirement).
if (isAmazonLinux2023() && platform === 'linux64' && !version) {
- return `https://remotion.media/chromium-headless-shell-amazon-linux-x64-149.0.7790.0-v3.zip?clear`;
+ return `https://remotion.media/chromium-headless-shell-amazon-linux-x64-${TESTED_VERSION}.zip?clear`;
}
if (platform === 'linux64' && version === null) {
if (canUseRemotionMediaBinaries()) {
- return `https://remotion.media/chromium-headless-shell-linux-x64-${TESTED_VERSION}-v3.zip?clear`;
+ return `https://remotion.media/chromium-headless-shell-linux-x64-${TESTED_VERSION}.zip?clear`;
}
// Fall back to Google's CDN for older glibc
diff --git a/packages/renderer/src/ensure-browser.ts b/packages/renderer/src/ensure-browser.ts
index bd1c054a43..bbdae0827b 100644
--- a/packages/renderer/src/ensure-browser.ts
+++ b/packages/renderer/src/ensure-browser.ts
@@ -7,7 +7,6 @@ import {
getPlatform,
getRevisionInfo,
readVersionFile,
- TESTED_VERSION,
} from './browser/BrowserFetcher';
import type {BrowserSafeApis} from './client';
import {Log} from './logger';
@@ -73,12 +72,17 @@ const internalEnsureBrowserUncapped = async ({
}
if (status.type === 'version-mismatch') {
+ const expectedVersion = getExpectedVersion({
+ version,
+ chromeMode,
+ platform: getPlatform(),
+ });
const versionInfo = status.actualVersion
? ` (installed: ${status.actualVersion})`
: '';
Log.info(
{indent, logLevel},
- `This version of Remotion uses Chrome version ${TESTED_VERSION}, but the installed one differs${versionInfo}. Re-downloading.`,
+ `This version of Remotion uses Chrome version ${expectedVersion}, but the installed one differs${versionInfo}. Re-downloading.`,
);
}