Skip to main content

Shared-memory capturev4.0.534

Traditionally, screenshots of webpages are captured using the Chrome DevTools Protocol, then encoded as either JPEG or PNG. Which one is used is determined by the Video Image Format option.

Encoding these images is pure overhead, since FFmpeg later decodes them back into bitmaps. JPEG compression can also reduce image quality.

From v4.0.534, Remotion uses a special build of Chromium 157.0.8080.0 to optimize rendering in some cases. Instead of compressing each image, the bitmap is shared directly with Remotion's FFmpeg binary, which encodes it into a video.

When it is used​

Shared-memory capture is enabled automatically when all of these conditions are met:

  • You use Remotion v4.0.534 or later on one of the supported platforms below.
  • You are rendering a video. GIFs, audio-only renders, stills and image sequences are excluded.
  • Parallel encoding is enabled: frames are rendered and encoded at the same time. This is the default for video renders.
PlatformRequirements
macOSApple Silicon Mac with macOS 15 or later
Linuxx64 or ARM64 with glibc 2.35 or later, such as Ubuntu 22.04 or Debian 12 and newer
Amazon LinuxAmazon Linux 2023, x64 or ARM64
Remotion Lambda / Cloud RunDeploy a new function or service using Remotion v4.0.534 or later

These requirements assume you use Remotion's default browser. On Windows, Intel Macs and older Linux systems, Remotion uses regular JPEG or PNG screenshots. Selecting Chrome for Testing also uses regular screenshots.

The patch does not apply to previews or client-side rendering.

Image format and quality​

When shared-memory capture is active, the imageFormat and jpegQuality options have no effect. Frames are passed to FFmpeg as uncompressed bitmaps.

The output pixel format determines the background:

  • "yuva420p" and "yuva444p10le" preserve transparency automatically. Follow the transparent video guide to choose a codec that supports your pixel format.
  • Other pixel formats composite transparent areas against black.

When Remotion falls back to screenshots, the image format and JPEG quality options work as before. Transparent output requires PNG screenshots.

In the Studio render dialog, the Picture tab hides Image Format and JPEG Quality when shared-memory capture is available. Choose a pixel format with alpha support in the Encoding tab to export a transparent video.

Shared-memory capture avoids the extra JPEG compression step. The final video is still compressed according to your codec and quality settings. Overall render speed depends on your composition, encoder and machine.

Check whether it is active​

Render with verbose logging:

Check capture mode
npx remotion render MyComp --log=verbose

A log message beginning with Remotion shared-memory capture uses confirms that the patch is active. Parallel encoding can also work with regular screenshots, so the parallel encoding message alone does not confirm shared-memory capture.

With renderMedia(), set logLevel: "verbose" to see the same information.

Opt out​

Set disableSharedMemoryCapture to use regular JPEG or PNG screenshots while keeping parallel encoding enabled:

Render without shared-memory capture
npx remotion render MyComp --disable-shared-memory-capture

With renderMedia(), set disableSharedMemoryCapture: true. The same option is available in renderMediaOnLambda(), renderMediaOnCloudrun() and renderMediaOnVercel().

For CLI and Studio renders, you can also use Config.setDisableSharedMemoryCapture():

remotion.config.ts
import {Config} from '@remotion/cli/config'; Config.setDisableSharedMemoryCapture(true);

The default is false. When you opt out, the image format and JPEG quality options apply to the screenshots again. For Lambda and Cloud Run CLI renders, pass --disable-shared-memory-capture to the render command.

Disabling parallel encoding also disables shared-memory capture and makes frame rendering and encoding happen in separate stages. This can reduce peak memory usage but may make rendering slower.

See also​