Skip to content

🎥 Make videos programmatically with React

write 4.0 blog post

Jonny Burgered341a73a6e1
diff --git a/packages/docs/blog/2023-04-01-remotion-4-0.md b/packages/docs/blog/2023-04-01-remotion-4-0.md
index 02f5a79bb8..f633c1bed8 100644
--- a/packages/docs/blog/2023-04-01-remotion-4-0.md
+++ b/packages/docs/blog/2023-04-01-remotion-4-0.md
@@ -7,72 +7,143 @@ author_url: https://github.com/JonnyBurger
author_image_url: https://avatars2.githubusercontent.com/u/1629785?s=460&u=12eb94da6070d00fc924761ce06e3a428d01b7e9&v=4
---
-Welcome to the new release notes of one of the biggest Remotion updates ever! With Remotion 4.0, we offer significant improvements to many workflows.
+Welcome to the biggest Remotion update ever!
+With Remotion 4.0, we offer significant improvements to many workflows.
-## Render button
+## Introducing the Remotion Studio
-Instead of quitting the Remotion Studio and rendering using a CLI command, you can now simply press a button to render a video, audio or still!
+We added handy features to the Remotion Preview - as a result, it's more than just a preview! Therefore, we renamed it: Welcome to the Remotion Studio!
-A graphical interface allows you to discover and tweak all options of a render. You may follow the progress of a render in the Remotion Studio, queue multiple renders, and open the resulting render in the file explorer.
+### Interactive editing of props
-Every render triggered through the UI is also trackable in the CLI as usual and synchronizes to other instances of the Remotion Studio. Failed renders show the stacktrace and allow for retries with the same configuration.
+The props of a composition can now be defined as a [Zod](https://zod.dev) schema.
+Doing this will not only make your `defaultProps` typesafe, but also allow you to edit them in the Remotion Studio.
-## Interactive editing of props
+Edit numbers, strings, arrays, objects, enums and dates directly using a graphical interface. Even nested data structures can be visualized and edited.
-The props of a composition can now be defined as a Zod Schema! Doing this will not only make your `defaultProps` type-safe, but also allow you to edit the props live in the Remotion Studio.
+Once you are happy with the changes you've made, you can even save the props back to your project. This works with arbitrary JSON data.
-Our visual schema editor supports editing numbers, strings, arrays, objects, enums and dates! Alternatively, you can also edit the JSON directly. Like the changes you've made? In a lot of cases, you can save the props back to your project!
+### Render button
-## Rust-powered FFmpeg
+Instead of typing in a CLI command, you can now simply press a button to render a video, audio or still.
-Installing FFmpeg is now superfluous, as each Remotion project comes with a tiny version of FFmpeg baked into it. This also enables us to use the low-level FFmpeg API from Rust! While it is currenly not being used, this will allow us to optimize the Remotion rendering pipeline going forward.
+A graphical interface allows you to discover and tweak all options of a render. You can follow the progress of a render in the Remotion Studio, queue multiple renders, and reveal the output in the file explorer.
-## Support for WebP and PDF rendering
+Every render triggered through the UI is also trackable in the CLI as usual and synchronizes to other instances of the Remotion Studio.
+Failed renders show the stacktrace and allow for retries with the same configuration.
-In addition to PNG and JPEG, you can now render a React component to WebP or PDF format. To do so, use the new render button, the `npx remotion still` command, the `renderStill()` Node.JS API, or render on Lambda with `renderStillOnLambda()`!
+Edited props in the Remotion editor can be used to render a video using the render button as well - which means you can now render a parametrized video by filling out a form and not having to touch any code.
-## Rive support
+## Rust-powered architecture
-With the new `@remotion/rive` package, you can include [Rive](https://rive.app) animations in your project! Rive is a faster and smaller alternative to Lottie.
+Remotion 4.0 ships with a Rust binary that speeds up current and future features.
-## `@remotion/shapes` package
+### FFmpeg is baked in
-Remotion Shapes is the easiest way to include geometric shapes like `<Triangle>`, `<Star>` or `<Pie>` in your components! Those components are easy to animate, pure, and it's also possible to just get an SVG path for further manipulation.
+Installing FFmpeg is now superfluous, as each Remotion project comes with a tiny version of FFmpeg baked into it.
-## Finetuned Audio codec
+We eliminate the our burden of having to support multiple versions of FFmpeg, and you don't have to worry about installing it anymore.
-## Lambda improvements
+We ship a custom build of FFmpeg 6.0, which is much smaller than a version that you would download. On Lambda, it decreases the cold start time of your functions.
-- More regions
-- `speculateFunctionName()`
-- VP9 support
-- `npx remotion lambda compositions` and `getCompositionsOnLambda()`
-- New articles
+We also get access to the low-level C API that allows us to do things that were not possible before.
-## Player improvements
+### Faster `<OffthreadVideo>`
-## Load fonts dynamically
+The [`<OffthreadVideo>`](/docs/offthreadvideo) component is the preferred way to embed an existing video into a Remotion project.
-## ES Module support
+While previously, frames were extracted using the FFmpeg CLI, we now use the FFmpeg C API to extract frames. This is much faster and allows us to support more video formats.
-## More `@remotion/paths` functions
+Unnecessary redundant decoding work can now be skipped, which makes the component up to twice as fast during rendering!
-## Miscellaneous
+## Support for WebP and PDF generation
-- `getStaticFiles()` API
-- `<Experimental.Clipper>`
-- `<Experimental.Null>`
-- `style` and `ref` in `<Series.Sequence>` and `<Loop>`
+Previously you could generate PNGs and JPEGs using Remotion - now we support WebP and PDF as well!
-## New documentation
+There are plenty of ways you can render stills: the new [Render button](/docs/render), the [`npx remotion still`](/docs/cli/still) command, the [`renderStill()`](/docs/renderer/render-still) Node.JS API, render on Lambda with [`renderStillOnLambda()`](/docs/lambda/renderstillonlambda) or on Google Cloud Run using [`renderStillOnCloudrun()`](https://cloudrun.remotion.dev/docs/cloudrun/renderstilloncloudrun)!
-- Lambda documentation
-- Docker
+## Easier data-driven videos
-## Breaking changes
+We are introducing a new [`calculateMetadata()`](/docs/composition#composition) API for the `<Composition>` component. It helps if you want to:
+
+<Step>1</Step> Adjust the duration or resolution based on the props of the React component <br/>
+<Step>2</Step> Perform data fetching before the video renders <br/>
+<Step>3</Step> Precalculate props before mounting the React component <br/><br/>
+
+To demonstrate the possibilities of the new API, we made a new section in the docs entirely dedicated to data-driven videos. See: [Paramerized rendering](/docs/parametrized-rendering).
+
+## Upgraded templates
+
+All of our [templates](/templates) have been upgraded to use Remotion 4.0. Many of them make use of the new features, for example the popular [Text-to-speech](/templates/tts) template allows you to customize the text and voice, and the template will automatically adjust the duration of the video to match.
+
+We also introduce a new template: [Text-to-speech (Google)](/templates/google-tts) which is an alternative to the regular TTS template which relies on Azure.
+
+## More features
+
+These features added inbetween v3.3 and v4.0 are worth highlighting:
+
+### `@remotion/rive` package
+
+[Rive](https://rive.app) is a faster and smaller alternative to Lottie.
+With the new [`@remotion/rive`](/docs/rive) package, you can include Rive animations in your project.
+
+### `@remotion/shapes` package
+
+[`@remotion/shapes`](/docs/shapes) is a handy package for including geometric shapes like [`<Triangle>`](/docs/shapes/triangle), [`<Star>`](/docs/shapes/star) or [`<Pie>`](/docs/shapes/pie) in your components!
+
+Those components are easy to animate, pure, dependency-free and work well with [`@remotion/paths`](/docs/paths).
+
+Each shape can be used as a React component [`<Star>`](/docs/shapes/star) or as a pure function that returns an SVG path [`makeStar()`](/docs/shapes/make-star).
+
+### `@remotion/tailwind` package
+
+The new [Tailwind](/docs/tailwind/tailwind) package allows you to install Tailwind more easily in any Remotion project.
+
+### Finetuned Audio codec
-In order to modernize our stack and fix some of our mistakes, we're making the following breaking changes:
+Instead of the audio codec being tied to the video codec, you can now [choose the audio codec independently](/docs/encoding#audio-codec).
+
+### Lambda improvements
+
+- Support for [more regions](/docs/lambda/region-selection) has been added, 20 regions are now supported.
+- The [`speculateFunctionName()`](/docs/lambda/speculatefunctionname) API allows for faster launches of a render.
+- VP9 videos are not supported.
+- [`npx remotion lambda compositions`](/docs/lambda/cli/compositions) and [`getCompositionsOnLambda()`](/docs/lambda/getcompositionsonlambda) APIs have now been added.
+- New [PHP](/docs/lambda/php) and [Go](/docs/lambda/go) SDKs
+- New examples for [Serverless](/docs/lambda/serverless-framework-integration) and [SQS](/docs/lambda/sqs) integration.
+
+### Player improvements
+
+- The Player UI now has an optional [Playback rate control](/docs/player/player#showplaybackratecontrol).
+- The Player now is marked as `"use client"` to support import in React Server Components.
+- New [`mutechange`](/docs/player/player#mutechange), [`scalechange`](/docs/player/player#scalechange), [`volumechange`](/docs/player/player#volumechange) events
+
+### ES Module support
+
+All APIs that can be imported in the browser now have an ES Module version.
+
+### Font Picker
+
+In your apps, you can now display a [font picker](/docs/font-picker) and load fonts dynamically only when they are needed.
+
+### New Core APIs
+
+The [`remotion`](/docs/remotion) package has had the following improvements:
+
+- [`getStaticFiles()`](/docs/get-static-files) allows you get get a list of files in the `public/` folder.
+- [`cancelRender()`](/docs/cancel-render) allows you to abort a render should you run into an error.
+- New Rust-accelerated components: [`<Experimental.Clipper>`](/docs/clipper) and [`<Experimental.Null>`](/docs/null)
+- [`<Series.Sequence>`](/docs/series) and [`<Loop>`](/docs/loop) now support `style` and `ref`.
+
+## Join the Cloud Run Alpha
+
+As a counterpart for Lambda, we are developing a Google Cloud Run package.
+The alpha is now available, [help us test it by becoming an early adopter](https://cloudrun.remotion.dev/docs).
+
+## Full Changelog
+
+See the GitHub release to see the [full changelog](https://github.com/remotion-dev/remotion/releases/tag/v4.0.0).
+
+## Breaking changes
-- Node.JS 16 is now the minimum Node version.
-- We removed the "Rich timeline" feature due to performance problems and confusing behavior created by mounting the component multiple times.
-- We're dropping support for Lambda `x86_64` architecture. Now all Lambdas are `arm64` only.
+See the [Migration Guide](/docs/4-0-migration) for a full list of breaking changes.