Remotion's rendering engine is built upon Node.JS, which makes it exceptionally easy to render a video in the cloud.
Since Remotion is built with tech (Node.JS, FFMPEG, Puppeteer) that works well cross-platform, you can without much hassle run it on a Linux-based system or even dockerize your video.
On this page, we demonstrate the server-rendering capabilities or Remotion using examples built into the template!
The NPM package
@remotion/renderer provides you with an API for rendering the videos programmatically. You can make a video in three steps: creating a Webpack bundle, rendering the frames, and stitching them together to an MP4. This gives you more independence and allows you to for example skip the stitching process, if you just want a PNG sequence.
Follow this commented example to see how to render a video:
In the template, we added a minimal example of an HTTP server that dynamically returns a video whenever you call the URL.
The server is located under
server.tsx, and you can run it using
npm run server. Call the default URL with parameters, and it will return a video after some time! Try it out in the browser or using cURL:
Note that we only added a minimal example. For production, you should consider adding a queueing system and rate limiting.
We added a Dockerfile that includes FFMPEG and added it to the template. That means you can also run the server described in the section above using Docker.
The template includes a Github Actions workflow file
.github/workflows/render-video.yml. All you have to do is to adjust the props that your root component accepts in the workflow file and you can render a video right on Github.
- Commit the template to a Github repository
- On Github, click the 'Actions' tab.
- Select the 'Render video' workflow on the left.
- A 'Run workflow' button should appear. Click it
- Fill in the props of the root component and click 'Run workflow'.
- After the rendering is finished, you can download the video under 'Artifacts'.
Note that running the workflow may incur costs. However, the workflow will only run if you actively trigger it.