Back to Remotion

--gl flag

packages/docs/docs/open-gl.mdx

4.0.4622.8 KB
Original Source

When rendering a video in Remotion, different GL renderer backends can be selected.

The following renderer backends are supported in Remotion:

  • <code>null</code> - default, lets Chrome decide
  • <code>angle</code>
  • <code>egl</code>
  • <code>swiftshader</code>
  • <code>vulkan</code> (from Remotion v4.0.41)
  • <code>angle-egl</code> (from Remotion v4.0.52)
  • <code>swangle</code> - default on Lambda

<Step>1</Step> If you use WebGL/Three.js:

  • On a desktop, angle is recommended
  • On a cloud instance with a GPU, angle-egl is recommended
  • On Lambda, use swangle (default on Lambda)
  • On a machine with no GPU, swangle is recommended. Rendering might be slow.

<Step>2</Step> If you don't use WebGL/Three.js, the default renderer (<code>null</code> on local, <code>swangle</code> on Lambda) are the best choice.

Using the GPU

In cases where a GPU could be beneficial for rendering, it can often make sense to use the <code>angle</code> renderer (<code>angle-egl</code> on Linux). An in-depth explanation when and how to use it is given in this article.

⚠️ Memory leaks are a known problem with <code>angle</code>. We recommend to split up long renders into multiple parts when rendering large videos, since sometimes renders can fail due to memory leaks.

Currently, GitHub Actions will fail when using <code>angle</code>, since Actions runners don't have a GPU.

Selecting the renderer backend

The renderer backend can be set in different ways:

Via Node.JS APIs

In getCompositions(), renderStill(), renderMedia(), renderFrames(), getCompositionsOnLambda(), renderStillOnLambda() and renderMediaOnLambda(), you can pass chromiumOptions.gl.

Via Config file

tsx
import { Config } from "@remotion/cli/config";

// ---cut---

Config.setChromiumOpenGlRenderer("angle");

:::note The config file only applies to CLI commands. :::

:::note Prior to v3.3.39, the option was called Config.Puppeteer.setChromiumOpenGlRenderer(). :::

Via CLI flag

Pass --gl=[angle,swangle,...] in one of the following commands: remotion render, remotion compositions, remotion still, remotion lambda render, remotion lambda still, remotion lambda compositions.

See also