Skip to main content

Chromium flags

我们允许您在自 Remotion 2.6.5 起在 Chromium 和 Google Chrome 中设置以下标志:

--disable-web-security

这将主要禁用 CORS 和其他安全功能。

note

Remotion 将自动附加 --user-data-dir 标志。

通过 Node.JS API

getCompositions(), renderStill(), renderMedia(), renderFrames(), getCompositionsOnLambda(), renderStillOnLambda()renderMediaOnLambda() 中,您可以传递 chromiumOptions.disableWebSecurity

通过 CLI 标志

在以下命令中之一中传递 --disable-web-securityremotion render, remotion compositions, remotion still, remotion lambda render, remotion lambda still, remotion lambda compositions

通过配置文件

使用 setChromiumDisableWebSecurity()

tsx
Config.setChromiumDisableWebSecurity(true);
tsx
Config.setChromiumDisableWebSecurity(true);
note

v3.3.39 之前,该选项称为 Config.Puppeteer.setChromiumDisableWebSecurity()

--ignore-certificate-errors

导致无效的 SSL 证书(如自签名证书)被忽略。

通过 Node.JS API

getCompositions(), renderStill(), renderMedia(), renderFrames(), getCompositionsOnLambda(), renderStillOnLambda()renderMediaOnLambda() 中,您可以传递 chromiumOptions.ignoreCertificateErrors

通过 CLI 标志

在以下命令中之一中传递 --ignore-certificate-errorsremotion render, remotion compositions, remotion still, remotion lambda render, remotion lambda still, remotion lambda compositions.

通过配置文件

使用 setChromiumIgnoreCertificateErrors().

tsx
Config.setChromiumIgnoreCertificateErrors(true);
tsx
Config.setChromiumIgnoreCertificateErrors(true);
note

v3.3.39 之前,该选项称为 Config.Puppeteer.setChromiumIgnoreCertificateErrors().

--disable-headless

If disabled, the render will open an actual Chrome window where you can see the render happen. The default is headless mode.

通过 Node.JS APIs

getCompositions(), renderStill(), renderMedia()renderFrames() 中,您可以传递 chromiumOptions.headless. 无法在 Lambda 中设置此选项.

通过 CLI 标志

在以下命令中之一中传递 --disable-headlessremotion compositions, remotion render, remotion still.

通过配置文件

使用 setChromiumHeadlessMode().

tsx
Config.setChromiumHeadlessMode(false);
tsx
Config.setChromiumHeadlessMode(false);
note

v3.3.39 之前,该选项称为 Config.Puppeteer.setChromiumHeadlessMode().

--gl

Changelog
  • From Remotion v2.6.7 until v3.0.7, the default for Remotion Lambda was swiftshader, but from v3.0.8 the default is swangle (Swiftshader on Angle) since Chrome 101 added support for it.
  • From Remotion v2.4.3 until v2.6.6, the default was angle, however it turns out to have a small memory leak that could crash long Remotion renders.

Select the OpenGL renderer backend for Chromium.
Accepted values:

  • "angle"
  • "egl"
  • "swiftshader"
  • "swangle"
  • "vulkan" (from Remotion v4.0.41)
  • "angle-egl" (from Remotion v4.0.51)

The default is null, letting Chrome decide, except on Lambda where the default is "swangle"

通过 Node.JS APIs

getCompositions(), renderStill(), renderMedia(), renderFrames(), getCompositionsOnLambda(), renderStillOnLambda()renderMediaOnLambda(), 您可以传递 chromiumOptions.gl.

通过 CLI 标志

在以下命令中之一中传递 --gl=swiftshaderremotion render, remotion compositions, remotion still, remotion lambda render, remotion lambda still, remotion lambda compositions.

通过配置文件

tsx
Config.setChromiumOpenGlRenderer('swiftshader');
tsx
Config.setChromiumOpenGlRenderer('swiftshader');
note

v3.3.39 之前,该选项称为 Config.Puppeteer.setChromiumOpenGlRenderer()

--user-agentv3.3.83

通过 Node.JS APIs

getCompositions(), renderStill(), renderMedia(), renderFrames(), getCompositionsOnLambda(), renderStillOnLambda()renderMediaOnLambda() 中,您可以传递 chromiumOptions.userAgent.

通过 CLI 标志

在以下命令中之一中传递 --user-agentremotion render, remotion compositions, remotion still, remotion lambda render, remotion lambda still, remotion lambda compositions.

需要更多标志吗?

打开一个 GitHub issue 来请求它。