Skip to main content

In-memory cache for @remotion/media

@remotion/media keeps a cache of recently decoded video and audio frames.

Mechanism

Video streams consist of key frames and delta frames.
In order to decode a delta frame, the last keyframe and all the delta frames since the last keyframe also need to be decoded.

Due to Remotion's multithreaded rendering and each frame being independent, it is not guaranteed that video frames are needed in their natural order.

The cache is shared across all of the instances of <Video> and <Audio>.
Therefore, the settings for the cache are per-render, not per tag.

Default cache size

By default, the cache may grow to up to 50% of the available system memory.

Customizing the cache size

The rendering APIs allow you to customize this limit on a per-render basis: