🎥 Make videos programmatically with React
update docs
Jonny Burgerd4f950f5a16f
diff --git a/packages/docs/docs/compare.mdx b/packages/docs/docs/compare.mdxindex 043490d1f2..060a85b982 100644--- a/packages/docs/docs/compare.mdx+++ b/packages/docs/docs/compare.mdx@@ -3,12 +3,13 @@ image: /generated/articles-docs-compare.pngid: compare-ssrtitle: Comparison of server-side rendering optionssidebar_label: Comparison of SSR options-crumb: "Compare"+crumb: 'Compare'----This page compares 3 options for rendering videos in the cloud:+This page compares 4 options for rendering videos in the cloud:- [Remotion Lambda](/docs/lambda)+- [Vercel Sandbox](/docs/vercel-sandbox)- [Cloud Run](/docs/cloudrun)- [Node.JS/Bun APIs](/docs/renderer)@@ -16,35 +17,43 @@ These options are deliberately distinct with different tradeoffs, so that you ca## Overall recommendation-We recommend Remotion Lambda for most people as it has the best tradeoff for speed, ease of setup, maturity, total cost and scalability.+We recommend Remotion Lambda for most people as it has the best tradeoff for speed, ease of setup, maturity, total cost and scalability.++If you are already a Vercel customer and want the simplest setup, [Vercel Sandbox](/docs/vercel-sandbox) is a great choice.The Remotion customers with the highest amount of videos rendered use the Remotion Lambda solution.## Speed-Remotion Lambda is the fastest option, because it implements distributed rendering - the video gets divided into smaller chunks and rendered in parallel across multiple Lambda functions.+Remotion Lambda is the fastest option, because it implements distributed rendering - the video gets divided into smaller chunks and rendered in parallel across multiple Lambda functions.++Vercel Sandbox, Cloud Run, and custom servers do not support distributed rendering, so rendering happens on one physical machine.-Cloud Run does not support distributed rendering, so rendering happens on one physical machine.+Vercel Sandbox currently has longer cold starts due to VM provisioning, installing system dependencies and downloading a browser on each render. We plan to improve this with Vercel Sandbox snapshots.Implementing a custom distributed rendering solution from scratch is challenging and we do not yet provide documentation.## Cost-Compute on Remotion Lambda is more expensive than other options.-However, costs are only incurred when you actually render videos.+Compute on Remotion Lambda is more expensive than other options.+However, costs are only incurred when you actually render videos.Depending on the amount of videos you render, the total cost might be lower or higher with Lambda.-Cloud Run is cheaper than Lambda because there is no distributed rendering and no overhead that comes with it.+Vercel Sandbox pricing is based on usage. You only pay for the time the VM is running. See [Vercel Sandbox pricing](https://vercel.com/docs/vercel-sandbox/pricing) for details.++Cloud Run is cheaper than Lambda because there is no distributed rendering and no overhead that comes with it.You also don't pay for the time that the Cloud Run instance is idle.-Running a server has by far the cheapest compute cost.+Running a server has by far the cheapest compute cost.However, you also pay for the time that the server is idle.Conclusion: The more videos you render, the more a long-running server might be worth for you.## Ease of setup-Remotion Lambda and Cloud Run are fast to set up.+Vercel Sandbox is the easiest to set up. You only need a Vercel account and a Blob store. Push to deploy.++Remotion Lambda and Cloud Run are also fast to set up.Remotion Lambda is built into our SaaS templates, so you can get started very quickly.Using the Node.JS APIs requires you to set up a server yourself and manage certain things yourself:@@ -69,7 +78,7 @@ Remotion Lambda currently has the following features that Cloud Run does not hav- Renders with expiration date- Rendering from PHP, Go and Python-Rendering with the Node.JS APIs does not come with these features either, but you may build them based on top of the low-level APIs that are provided.+Rendering with Vercel Sandbox or the Node.JS APIs does not come with these features either, but you may build them based on top of the low-level APIs that are provided.## GPU@@ -77,22 +86,18 @@ Most renders do not become faster with GPU acceleration. See: [Which content benWe have guides for configuring [a server with GPU acceleration](/docs/miscellaneous/cloud-gpu), but it is not yet supported by Remotion.-Remotion Lambda does not have a GPU. You are limited to CPU-only rendering.+Remotion Lambda and Vercel Sandbox do not have GPUs. You are limited to CPU-only rendering.We have not tested Cloud Run with GPU acceleration. It is possible add a GPU to the Cloud Run instance - we are curious to hear your feedback.## Stability-We are happy with the architecture of Remotion Lambda and Node.js APIs and are committed to it in the long-term.+We are happy with the architecture of Remotion Lambda and Node.js APIs and are committed to it in the long-term.-Cloud Run is in Alpha and we are considering moving it to a model which re-uses the code of Remotion Lambda.-This would allow us to better match the features of Remotion Lambda and enable distributed rendering.+Vercel Sandbox support is new. We are actively improving it with planned features like snapshots for faster cold starts and custom Chrome builds for better codec support.-Currently, the development of Cloud Run is hindered because a new Docker image needs to be built for each change, making testing slow.-Therefore, we are currently only making essential changes to the current Cloud Run product.--## Conclusion+Cloud Run is in Alpha and we are considering moving it to a model which re-uses the code of Remotion Lambda.+This would allow us to better match the features of Remotion Lambda and enable distributed rendering.-We recommend to start with Remotion Lambda, as it is the quickest way to get started and leaves less room for error.--As you scale up and increase the sophistication of Remotion renders and want to become more cost-efficient, we recommend looking into other options as well.+Currently, the development of Cloud Run is hindered because a new Docker image needs to be built for each change, making testing slow.+Therefore, we are currently only making essential changes to the current Cloud Run product.diff --git a/packages/docs/docs/miscellaneous/vercel.mdx b/packages/docs/docs/miscellaneous/vercel.mdxindex 4aa0e87cd3..342a956c2d 100644--- a/packages/docs/docs/miscellaneous/vercel.mdx+++ b/packages/docs/docs/miscellaneous/vercel.mdx@@ -31,45 +31,7 @@ This will make it possible to render videos client-side on your Vercel deploymenVercel Sandbox allows you to render videos on-demand without managing Lambda or AWS infrastructure. Each render spawns an ephemeral Linux VM with full access to the Remotion renderer.-### How it works--1. User triggers a render from your application-2. A Vercel Sandbox VM is spawned with Node.js-3. The VM runs `renderMedia()` pointing to your deployed bundle-4. Progress is streamed to the client via Server-Sent Events-5. Completed video is uploaded to Vercel Blob storage-6. Client receives the video URL--### Getting Started--Use the Vercel template:--```bash-npx create-video@latest --template vercel-```--### Required Setup--1. **Deploy your Remotion bundle:**-- ```bash- npx remotion bundle- cd build && vercel deploy- ```--2. **Create a Vercel Blob store** in your Vercel dashboard under Storage--3. **Set environment variables:**- - `BLOB_READ_WRITE_TOKEN`: Token from your Vercel Blob store (auto-injected when deployed to same project)--### Limitations--- **Longer cold starts**: Sandbox VMs take a few seconds to start (mitigated with snapshots)-- **Single machine**: No distributed rendering (unlike Lambda)-- **Timeout limits**: 45 min (Hobby), 5 hours (Pro & Enterprise)-- **Concurrency limits**: 10 (Hobby), 2000 (Pro & Enterprise)--See the [template source code](https://github.com/remotion-dev/remotion/tree/main/packages/template-vercel) for implementation details.+See the dedicated [Vercel Sandbox](/docs/vercel-sandbox) page for full documentation.## Triggering Lambda renders from Vercel Serverless functionsdiff --git a/packages/docs/docs/ssr.mdx b/packages/docs/docs/ssr.mdxindex a1b9f2f387..fe3e5ead49 100644--- a/packages/docs/docs/ssr.mdx+++ b/packages/docs/docs/ssr.mdx@@ -10,9 +10,15 @@ import {TableOfContents} from './renderer/TableOfContents';Remotion's rendering engine is built with Node.JS, which makes it easy to render a video in the cloud.+See the [Comparison of SSR options](/docs/compare-ssr) to help you decide which option is best for you.+## Render a video on AWS Lambda-The easiest and fastest way to render videos in the cloud is to use [`@remotion/lambda`](/docs/lambda).+The fastest way to render videos in the cloud is to use [`@remotion/lambda`](/docs/lambda).++## Render using Vercel Sandbox++The easiest way, especially for Vercel customers is to use [Vercel Sandbox](/docs/vercel-sandbox).## Render a video using Node.js APIs@@ -78,14 +84,10 @@ jobs:path: out/video.mp4```-<Step>1</Step> Commit the template to a GitHub repository.-<br />-<Step>2</Step> On GitHub, click the <code>Actions</code> tab.-<br />-<Step>3</Step> Select the <code>Render video</code> workflow on the left.-<br />-<Step>4</Step> A <code>Run workflow</code> button should appear. Click it.-<br />+<Step>1</Step> Commit the template to a GitHub repository.+<Step>2</Step> On GitHub, click the <code>Actions</code> tab.+<Step>3</Step> Select the <code>Render video</code> workflow on the left.+<Step>4</Step> A <code>Run workflow</code> button should appear. Click it.<Step>5</Step> Fill in the props of the root component and click <code>Run workflow</code>.<br /><Step>6</Step> After the rendering is finished, you can download the video under <code>Artifacts</code>.<br />@@ -102,18 +104,6 @@ See: [Dockerizing a Remotion project](/docs/docker)Check out the experimental [Cloud Run](/docs/cloudrun) package.Note: It not actively being developed - our plan is to port the Lambda runtime to Cloud Run instead of maintaining a separate implementation.-## Render using Vercel Sandbox--You can render videos on-demand using [Vercel Sandbox](https://vercel.com/docs/sandbox). This spawns an ephemeral Linux VM that renders your video and stores it in Vercel Blob storage.--Use the Vercel template to get started:--```bash-npx create-video@latest --template vercel-```--See the [Vercel documentation](/docs/miscellaneous/vercel#rendering-with-vercel-sandbox) for detailed setup instructions.-## API reference<TableOfContents />diff --git a/packages/docs/docs/vercel-sandbox.mdx b/packages/docs/docs/vercel-sandbox.mdxnew file mode 100644index 0000000000..7c1eb9b901--- /dev/null+++ b/packages/docs/docs/vercel-sandbox.mdx@@ -0,0 +1,59 @@+---+image: /generated/articles-docs-vercel-sandbox.png+sidebar_label: Vercel Sandbox+title: Rendering with Vercel Sandbox+crumb: 'Server-side rendering'+---++Vercel Sandbox allows you to render videos on-demand without managing Lambda or AWS infrastructure.+Each render spawns an ephemeral Linux VM with full access to the Remotion renderer.++As a reference implementation, we have created a template: [Next.js Sandbox Template](https://remotion.dev/templates/vercel).++## Getting Started++Use the Vercel template:++```bash+npx create-video@latest --template vercel+```++Push it to Vercel.++Then, in your Vercel dashboard, under "Storage", create a new Blob store and connect it to the project.+Redeploy for the changes to take effect.++## Advantages++This is the easiest way to setup Remotion server-side rendering. You only need one Vercel account and connect a blob storage - then you just push to deploy.++Vercel has higher limits than Lambda by default, so you can render more videos at once than with a fresh AWS account.++Allowing for 2000 concurrent sandboxes on the Pro Plan allows for massive scale.++## Limitations++Rendering happens on a single machine rather than a distributed system, so it is slower than Lambda.++Spawning a new VM for each render has a setup phase which includes installing dependencies and downloading a browser.+We plan to soon improve this by using Vercel Sandbox snapshots.++Currently, the browser downloaded does not have support for decoding H.264, meaning that using [`@remotion/media`](/docs/media) will often fallback to [`<OffthreadVideo>`](/docs/offthreadvideo).+We also plan to resolve this by using a custom build of Chrome soon.++## Limits++The timeout limit for Vercel Sandbox is 45 minutes on the Hobby plan, and 5 hours on the Pro and Enterprise plans.+For concurrency, the limit is 10 simultaneous renders on Hobby, and 2000 on Pro and Enterprise.++For more details, see: [Vercel Sandbox pricing](https://vercel.com/docs/vercel-sandbox/pricing)++## Source Code++See the [template source code](https://github.com/remotion-dev/remotion/tree/main/packages/template-vercel) for implementation details.++## See also++- [Deploying Remotion on Vercel](/docs/miscellaneous/vercel)+- [Server-side rendering](/docs/ssr)+- [Lambda](/docs/lambda)diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.tsindex 86bafc46d1..ca920e1aa1 100644--- a/packages/docs/sidebars.ts+++ b/packages/docs/sidebars.ts@@ -985,6 +985,7 @@ const sidebars: SidebarsConfig = {'miscellaneous/cloud-gpu-docker','compare-ssr','distributed-rendering',+ 'vercel-sandbox','cloudflare-containers','azure-container-apps',],