Skip to main content

--gl flag

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

The following renderer backends are supported in Remotion:

  • null - default
  • angle
  • egl
  • swiftshader
  • swangle - default on Lambda

Using the GPU

In cases where a GPU could be beneficial for rendering, it can often make sense to use the angle renderer. An in-depth explanation when and how to use it is given in this article.

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

It's also worth mentioning, that currently GitHub Actions will fail when using angle, since actions don't have a GPU.

The angle alternative if there is no GPU available

If you are rendering in an environment which has no GPU, the angle renderer can't be used and swangle should be utilized instead.

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
Config.setChromiumOpenGlRenderer("angle");
tsx
Config.setChromiumOpenGlRenderer("angle");
note

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

Via CLI flag

Pass --gl=swiftshader in one of the following commands: remotion render, remotion compositions, remotion still, remotion lambda render, remotion lambda still, remotion lambda compositions.

note

If a CLI flag gets passed, the settings defined in the remotion.config.ts will be overwritten.

Generaly speaking, in most cases the default renderer (null on local, swangle on Lambda) are the best choice.

If you use ThreeJS, angle (swangle on Lambda) has to be used.

Based on our research online, it seems that swiftshader is an old mode and swangle is the successor.
Therefore, if you thought about using swiftshader, we recommend to use the swangle instead.

See also