Skip to main content

Can I render videos on the edge?

Edge runtimes such as Vercel Edge functions and Cloudflare Workers promise to change how we compute in the future.

Unfortunately, it is not possible to render Remotion videos on the “edge” and will most likely not be possible in the foreseeable future due to very heavy constraints being placed in edge functions.

The following constraints currently make it impossible to render videos on the edge:

  • Lack of filesystem APIs: The fs module is not available on the edge.
  • Limited execution duration: On Vercel, an edge function must respond within 30 seconds, on Cloudflare Workers, a function may only run for 10ms.
  • Code size limit: On Vercel, the maximum function size in 4MB, on Cloudflare Workers it is 5MB. Remotion currently needs ~150MB of space due to Chrome and FFmpeg being dependencies.
  • Memory limit: Vercel Edge Functions only have 128MB of RAM available. Remotion currently works best with 2GB+ of RAM.