Skip to content

🎥 Make videos programmatically with React

`@remotion/renderer`: Update Linux dependencies and browser fetcher URLs for Headless Shell

Jonny Burgerf64a40648c83
diff --git a/packages/dockerfiles/Dockerfile.al2023 b/packages/dockerfiles/Dockerfile.al2023
index c0647a0bab..aabf7e45d1 100644
--- a/packages/dockerfiles/Dockerfile.al2023
+++ b/packages/dockerfiles/Dockerfile.al2023
@@ -18,6 +18,8 @@ RUN yum install -y \
alsa-lib \
nss \
dbus \
+ pango \
+ cups-libs \
at-spi2-core \
atk \
at-spi2-atk
diff --git a/packages/dockerfiles/Dockerfile.debian b/packages/dockerfiles/Dockerfile.debian
index 97d597c5e6..b3697e5d80 100644
--- a/packages/dockerfiles/Dockerfile.debian
+++ b/packages/dockerfiles/Dockerfile.debian
@@ -22,5 +22,10 @@ RUN apt install -y \
RUN git clone https://github.com/remotion-dev/template-helloworld /usr/app
RUN cd /usr/app
+
+COPY ensure-browser.mjs .
+COPY ensure.mjs .
+RUN node ensure.mjs
+
RUN npm i
RUN npx remotion compositions
diff --git a/packages/dockerfiles/Dockerfile.ubuntu b/packages/dockerfiles/Dockerfile.ubuntu22
similarity index 82%
rename from packages/dockerfiles/Dockerfile.ubuntu
rename to packages/dockerfiles/Dockerfile.ubuntu22
index b1a9cd7ad9..669bebce45 100644
--- a/packages/dockerfiles/Dockerfile.ubuntu
+++ b/packages/dockerfiles/Dockerfile.ubuntu22
@@ -18,6 +18,13 @@ RUN apt install -y \
libxcomposite1 \
libxdamage1 \
libgbm-dev \
+ libcups2 \
+ libcairo2 \
+ libpango-1.0-0 \
libatk-bridge2.0-0
+COPY ensure-browser.mjs .
+COPY ensure.mjs .
+RUN node ensure.mjs
+
RUN npx remotion compositions
diff --git a/packages/dockerfiles/Dockerfile.ubuntu24 b/packages/dockerfiles/Dockerfile.ubuntu24
new file mode 100644
index 0000000000..948ceb88de
--- /dev/null
+++ b/packages/dockerfiles/Dockerfile.ubuntu24
@@ -0,0 +1,30 @@
+FROM ubuntu:24.04
+
+RUN apt-get update
+RUN apt-get install git curl make -y
+RUN curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n | bash -s 20
+WORKDIR /usr/app
+RUN git clone https://github.com/remotion-dev/template-helloworld /usr/app
+RUN cd /usr/app
+RUN npm i
+RUN apt install -y \
+ libnss3 \
+ libdbus-1-3 \
+ libatk1.0-0 \
+ libasound2t64 \
+ libxrandr2 \
+ libxkbcommon-dev \
+ libxfixes3 \
+ libxcomposite1 \
+ libxdamage1 \
+ libgbm-dev \
+ libcups2 \
+ libcairo2 \
+ libpango-1.0-0 \
+ libatk-bridge2.0-0
+
+COPY ensure-browser.mjs .
+COPY ensure.mjs .
+RUN node ensure.mjs
+
+RUN npx remotion compositions
diff --git a/packages/dockerfiles/run.sh b/packages/dockerfiles/run.sh
index 430a1ee915..edc5123540 100644
--- a/packages/dockerfiles/run.sh
+++ b/packages/dockerfiles/run.sh
@@ -4,6 +4,7 @@ bun build-browser-downloader.ts
cp ensure-browser.mjs ../dockerfiles/ensure-browser.mjs
cd ../dockerfiles
docker build --file Dockerfile.al2023 . --output type=tar,dest=/dev/null --progress=plain
-docker build --file Dockerfile.ubuntu . --output type=tar,dest=/dev/null --progress=plain
+docker build --file Dockerfile.ubuntu24 . --output type=tar,dest=/dev/null --progress=plain
+docker build --file Dockerfile.ubuntu22 . --output type=tar,dest=/dev/null --progress=plain
docker build --file Dockerfile.debian . --output type=tar,dest=/dev/null --progress=plain
docker build --file Dockerfile.nix . --output type=tar,dest=/dev/null --progress=plain
diff --git a/packages/docs/docs/miscellaneous/linux-dependencies.mdx b/packages/docs/docs/miscellaneous/linux-dependencies.mdx
index 165a6334a7..2c08f132d9 100644
--- a/packages/docs/docs/miscellaneous/linux-dependencies.mdx
+++ b/packages/docs/docs/miscellaneous/linux-dependencies.mdx
@@ -21,6 +21,29 @@ apt install -y \
libxcomposite1 \
libxdamage1 \
libgbm-dev \
+ libcups2 \
+ libcairo2 \
+ libpango-1.0-0 \
+ libatk-bridge2.0-0
+```
+
+## Ubuntu 22.04
+
+```bash
+apt install -y \
+ libnss3 \
+ libdbus-1-3 \
+ libatk1.0-0 \
+ libasound2t64 \
+ libxrandr2 \
+ libxkbcommon-dev \
+ libxfixes3 \
+ libxcomposite1 \
+ libxdamage1 \
+ libgbm-dev \
+ libcups2 \
+ libcairo2 \
+ libpango-1.0-0 \
libatk-bridge2.0-0
```
@@ -38,6 +61,9 @@ apt install -y \
libxcomposite1 \
libxdamage1 \
libgbm-dev \
+ libcups2 \
+ libcairo2 \
+ libpango-1.0-0 \
libatk-bridge2.0-0
```
@@ -76,6 +102,8 @@ yum install -y \
alsa -lib \
nss \
dbus \
+ pango \
+ cups-libs \
at-spi2-core \
atk \
at-spi2-atk
diff --git a/packages/renderer/src/browser/BrowserFetcher.ts b/packages/renderer/src/browser/BrowserFetcher.ts
index 5252753fc9..534eb07e5d 100644
--- a/packages/renderer/src/browser/BrowserFetcher.ts
+++ b/packages/renderer/src/browser/BrowserFetcher.ts
@@ -46,12 +46,7 @@ function getChromeDownloadUrl({
chromeMode: ChromeMode;
}): string {
if (platform === 'linux-arm64') {
- if (chromeMode === 'chrome-for-testing') {
- throw new Error(
- `chromeMode: 'chrome-for-testing' is not supported on platform linux-arm64`,
- );
- }
- return `https://playwright.azureedge.net/builds/chromium/${version ?? PLAYWRIGHT_VERSION}/chromium-linux-arm64.zip`;
+ return `https://playwright.azureedge.net/builds/chromium/${version ?? PLAYWRIGHT_VERSION}/chromium-headless-shell-linux-arm64.zip`;
}
if (chromeMode === 'headless-shell') {
@@ -234,7 +229,9 @@ const getExecutablePath = (chromeMode: ChromeMode) => {
`chrome-headless-shell-${platform}`,
platform === 'win64'
? 'chrome-headless-shell.exe'
- : 'chrome-headless-shell',
+ : platform === 'linux-arm64'
+ ? 'headless_shell'
+ : 'chrome-headless-shell',
);
}
@@ -251,6 +248,7 @@ export const getRevisionInfo = (
const url = getChromeDownloadUrl({platform, version: null, chromeMode});
const local = fs.existsSync(folderPath);
+
return {
executablePath,
folderPath,