Skip to content

🎥 Make videos programmatically with React

fix 3.3 announcement post

Jonny Burger4c0672d5a11d
diff --git a/packages/docs/blog/2022-11-14-remotion-3-3.md b/packages/docs/blog/2022-11-14-remotion-3-3.md
index 28b09702d4..66acb5b6b4 100644
--- a/packages/docs/blog/2022-11-14-remotion-3-3.md
+++ b/packages/docs/blog/2022-11-14-remotion-3-3.md
@@ -8,15 +8,18 @@ author_image_url: https://avatars2.githubusercontent.com/u/1629785?s=460&u=12eb9
image: TODO
---
-## Basics
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
-### FFmpeg installation made easy
+## FFmpeg installation made easy
Now, when you are rendering a video and don't have FFmpeg installed, Remotion will download a copy for you.
Previously, installing FFmpeg required 7 steps on Windows and took several minutes when using Homebrew on macOS.
When deploying Remotion on a server, you can now also let Remotion install FFmpeg for you using the [`ensureFfmpeg()`](/docs/renderer/ensure-ffmpeg) API or the [`npx remotion install ffmpeg`](/docs/cli/install) command. Learn more about [FFmpeg auto-install](/docs/ffmpeg) here.
+## Remotion Core
+
### `<Sequence>` makes `from` optional, accepts style and ref
[`<Sequence from={0}>`](/docs/sequence) can now be shortened to [`<Sequence>`](/docs/sequence). Our ESLint plugin was updated to suggest this refactor automatically.
@@ -41,10 +44,6 @@ If your device supports multitouch, you can now pinch to zoom the composition. A
Using two fingers, you can move the canvas around and pressing <kbd>0</kbd> will reset the canvas. For the latter, there is also a button in the top-right corner that you can click.
-### Signal that Remotion Preview disconnected
-
-When quitting the Remotion Preview using `Ctrl+C`, for example to render a video, A new red popup will signalize that Fast Refresh will not work anymore.
-
### Quick Switcher
By pressing <kbd>Cmd+K</kbd>, you can trigger a new Quick Switcher. It has three functions:
@@ -93,6 +92,10 @@ If you deviate from the defaults of our templates, you can set an [entry point](
If you change values in your `.env` file, the Remotion Preview will reload and pick them up without having to restart.
+### Signal that Remotion Preview disconnected
+
+When quitting the Remotion Preview using `Ctrl+C`, for example to render a video, A new popup will signalize that Fast Refresh will not work anymore.
+
## Rendering
### `--muted` render
@@ -127,43 +130,93 @@ The FFmpeg command that Remotion executes under the hood can [now be overriden r
### Resuming renders if they crash
-If a render crashes due to being resource-intensive (see: [Target closed](/docs/target-closed)), Remotion will now retry each frame up to one time, to prevent long renders from failing on low-resource machines.
+If a render crashes due to being resource-intensive (see: [Target closed](/docs/target-closed)), Remotion will now retry each failed frame once, to prevent long renders from failing on low-resource machines.
### Getting the overall progress from `renderMedia()`
-Previously, only the separated progress for rendering and encoding was reported. There is a new field, simply named `progress`, in the [`onProgress`](/docs/renderer/render-media#onprogress) callback that you can use to display progress without calculating it yourself.
+Previously, the progress for rendering and encoding was reported individually. There is a new field, simply named `progress`, in the [`onProgress`](/docs/renderer/render-media#onprogress) callback that you can use to display progress without calculating it yourself.
### Easier function signature for bundle()
Previously, [`bundle()`](/docs/bundle) accepted three arguments: `entryPoint`, `onProgress` and `options`.
-Since getting the progress was less important than some of the options, `bundle()` now accepts an object with options, progress callback and entryPoint altogether. The previous signature is still supported.
+```ts twoslash title="Old bundle() signature"
+import { bundle } from "@remotion/bundler";
+
+bundle("./src/index.ts", (progress) => console.log(progress), {
+ publicDir: process.cwd() + "/public",
+});
+```
+
+Since getting the progress was less important than some of the options, `bundle()` now accepts an object with options, progress callback and entryPoint altogether:
+
+```ts twoslash title="New bundle() signature"
+import { bundle } from "@remotion/bundler";
+
+bundle({
+ entryPoint: "./src/index.ts",
+ onProgress: (progress) => console.log(progress),
+ publicDir: process.cwd() + "/public",
+});
+```
+
+The previous signature is still supported.
## Player
### `<Thumbnail>` component
-The new [`<Thumbnail>`](/docs/api/thumbnail) component is like the [`<Player>`](/docs/api/player), but for rendering a preview of a still. You can use it to display a specific frame of a video without having to render the component.
+The new [`<Thumbnail>`](/docs/api/player/thumbnail) component is like the [`<Player>`](/docs/api/player/player), but for rendering a preview of a still. You can use it to display a specific frame of a video without having to render it.
+
+```tsx twoslash
+import React from "react";
+const MyComp: React.FC = () => null;
+
+// ---cut---
+import { Thumbnail } from "@remotion/player";
+
+const MyApp: React.FC = () => {
+ return (
+ <Thumbnail
+ component={MyComp}
+ compositionWidth={1920}
+ compositionHeight={1080}
+ frameToDisplay={30}
+ durationInFrames={120}
+ fps={30}
+ style={{
+ width: 200,
+ }}
+ />
+ );
+};
+```
### Player `frameupdate` event
-In addition to `timeupdate`, you can subscribe to `frameevent`, which fires whenever the current frame changes. You can use it for example to render a custom frame-accurate time display.
+In addition to `timeupdate`, you can subscribe to [`frameupdate`](/docs/player/player#frameupdate), which fires whenever the current frame changes. You can use it for example to render a custom frame-accurate time display.
### Player volume slider is responsive
If the Player is displayed in a narrow container, the volume control now goes upwards instead of to the right, in order to save some space.
+<video src="/img/responsivevolume.mov" autoPlay loop muted playsInline/>
+
### getScale() method
Using the imperative `getScale()` method, you can now how big the displayed size is in comparison to the canvas width of the component.
-### `initiallyShowControls`
+### Controls are initially shown
On YouTube, the video always starts with controls shown and then they fade out after a few seconds. We have made this the default behavior in Remotion as well, because users would often not realize that the Player is interactive otherwise.
-### `in`/`out` ranges
+<video src="/img/controlsinitiallyshown.mov" style={{maxWidth: 400, width: "100%"}} autoPlay loop muted playsInline/>
+
+### Play a section of a video
-Using the `in` and `out` props, you can force the Remotion Player to only play a certain section of a video. The rest of the seek bar will be greyed out.
+Using the [`inFrame`](/docs/player/player#inframe) and [`outFrame`](/docs/player/player#outframe) props, you can force the Remotion Player to only play a certain section of a video. The rest of the seek bar will be greyed out.
+
+<img src="/img/inout.png" />
### Customize Play button and fullscreen button
@@ -171,16 +224,67 @@ Using [`renderPlayPauseButton`](/docs/player/player#renderplaypausebutton) and [
### Start player from an offset
-You can define the initial frame on which your component gets mounted on. This will be the default position of the video, however, it will not clamp the playback range like the `inFrame` prop.
+You can define the [`initialFrame`](/docs/player/player#initialframe) on which your component gets mounted on. This will be the default position of the video, however, it will not clamp the playback range like the `inFrame` prop.
## New `prefetch()` API
-In addition to the [`Preload APIs`](/docs/api/preload), [`prefetch()`](/docs/prefetch) presents another way of preloading an asset so it is ready to display when it is supposed to appear in the Remotion Player. See [`@remotion/preload` vs. `prefetch()`](/docs/player/player#renderfullscreenbutton) for a comparison.
+In addition to the [`Preload APIs`](/docs/preload), [`prefetch()`](/docs/prefetch) presents another way of preloading an asset so it is ready to display when it is supposed to appear in the Remotion Player.
+
+```tsx twoslash title="Prefetching API"
+import { prefetch } from "remotion";
+
+const { free, waitUntilDone } = prefetch("https://example.com/video.mp4");
+
+waitUntilDone().then(() => {
+ console.log("Video has finished loading");
+ free(); // Free up memory
+});
+```
+
+Video and audio tags will automatically use the prefetched asset if it is available. See [`@remotion/preload` vs. `prefetch()`](/docs/player/player#renderfullscreenbutton) for a comparison.
## Remix template
The Remix template is our first SaaS template! It includes the Remotion Preview, the Player and Remotion Lambda out of the box to jumpstart you with everything you need to create your app that offers customized video generation.
+<img src="/img/remix-template.png"></img>
+<br />
+<br />
+Get started by running:
+
+<Tabs
+defaultValue="npm"
+values={[
+{ label: 'npm', value: 'npm', },
+{ label: 'yarn', value: 'yarn', },
+{ label: 'pnpm', value: 'pnpm', },
+]
+}>
+<TabItem value="npm">
+
+```bash
+npx create-video --remix
+```
+
+ </TabItem>
+
+ <TabItem value="yarn">
+
+```bash
+yarn create video --remix
+```
+
+ </TabItem>
+
+ <TabItem value="pnpm">
+
+```bash
+pnpm create video --remix
+```
+
+ </TabItem>
+</Tabs>
+
## New `@remotion/google-fonts` package
It is now easy to import Google Fonts into Remotion! `@remotion/google-fonts` takes care of correct loading, and is fully type-safe!
@@ -201,15 +305,19 @@ This package offers utilities for animating and manipulating SVG paths! With 9 p
### Webhook support
-### Lift Lambda Payload limits
+You can now send and receive a webhook when a Lambda render is done or has failed. Examples for Next.js and Express apps have been added and our documentation page features a way to send a test webhook.
+
+### Payload limit lifted
-Previously, the input props payload that is passed to a Lambda render could not be bigger than 256KB when serialized. Now, this limit is lifted, since if the payload is big, it will be stored to S3 instead being passed directly to the Lambda function.
+Previously, the input props passed to a Lambda render could not be bigger than 256KB when serialized. Now, this limit is lifted, since if the payload is big, it will be stored to S3 instead being passed directly to the Lambda function.
### Lambda artifact can be saved to another cloud
+The output videos generated by Lambda can now be saved to other S3-compatible protocols such as DigitalOcean Spaces or Cloudflare R2.
+
### Deleting a render from Lambda
-The new [`deleteRender()`](/docs/lambda/delete-render) API will delete the output video from the S3 bucket, which you previously had to do through the console or with the AWS SDK.
+The new [`deleteRender()`](/docs/lambda/deleterender) API will delete the output video from the S3 bucket, which you previously had to do through the console or with the AWS SDK.
### Make `renderMediaOnLambda()` params optional
@@ -238,3 +346,7 @@ The new `npx remotion benchmark` helps you compare different render configuratio
- Temp dir is cleaned up
- Parallel encoding disabled when not having a lot of RAM
- GIFs in strict mode fixed
+
+```
+
+```
diff --git a/packages/docs/static/img/controlsinitiallyshown.mov b/packages/docs/static/img/controlsinitiallyshown.mov
new file mode 100644
index 0000000000..ddf9064f57
Binary files /dev/null and b/packages/docs/static/img/controlsinitiallyshown.mov differ
diff --git a/packages/docs/static/img/inout.png b/packages/docs/static/img/inout.png
new file mode 100644
index 0000000000..537c71c48b
Binary files /dev/null and b/packages/docs/static/img/inout.png differ
diff --git a/packages/docs/static/img/responsivevolume.mov b/packages/docs/static/img/responsivevolume.mov
new file mode 100644
index 0000000000..f67bc668bc
Binary files /dev/null and b/packages/docs/static/img/responsivevolume.mov differ