Skip to content

πŸŽ₯ Make videos programmatically with React

Docs article: Timeline - How to hook up rendering

Jonny Burger70a978d19298
diff --git a/packages/docs/docs/timeline/render.mdx b/packages/docs/docs/timeline/render.mdx
new file mode 100644
index 0000000000..d0b607f256
--- /dev/null
+++ b/packages/docs/docs/timeline/render.mdx
@@ -0,0 +1,31 @@
+---
+image: /generated/articles-docs-timeline-render.png
+title: Timeline – Rendering videos
+sidebar_label: Render
+id: render
+---
+
+The [`<Timeline />`](/docs/timeline) component is in a sample Vite project, which is a frontend-only application.
+
+If you want to render the state of your timeline into a video, you need to set up server-side rendering.
+
+## Recommendation: Use a backend framework
+
+We recommend that you use one of our Saas templates to setup a Remotion project that has both a frontend and backend.
+
+It is easier if you use [Next.js](/templates/next) or [React Router](/templates/react-router) templates and copy the timeline component into your project frontend.
+
+These templates include useful boilerplate code for rendering on AWS Lambda.
+
+## Create Remotion project files
+
+Follow [these instructions](/docs/player-into-remotion-project) for how to turn your `<Player>`-based frontend into a Remotion project.
+If you are using a SaaS template, you might already have these files, in which case you can replace them.
+
+## Using the Timeline state
+
+In [`src/timeline/video-preview.tsx`](https://github.com/remotion-dev/timeline/blob/main/src/timeline/video-preview.tsx), you can see that the timeline state is being passed to the [`<Player>`](/docs/player) component.
+
+Whenever you are rendering a video using the [server-side rendering](/docs/ssr) APIs like[ `renderMediaOnLambda`](/docs/lambda/render-media-on-lambda) or [`renderMedia()`](/docs/renderer/render-media), make sure you specify the `inputProps` option and pass in the same payload that you passed to the `<Player>` component.
+
+Note that this payload must be JSON-serializable, so you cannot pass in functions or other non-serializable values.
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 8f5d00b666..cc8ab0d1f4 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -1303,6 +1303,7 @@ module.exports = {
'timeline/setup',
'timeline/usage',
'timeline/faq',
+ 'timeline/render',
],
},
{
diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.ts
index 6dc73ecc57..b958060259 100644
--- a/packages/docs/src/data/articles.ts
+++ b/packages/docs/src/data/articles.ts
@@ -5306,6 +5306,15 @@ export const articles = [
noAi: false,
slug: 'timeline/index',
},
+ {
+ id: 'render',
+ title: 'Timeline – Rendering videos',
+ relativePath: 'docs/timeline/render.mdx',
+ compId: 'articles-docs-timeline-render',
+ crumb: null,
+ noAi: false,
+ slug: 'timeline/render',
+ },
{
id: 'setup',
title: 'Timeline – Setup',
diff --git a/packages/docs/static/generated/articles-docs-timeline-render.png b/packages/docs/static/generated/articles-docs-timeline-render.png
new file mode 100644
index 0000000000..7e2fda2aed
Binary files /dev/null and b/packages/docs/static/generated/articles-docs-timeline-render.png differ