Can I render videos using Vercel Serverless functions?
It is currently not possible to render videos or stills on Vercel Serverless functions due to the 50MB maximum function size. Since Chromium is a dependency of Remotion, it alone almost entirely fills the quota available.
However, you can trigger a Remotion Lambda render through a Vercel Serverless function – our preferred choice for building applications. See our Next template or GitHub Unwrapped project for an example of how to do so.
Can I render videos in Next.js?
If you don't deploy to Vercel, it might be possible to render videos in API routes using the server-side rendering primitives.
Check if your provider has enough disk space for Chromium and Remotion and has sufficient CPU and RAM to render videos. See this page for more details.
Recommendation:
If you plan to deploy to Vercel, we recommend to trigger Remotion Lambda renders from Vercel Serverless functions. See our Next template or GitHub Unwrapped 2022 project for an example of how to do so.
If you plan to deploy to a server, see here.