π₯ Make videos programmatically with React
Docs article: Timeline - How to hook up rendering
Jonny Burger662ecf9c81a4
diff --git a/packages/docs/docs/timeline/render.mdx b/packages/docs/docs/timeline/render.mdxnew file mode 100644index 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.jsindex ef1167556d..c95161c01c 100644--- a/packages/docs/sidebars.js+++ b/packages/docs/sidebars.js@@ -1288,6 +1288,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.tsindex f40de94e3e..b431e55054 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.pngnew file mode 100644index 0000000000..7e2fda2aedBinary files /dev/null and b/packages/docs/static/generated/articles-docs-timeline-render.png differ