Skip to content

🎥 Make videos programmatically with React

Docs: Add Editor Starter client-side rendering guide (#9789)

Jonny Burgerd04d729dc3ce
diff --git a/packages/docs/docs/editor-starter/TableOfContents.tsx b/packages/docs/docs/editor-starter/TableOfContents.tsx
index 8539c8d98e..5f4a7fb6c1 100644
--- a/packages/docs/docs/editor-starter/TableOfContents.tsx
+++ b/packages/docs/docs/editor-starter/TableOfContents.tsx
@@ -71,8 +71,12 @@ export const TableOfContents: React.FC = () => {
<div>How to setup captions and how they work</div>
</TOCItem>
<TOCItem link="/docs/editor-starter/rendering">
- <strong>Rendering</strong>
- <div>How to setup exports and how they work</div>
+ <strong>Lambda Rendering</strong>
+ <div>How to set up Lambda renders and how they work</div>
+ </TOCItem>
+ <TOCItem link="/docs/editor-starter/client-side-rendering">
+ <strong>Client-side Rendering</strong>
+ <div>How to render videos in the browser</div>
</TOCItem>
<TOCItem link="/docs/editor-starter/backend-routes">
<strong>Backend Routes</strong>
diff --git a/packages/docs/docs/editor-starter/asset-uploads.mdx b/packages/docs/docs/editor-starter/asset-uploads.mdx
index 403c2c5852..465712f8c3 100644
--- a/packages/docs/docs/editor-starter/asset-uploads.mdx
+++ b/packages/docs/docs/editor-starter/asset-uploads.mdx
@@ -6,7 +6,7 @@ id: asset-uploads
crumb: Editor Starter
---
-If the user drops in any image, audio, video or GIF, they are uploaded to cloud storage so that rendering in the cloud can be performed later.
+If the user drops in any image, audio, video or GIF, they are uploaded to cloud storage so that they remain accessible during editing and rendering.
By default, S3 is used for cloud storage, which requires some setup.
## Setup
@@ -30,9 +30,8 @@ By default, S3 is used for cloud storage, which requires some setup.
```
- Go to [IAM -> "Users"](https://us-east-1.console.aws.amazon.com/iam/home?region=us-east-1#/users) in the AWS console.
- - **If you have already [setup rendering](/docs/editor-starter/rendering)**: Select the user you created.
+ - **If you have already set up [Lambda rendering](/docs/editor-starter/rendering)**: Select the user you created.
- **If you have not:** Create a new user with all settings left as default.
-- Create a new user with all settings left as default.
- Click "Add permissions -> Add inline policy" and add the following policy:
```json
@@ -71,7 +70,7 @@ Rename the `.env.example` file to `.env` to get a template.
:::
:::note
-The same environment variables are also used for [rendering](/docs/editor-starter/rendering) in the cloud.
+The same environment variables are also used for [Lambda rendering](/docs/editor-starter/rendering).
:::
Now, restart the Editor Starter.
diff --git a/packages/docs/docs/editor-starter/backend-routes.mdx b/packages/docs/docs/editor-starter/backend-routes.mdx
index 8c16e9ee46..b90a5b7f38 100644
--- a/packages/docs/docs/editor-starter/backend-routes.mdx
+++ b/packages/docs/docs/editor-starter/backend-routes.mdx
@@ -6,7 +6,7 @@ id: backend-routes
crumb: Editor Starter
---
-Some backend endpoints must be implemented by for all features to work.
+Some Editor Starter features require backend endpoints.
The default implementation uses the React Router 7 framework.
### `POST /api/captions`
@@ -17,7 +17,7 @@ Used to generate captions for a video based on an audio file.
- [Implementation using Next.js](https://gist.github.com/MehmetAdemi/545f0fcdf2f8b8f9edbbc5146bde0a74)
- [See usages](https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20%2Fapi%2Fcaptions&type=code)
-### `GET /api/font/:name`
+### `GET /api/fonts/:name`
Returns the metadata for a specific font, such as available weights and styles and their corresponding Google Fonts URLs.
This information is provided by the backend because the metadata of all default fonts would be more than 10MB.
@@ -36,7 +36,7 @@ Needed to create a presigned URL for uploading a file to S3.
### `POST /api/render`
-Triggers a render on Remotion Lambda.
+Triggers a render on Remotion Lambda. This route is only used when rendering with Remotion Lambda.
- [Reference implementation using React Router 7](https://github.com/remotion-dev/editor-starter/blob/main/src/routes/api/render.ts)
- [Implementation using Next.js](https://gist.github.com/MehmetAdemi/a96784de92ee91e4907bdedb20e6b90c)
@@ -44,7 +44,7 @@ Triggers a render on Remotion Lambda.
### `POST /api/progress`
-Gets the current progress of a render on Remotion Lambda.
+Gets the current progress of a render on Remotion Lambda. This route is only used when rendering with Remotion Lambda.
- [Reference implementation using React Router 7](https://github.com/remotion-dev/editor-starter/blob/main/src/routes/api/progress.ts)
- [Implementation using Next.js](https://gist.github.com/MehmetAdemi/15c21e1b847e5e79e7df7b2c4d5dc494)
diff --git a/packages/docs/docs/editor-starter/client-side-rendering.mdx b/packages/docs/docs/editor-starter/client-side-rendering.mdx
new file mode 100644
index 0000000000..cb34238b2a
--- /dev/null
+++ b/packages/docs/docs/editor-starter/client-side-rendering.mdx
@@ -0,0 +1,57 @@
+---
+image: /generated/articles-docs-editor-starter-client-side-rendering.png
+title: Client-side rendering in the Editor Starter
+sidebar_label: Client-side rendering
+id: client-side-rendering
+crumb: Editor Starter
+---
+
+The Editor Starter can render videos in the browser using [`@remotion/web-renderer`](/docs/web-renderer).
+
+## Enable client-side rendering
+
+This feature is disabled by default.
+Set [`ENABLE_CLIENT_SIDE_RENDERING`](https://github.com/remotion-dev/editor-starter/blob/main/src/editor/flags.ts) to `true`:
+
+```ts title="src/editor/flags.ts"
+export const ENABLE_CLIENT_SIDE_RENDERING = true;
+```
+
+`FEATURE_NEW_MEDIA_TAGS` must also be enabled (which it is by default).
+
+You do not need to configure the `REMOTION_AWS_*` environment variables or run `deploy.ts` for rendering.
+
+:::note
+Other Editor Starter features may still need backend routes or AWS credentials. For example, text rendering loads font metadata from [`/api/fonts/:name`](/docs/editor-starter/backend-routes#get-apifontsname), [asset uploads](/docs/editor-starter/asset-uploads) use Amazon S3, and [captioning](/docs/editor-starter/captioning) uses a backend route.
+:::
+
+## How it works
+
+When the user clicks **Render**, the Editor Starter:
+
+1. Collects the current tracks, items, assets, composition settings, and font metadata.
+2. Passes the composition directly to [`renderMediaOnWeb()`](/docs/web-renderer/render-media-on-web).
+3. Encodes the video in the browser using WebCodecs.
+4. Creates a temporary blob URL and shows the completed render in the task indicator, where it can be downloaded.
+
+## Unused Lambda routes
+
+The [`/api/render`](/docs/editor-starter/backend-routes#post-apirender) and [`/api/progress`](/docs/editor-starter/backend-routes#post-apiprogress) routes are not used for client-side rendering.
+However, by default, assets still upload to S3.
+
+## Main tradeoffs
+
+- The user can leave the page when rendering on Lambda, but not with client-side rendering.
+- Client-side rendering avoids Lambda compute costs. Remotion licensing, S3 asset storage, and bandwidth costs may still apply.
+- The browser must support WebCodecs, and the composition must work within the [limitations of client-side rendering](/docs/client-side-rendering/limitations).
+- Client-side rendering [may make the page less responsive](/docs/client-side-rendering/page-responsiveness).
+- Lambda is generally better suited to long or distributed renders.
+- More codecs are supported on Lambda, such as ProRes.
+- Client-side rendering creates a temporary blob URL. Unlike Lambda output in S3, it is not persisted automatically.
+
+## See also
+
+- [Rendering with Remotion Lambda in the Editor Starter](/docs/editor-starter/rendering)
+- [Client-side rendering](/docs/client-side-rendering)
+- [How client-side rendering works](/docs/client-side-rendering/how-it-works)
+- [Limitations of client-side rendering](/docs/client-side-rendering/limitations)
diff --git a/packages/docs/docs/editor-starter/dependencies.mdx b/packages/docs/docs/editor-starter/dependencies.mdx
index 702a6f01e7..11aa020d39 100644
--- a/packages/docs/docs/editor-starter/dependencies.mdx
+++ b/packages/docs/docs/editor-starter/dependencies.mdx
@@ -21,8 +21,9 @@ This means that in order for asset uploads to work, an AWS account is required a
## Rendering
-[Remotion Lambda](https://www.remotion.dev/docs/lambda) is used for rendering.
-This means that in order for rendering to work, an AWS account is required and AWS Lambda needs to be set up.
+[Remotion Lambda](/docs/editor-starter/rendering) is used for rendering by default. This requires an AWS account and AWS Lambda setup.
+
+Alternatively, you can enable [client-side rendering](/docs/editor-starter/client-side-rendering), which does not require AWS Lambda.
## Google Fonts
diff --git a/packages/docs/docs/editor-starter/faq.mdx b/packages/docs/docs/editor-starter/faq.mdx
index 3b3e16a8d5..e133cb23e2 100644
--- a/packages/docs/docs/editor-starter/faq.mdx
+++ b/packages/docs/docs/editor-starter/faq.mdx
@@ -85,15 +85,15 @@ Buy from the same email address and then contact us at [[email protected]](mailto:
## Does this use client-side rendering / WebCodecs?
-No, the rendering happens using [Remotion Lambda](/docs/editor-starter/rendering).
+The Editor Starter supports [client-side rendering using WebCodecs](/docs/editor-starter/client-side-rendering), but it is disabled by default.
-That being said, the goal is to create the video using [client-side rendering](/docs/client-side-rendering) in the future.
-There is no timeline available for this yet - only buy the Editor Starter if you are satisfied with the current state.
+By default, rendering happens using [Remotion Lambda](/docs/editor-starter/rendering).
## Do I have to use Remotion Lambda?
-The default template can be deployed in a fully serverless fashion.
-If you want to render on a long-running server, you can modify the architecture to use the Remotion [Server-side rendering](/docs/ssr) APIs:
+No. You can [enable client-side rendering](/docs/editor-starter/client-side-rendering) to render on the user's device.
+
+You can also modify the architecture to render on a long-running server using the Remotion [server-side rendering](/docs/ssr) APIs:
- Copy the [frontend code](/docs/editor-starter/setup) into your existing project
- For the [backend routes](/docs/editor-starter/backend-routes), implement them in your long-running server. For how to implement the rendering endpoints, you can take the [Render Server](/templates/render-server) as a reference.
@@ -101,7 +101,7 @@ If you want to render on a long-running server, you can modify the architecture
## Can I export the videos generated with the Editor Starter as Remotion compositions?
The Editor Starter previews and renders it's videos using the regular Remotion APIs.
-The state is stored as a JSON and being fed as [input props](/docs/terminology/input-props) to the [`<Player />`](/docs/player) and [`renderMediaOnLambda()`](/docs/lambda/rendermediaonlambda).
+The state is stored as JSON and fed as [input props](/docs/terminology/input-props) to the [`<Player />`](/docs/player) and either [`renderMediaOnLambda()`](/docs/lambda/rendermediaonlambda) or [`renderMediaOnWeb()`](/docs/web-renderer/render-media-on-web).
So yes, the Editor Starter produces just Remotion compositions and they can also be rendered if they are decoupled from the editor user interface.
However, it is important to understand that the Editor Starter applies an abstraction on top of Remotion where the whole state is expressed as JSON, which then maps to code.
diff --git a/packages/docs/docs/editor-starter/features-not-included.mdx b/packages/docs/docs/editor-starter/features-not-included.mdx
index c15d180e96..11531c0892 100644
--- a/packages/docs/docs/editor-starter/features-not-included.mdx
+++ b/packages/docs/docs/editor-starter/features-not-included.mdx
@@ -71,7 +71,7 @@ For example, each item has a `from` and `durationInFrames` property which is exp
There is no login, authentication, authorization or user management included in the Editor Starter.
We foresee that you mount the `<Editor />` component in a page that is shown only if the user is logged in if you desire to have a login flow.
-Make sure to add adequate protection to the asset uploading, captioning and rendering endpoints that come with the template, as we have not added any protection to them.
+Make sure to protect the backend endpoints you enable. The template does not add authentication or rate limits to asset uploading, captioning, or Lambda rendering endpoints.
## Arbitrary fonts
diff --git a/packages/docs/docs/editor-starter/features.mdx b/packages/docs/docs/editor-starter/features.mdx
index 429dbf5c11..fea64c3209 100644
--- a/packages/docs/docs/editor-starter/features.mdx
+++ b/packages/docs/docs/editor-starter/features.mdx
@@ -630,7 +630,14 @@ See: [Captioning](/docs/editor-starter/captioning)
Feature flag: [`FEATURE_RENDERING`](https://github.com/search?q=repo%3Aremotion-dev%2Feditor-starter%20FEATURE_RENDERING&type=code)
-Enables UI for [rendering](/docs/editor-starter/rendering) the current composition to a video file. Shows render progress and allows download of the final rendered video.
+Enables UI for rendering the current composition using [Remotion Lambda](/docs/editor-starter/rendering) or [client-side rendering](/docs/editor-starter/client-side-rendering). Shows render progress and allows download of the final rendered video.
+
+### Client-side rendering
+
+Feature flag: [`ENABLE_CLIENT_SIDE_RENDERING`](https://github.com/remotion-dev/editor-starter/blob/main/src/editor/flags.ts)
+
+Renders videos in the browser instead of using Remotion Lambda.
+Requires `FEATURE_NEW_MEDIA_TAGS` to also be enabled.
### Codec selector
diff --git a/packages/docs/docs/editor-starter/fonts.mdx b/packages/docs/docs/editor-starter/fonts.mdx
index 3d306e31f3..3e3e2d900a 100644
--- a/packages/docs/docs/editor-starter/fonts.mdx
+++ b/packages/docs/docs/editor-starter/fonts.mdx
@@ -48,7 +48,7 @@ Every font has metadata which includes the available font family, font style, fo
Storing all of this metadata on the client for all of the 250 default fonts would already result in a bundle size increase of 10MB.
-Because of this, font metadata is being stored in the backend and only the metadata of the fonts that are required are loaded to the client. This is the reason for the [`GET /api/font/:name`](/docs/editor-starter/backend-routes#get-apifontname) endpoint.
+Because of this, font metadata is being stored in the backend and only the metadata of the fonts that are required are loaded to the client. This is the reason for the [`GET /api/fonts/:name`](/docs/editor-starter/backend-routes#get-apifontsname) endpoint.
## Previews in the font dropdown
diff --git a/packages/docs/docs/editor-starter/production-checklist.mdx b/packages/docs/docs/editor-starter/production-checklist.mdx
index dd93de45fa..3a388d7da9 100644
--- a/packages/docs/docs/editor-starter/production-checklist.mdx
+++ b/packages/docs/docs/editor-starter/production-checklist.mdx
@@ -11,17 +11,32 @@ Before shipping your project to production, here are some things you should chec
## Protected endpoints
-The [backend routes](/docs/editor-starter/backend-routes) for assets, captions and rendering are not protected by any authentication or rate limit in our template.
-Did you implement the necessary protections to prevent abuse?
+The [backend routes](/docs/editor-starter/backend-routes) are not protected by authentication or rate limits in the template.
+Did you protect the routes you enabled, including the Lambda rendering routes if you use them?
## Asset cleanup
By default, deleted assets are not automatically cleaned up.
Have you implemented [asset cleanup](/docs/editor-starter/asset-cleanup)?
-## Lambda checklist
+## Remotion Lambda
-There is a separate [Lambda checklist](/docs/lambda/checklist) for the Remotion Lambda integration.
+If you use Remotion Lambda, complete the [Lambda checklist](/docs/lambda/checklist).
+
+By default, the AWS infrastructure is updated whenever you deploy the app.
+[Make production deployments more robust by separating them from development deployments](/docs/editor-starter/rendering#auto-deployment-of-aws-infrastructure).
+
+## Client-side rendering
+
+If you use [client-side rendering](/docs/editor-starter/client-side-rendering), verify that:
+
+- Your supported browsers provide WebCodecs and meet the [browser requirements](/docs/client-side-rendering#browser-support).
+- Your compositions work within the [limitations of client-side rendering](/docs/client-side-rendering/limitations).
+- The user keeps the page open until the render finishes.
+- A temporary downloadable result is sufficient, or you persist the output separately.
+- The chosen [page responsiveness](/docs/client-side-rendering/page-responsiveness) behavior suits your app.
+
+Client-side rendering does not remove the default S3 asset workflow. Assets are still uploaded to S3, so the asset cleanup guidance above still applies.
## Features not included
@@ -31,11 +46,6 @@ Did you check the [features not included](/docs/editor-starter/features-not-incl
Did you check the [features](/docs/editor-starter/features) to see if there are any features you are shipping you didn't know about? Disable them if you don't need them.
-## AWS auto-deployment
-
-Be aware that whenever you deploy, the AWS infrastructure is also updated.
-[Make it more robust by separating production deployments from development deployments](/docs/editor-starter/rendering#auto-deployment-of-aws-infrastructure).
-
## Limits
Did you know that by default, there is a limit on the size of [the files that can be uploaded](/docs/editor-starter/asset-uploads#limits) and [the duration of the videos that can be captioned](/docs/editor-starter/captioning#limits)?
diff --git a/packages/docs/docs/editor-starter/rendering.mdx b/packages/docs/docs/editor-starter/rendering.mdx
index ef0f449427..1165c22350 100644
--- a/packages/docs/docs/editor-starter/rendering.mdx
+++ b/packages/docs/docs/editor-starter/rendering.mdx
@@ -1,12 +1,14 @@
---
image: /generated/articles-docs-editor-starter-rendering.png
-title: Rendering in the Editor Starter
-sidebar_label: Rendering
+title: Rendering with Remotion Lambda in the Editor Starter
+sidebar_label: Lambda rendering
id: rendering
crumb: Editor Starter
---
-Rendering videos to MP4 works using [Remotion Lambda](/docs/lambda), a distributed renderer on AWS Lambda.
+By default, videos are rendered using [Remotion Lambda](/docs/lambda), a distributed renderer on AWS Lambda.
+
+You can instead enable [client-side rendering](/docs/editor-starter/client-side-rendering) to render videos in the user's browser without Remotion Lambda.
## Setup
@@ -70,7 +72,7 @@ export const SITE_NAME = process.env.VERCEL_ENV === 'production' ? 'remotion-edi
## Rendering
-Is very simple: When no item is selected in the Editor Starter, a Render button shows up in the [inspector](/docs/editor-starter/tracks-items-assets#inspectors) (i.e., composition inspector).
+When no item is selected in the Editor Starter, a Render button shows up in the [inspector](/docs/editor-starter/tracks-items-assets#inspectors) (i.e., composition inspector).
The backend endpoint [`/api/render`](/docs/editor-starter/backend-routes#post-apirender) is invoked to trigger a render.
Once triggered, [`/api/progress`](/docs/editor-starter/backend-routes#post-apiprogress) is polled to check the progress of the render.
@@ -81,5 +83,6 @@ Tweak the params you pass to [`renderMediaOnLambda()`](/docs/lambda/rendermediao
## See also
- [Remotion Lambda](/docs/lambda)
+- [Client-side rendering](/docs/editor-starter/client-side-rendering)
- [Setup](/docs/editor-starter/setup)
- [Asset uploads](/docs/editor-starter/asset-uploads)
diff --git a/packages/docs/docs/editor-starter/setup.mdx b/packages/docs/docs/editor-starter/setup.mdx
index f79dba7eb6..2d0abcc8b6 100644
--- a/packages/docs/docs/editor-starter/setup.mdx
+++ b/packages/docs/docs/editor-starter/setup.mdx
@@ -71,7 +71,7 @@ See [Asset uploads](/docs/editor-starter/asset-uploads) for more information.
## Setting up rendering
-See [Rendering](/docs/editor-starter/rendering) for how to setup the Remotion Lambda integration.
+Choose between [Remotion Lambda](/docs/editor-starter/rendering) and [client-side rendering](/docs/editor-starter/client-side-rendering).
## Setting up captions
diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.ts
index 9da3ca1bc5..55fdffdf53 100644
--- a/packages/docs/sidebars.ts
+++ b/packages/docs/sidebars.ts
@@ -1792,6 +1792,7 @@ const sidebars: SidebarsConfig = {
'editor-starter/persistance',
'editor-starter/captioning',
'editor-starter/rendering',
+ 'editor-starter/client-side-rendering',
'editor-starter/backend-routes',
'editor-starter/production-checklist',
'editor-starter/features-not-included',
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index 54c9c248ee..4d1e7cd93f 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -1601,6 +1601,15 @@ export const articles = [
noAi: false,
slug: 'editor-starter/captioning',
},
+ {
+ id: 'client-side-rendering',
+ title: 'Client-side rendering in the Editor Starter',
+ relativePath: 'docs/editor-starter/client-side-rendering.mdx',
+ compId: 'articles-docs-editor-starter-client-side-rendering',
+ crumb: 'Editor Starter',
+ noAi: false,
+ slug: 'editor-starter/client-side-rendering',
+ },
{
id: 'copy-paste',
title: 'Copy and Paste in the Editor Starter',
@@ -1702,7 +1711,7 @@ export const articles = [
},
{
id: 'rendering',
- title: 'Rendering in the Editor Starter',
+ title: 'Rendering with Remotion Lambda in the Editor Starter',
relativePath: 'docs/editor-starter/rendering.mdx',
compId: 'articles-docs-editor-starter-rendering',
crumb: 'Editor Starter',
diff --git a/packages/docs/static/generated/articles-docs-editor-starter-client-side-rendering.png b/packages/docs/static/generated/articles-docs-editor-starter-client-side-rendering.png
new file mode 100644
index 0000000000..85b8d59bd0
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-editor-starter-client-side-rendering.png differ