🎥 Make videos programmatically with React
Docs: Add ProRes guide (#8957)
Jonny Burger967dfed87d2a
diff --git a/packages/docs/docs/encoding.mdx b/packages/docs/docs/encoding.mdxindex e9f146626f..867c75ffc0 100644--- a/packages/docs/docs/encoding.mdx+++ b/packages/docs/docs/encoding.mdx@@ -179,68 +179,9 @@ This option is incompatible with other quality options._Applies only to `prores` codec_.-For ProRes, there is no CRF option, but there are profiles which you can set using the [`--prores-profile` flag](/docs/cli/render#--prores-profile) or the [`setProResProfile`](/docs/config#setproresprofile) config file option.+For ProRes, there is no CRF option, but there are profiles which you can set using the [`--prores-profile` flag](/docs/cli/render#--prores-profile), the [`proResProfile`](/docs/renderer/render-media#proresprofile) render option, or the [`setProResProfile()`](/docs/config#setproresprofile) config file option.-<table>- <tr>- <th>Value</th>- <th>FFmpeg setting</th>- <th>Bitrate</th>- <th>- <a href="/docs/transparent-videos">Supports alpha channel</a>- </th>- </tr>- <tr>- <td>- <code>"proxy"</code>- </td>- <td>0</td>- <td>~45Mbps</td>- <td>No</td>- </tr>- <tr>- <td>- <code>"light"</code>- </td>- <td>1</td>- <td>~102Mbps</td>- <td>No</td>- </tr>- <tr>- <td>- <code>"standard"</code> (default)- </td>- <td>2</td>- <td>~147Mbps</td>- <td>No</td>- </tr>- <tr>- <td>- <code>"hq"</code>- </td>- <td>3</td>- <td>~220Mbps</td>- <td>No</td>- </tr>- <tr>- <td>- <code>"4444"</code>- </td>- <td>4</td>- <td>~330Mbps</td>- <td>Yes</td>- </tr>- <tr>- <td>- <code>"4444-xq"</code>- </td>- <td>4</td>- <td>~500Mbps</td>- <td>Yes</td>- </tr>-</table>--Higher bitrate means higher quality and higher file size.+See [Rendering ProRes](/docs/prores#choosing-a-prores-profile) for all profile values and alpha channel support.## Audio-only exportdiff --git a/packages/docs/docs/media/index.mdx b/packages/docs/docs/media/index.mdxindex 7bc27a2e28..a4411879a9 100644--- a/packages/docs/docs/media/index.mdx+++ b/packages/docs/docs/media/index.mdx@@ -12,6 +12,11 @@ This package provides the recommended [`<Video>`](/docs/media/video) and [`<AudiUse these tags for new projects. The media tags from the [`remotion`](/docs/remotion) package remain available for direct use and fallback-specific behavior.+## ProRes++Apple ProRes decoding is not enabled by default.+See [Embedding ProRes](/docs/videos/prores) to enable the decoder.+## Components<TableOfContents />diff --git a/packages/docs/docs/media/support.mdx b/packages/docs/docs/media/support.mdxindex 2ff8ea2c9c..46d9000548 100644--- a/packages/docs/docs/media/support.mdx+++ b/packages/docs/docs/media/support.mdx@@ -15,7 +15,7 @@ Any assets must be either CORS-enabled or served from the bundle using [`staticFThe supported formats and codecs are defined here: [Mediabunny - Supported formats and codecs](/docs/mediabunny/formats).-Apple ProRes decoding can be enabled from <AvailableFrom v="4.0.487" inline /> using `@mediabunny/prores`. See [Supported formats and codecs by Mediabunny](/docs/mediabunny/formats#prores).+Apple ProRes decoding can be enabled from <AvailableFrom v="4.0.487" inline /> using `@mediabunny/prores`. See [Embedding ProRes](/docs/videos/prores).## Matroska limitationdiff --git a/packages/docs/docs/mediabunny/formats.mdx b/packages/docs/docs/mediabunny/formats.mdxindex 649ce007ea..3345b7e851 100644--- a/packages/docs/docs/mediabunny/formats.mdx+++ b/packages/docs/docs/mediabunny/formats.mdx@@ -45,6 +45,7 @@ This means that during rendering of Remotion videos server-side, HEVC videos can### ProRes<AvailableFrom v="4.0.487" />ProRes is not natively supported by WebCodecs and is not enabled by default in [`@remotion/media`](/docs/media).+For Remotion-specific instructions, see [Embedding ProRes](/docs/videos/prores).If you need ProRes support, [you can enable it yourself](https://mediabunny.dev/guide/extensions/prores) by installing and registering the decoder:diff --git a/packages/docs/docs/prores.mdx b/packages/docs/docs/prores.mdxnew file mode 100644index 0000000000..2ec7bb11ce--- /dev/null+++ b/packages/docs/docs/prores.mdx@@ -0,0 +1,117 @@+---+image: /generated/articles-docs-prores.png+id: prores+title: Rendering ProRes+sidebar_label: ProRes+crumb: 'Rendering'+---++Apple ProRes is a high-bitrate codec for video editing workflows.+Use it when the rendered file is going into Final Cut Pro, Adobe Premiere Pro, DaVinci Resolve or another editor.++ProRes files are large and are not suitable for browser playback.+For web delivery, use [H.264](/docs/encoding), [H.265](/docs/encoding), [VP8 or VP9](/docs/encoding), or [AV1](/docs/encoding) instead.++If you want to use an existing ProRes video in a Remotion composition, see [Embedding ProRes](/docs/videos/prores).++## Render a ProRes file<AvailableFrom v="2.1.7" />++Pass `prores` as the codec and use a `.mov` output file:++```bash title="Terminal"+npx remotion render MyComp out/video.mov --codec=prores+```++In the Studio, choose `Apple ProRes` in the render dialog.++When rendering with [`renderMedia()`](/docs/renderer/render-media), pass `codec: "prores"`:++```ts twoslash title="render.ts"+import {renderMedia} from '@remotion/renderer';+import type {VideoConfig} from 'remotion';++declare const serveUrl: string;+declare const composition: VideoConfig;+// ---cut---+await renderMedia({+ composition,+ serveUrl,+ codec: 'prores',+ outputLocation: 'out/video.mov',+});+```++To make ProRes the default codec for CLI renders, set it in `remotion.config.ts`:++```tsx twoslash title="remotion.config.ts"+import {Config} from '@remotion/cli/config';++Config.setCodec('prores');+```++You can also return `defaultCodec: "prores"` from [`calculateMetadata()`](/docs/calculate-metadata).++## Choosing a ProRes profile++Use the [`--prores-profile`](/docs/cli/render#--prores-profile) CLI flag, the [`proResProfile`](/docs/renderer/render-media#proresprofile) option, [`Config.setProResProfile()`](/docs/config#setproresprofile), or `defaultProResProfile` from [`calculateMetadata()`](/docs/calculate-metadata).++```bash title="Terminal"+npx remotion render MyComp out/video.mov --codec=prores --prores-profile=hq+```++```ts twoslash title="render.ts"+import {renderMedia} from '@remotion/renderer';+import type {VideoConfig} from 'remotion';++declare const serveUrl: string;+declare const composition: VideoConfig;+// ---cut---+await renderMedia({+ composition,+ serveUrl,+ codec: 'prores',+ proResProfile: 'hq',+ outputLocation: 'out/video.mov',+});+```++| Value | FFmpeg setting | Approximate bitrate | Alpha channel |+| ---------------- | -------------- | ------------------- | ------------- |+| `"proxy"` | `0` | 45 Mbps | No |+| `"light"` | `1` | 102 Mbps | No |+| `"standard"` | `2` | 147 Mbps | No |+| `"hq"` (default) | `3` | 220 Mbps | No |+| `"4444"` | `4` | 330 Mbps | Yes |+| `"4444-xq"` | `5` | 500 Mbps | Yes |++Higher profiles produce larger files.+ProRes does not support [`crf`](/docs/cli/render#--crf), and [`videoBitrate`](/docs/cli/render#--video-bitrate) is ignored.++## Transparent ProRes++To export a transparent overlay or transition for a video editor, use a ProRes profile with alpha support: `"4444"` or `"4444-xq"`.+The video must be rendered with PNG frames and the `yuva444p10le` pixel format.++```bash title="Terminal"+npx remotion render MyComp out/overlay.mov --codec=prores --prores-profile=4444 --image-format=png --pixel-format=yuva444p10le+```++```tsx twoslash title="remotion.config.ts"+import {Config} from '@remotion/cli/config';++Config.setCodec('prores');+Config.setProResProfile('4444');+Config.setVideoImageFormat('png');+Config.setPixelFormat('yuva444p10le');+```++Make sure the composition has no opaque background.+In the Studio, enable the checkerboard background to inspect transparency.++For more context, see [Rendering transparent videos](/docs/transparent-videos) and [Creating overlays](/docs/overlay).++## See also++- [Embedding ProRes](/docs/videos/prores)+- [Encoding Guide](/docs/encoding)+- [Rendering transparent videos](/docs/transparent-videos)diff --git a/packages/docs/docs/renderer/render-media.mdx b/packages/docs/docs/renderer/render-media.mdxindex 62a0eab748..1de2aeaae8 100644--- a/packages/docs/docs/renderer/render-media.mdx+++ b/packages/docs/docs/renderer/render-media.mdx@@ -328,7 +328,7 @@ const onDownload: RenderMediaOnDownload = (src) => {### `proResProfile?`-Sets a ProRes profile. Only applies to videos rendered with `prores` codec. See [Encoding guide](/docs/encoding/#controlling-quality-using-prores-profile) for possible options.+Sets a ProRes profile. Only applies to videos rendered with `prores` codec. See [Rendering ProRes - Choosing a ProRes profile](/docs/prores#choosing-a-prores-profile) for possible options.### `x264Preset?`diff --git a/packages/docs/docs/renderer/stitch-frames-to-video.mdx b/packages/docs/docs/renderer/stitch-frames-to-video.mdxindex 963f874fe2..d1392724ae 100644--- a/packages/docs/docs/renderer/stitch-frames-to-video.mdx+++ b/packages/docs/docs/renderer/stitch-frames-to-video.mdx@@ -93,7 +93,7 @@ The constant rate factor of the output, a parameter which controls quality. See### `proResProfile?`-Sets a ProRes profile. Only applies to videos rendered with `prores` codec. See [Encoding guide](/docs/encoding/#controlling-quality-using-prores-profile) for possible options.+Sets a ProRes profile. Only applies to videos rendered with `prores` codec. See [Rendering ProRes - Choosing a ProRes profile](/docs/prores#choosing-a-prores-profile) for possible options.### `onProgress?`diff --git a/packages/docs/docs/transparent-videos.mdx b/packages/docs/docs/transparent-videos.mdxindex 8376a7fc49..9ef655cff3 100644--- a/packages/docs/docs/transparent-videos.mdx+++ b/packages/docs/docs/transparent-videos.mdx@@ -100,6 +100,7 @@ If you want to export a transparent video for use in another video editing progrProRes is supported by Final Cut Pro, Adobe Premiere and Davinci Resolve.Supported since v2.1.7, you can set the codec to `prores` and choose a ProRes profile with alpha support: Either `4444` or `4444-xq`. The pixel format must be `yuva444p10le`.+See [Rendering ProRes](/docs/prores#transparent-prores) for the full rendering setup.```tsx twoslashimport { Config } from "@remotion/cli/config";diff --git a/packages/docs/docs/videos/prores.mdx b/packages/docs/docs/videos/prores.mdxnew file mode 100644index 0000000000..5fb8282895--- /dev/null+++ b/packages/docs/docs/videos/prores.mdx@@ -0,0 +1,64 @@+---+image: /generated/articles-docs-videos-prores.png+title: Embedding ProRes+sidebar_label: ProRes+crumb: 'How To'+---++ProRes is the most popular format for exchanging transparent videos.+Marketplaces such as [VideoHive](https://videohive.net/category/motion-graphics/elements) and [Motion Array](https://motionarray.com/stock-motion-graphics/) sell animated elements like overlays, transitions and lower thirds, often as ProRes `.mov` files with alpha channels.++Use these assets in Remotion with [`<Video>` from `@remotion/media`](/docs/media/video).+ProRes is not enabled by default, because WebCodecs does not natively support it.++## Enable ProRes decoding<AvailableFrom v="4.0.487" />++Install the ProRes decoder:++```bash title="Terminal"+npx remotion add @mediabunny/prores+```++Register it before rendering a composition that uses ProRes media:++```tsx twoslash title="src/index.ts"+// @filename: ./Root.tsx+export const RemotionRoot = () => <></>;++// @filename: index.ts+// ---cut---+import {registerRoot} from 'remotion';+import {registerProresDecoder} from '@mediabunny/prores';+import {RemotionRoot} from './Root';++registerProresDecoder();+registerRoot(RemotionRoot);+```++## Embed a ProRes asset++Put the `.mov` file in your [`public`](/docs/terminology/public-dir) folder and reference it with [`staticFile()`](/docs/staticfile):++```tsx twoslash title="MyComposition.tsx"+import {staticFile} from 'remotion';+import {Video} from '@remotion/media';++export const MyComposition = () => {+ return <Video src={staticFile('overlay.mov')} />;+};+```++## Performance++For maximum performance, `@mediabunny/prores` uses shared-memory multithreading when the page is [cross-origin isolated](/docs/miscellaneous/cross-origin-isolation).+If cross-origin isolation is not enabled, ProRes decoding still works, but falls back to a slower algorithm.++## Rendering ProRes++If you want to export a ProRes file from Remotion, see [Rendering ProRes](/docs/prores).++## See also++- [`<Video>` from `@remotion/media`](/docs/media/video)+- [`@remotion/media` - Supported media](/docs/media/support)+- [Supported formats and codecs by Mediabunny](/docs/mediabunny/formats)diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.tsindex 54e486bf43..9c9db7ce96 100644--- a/packages/docs/sidebars.ts+++ b/packages/docs/sidebars.ts@@ -1067,6 +1067,7 @@ const sidebars: SidebarsConfig = {'videos/different-segments-at-different-speeds','video-tags','hls',+ 'videos/prores','videos/media-fragments','videos/as-threejs-texture',],@@ -1148,6 +1149,7 @@ const sidebars: SidebarsConfig = {'dataset-render','render-all','miscellaneous/video-formats',+ 'prores','artifacts','metadata','hardware-acceleration',diff --git a/packages/docs/src/data/articles.ts b/packages/docs/src/data/articles.tsindex 57e6267877..7ae5573d89 100644--- a/packages/docs/src/data/articles.ts+++ b/packages/docs/src/data/articles.ts@@ -5219,6 +5219,15 @@ export const articles = [noAi: false,slug: 'license/pricing',},+ {+ id: 'prores',+ title: 'Rendering ProRes',+ relativePath: 'docs/prores.mdx',+ compId: 'articles-docs-prores',+ crumb: 'Rendering',+ noAi: false,+ slug: 'prores',+ },{id: 'quality',title: 'Quality Guide',@@ -7967,6 +7976,15 @@ export const articles = [noAi: false,slug: 'videos/media-fragments',},+ {+ id: 'videos/prores',+ title: 'Embedding ProRes',+ relativePath: 'docs/videos/prores.mdx',+ compId: 'articles-docs-videos-prores',+ crumb: 'How To',+ noAi: false,+ slug: 'videos/prores',+ },{id: 'videos/sequence',title: 'Playing videos in sequence',diff --git a/packages/docs/static/generated/articles-docs-prores.png b/packages/docs/static/generated/articles-docs-prores.pngnew file mode 100644index 0000000000..6dfe01e216Binary files /dev/null and b/packages/docs/static/generated/articles-docs-prores.png differdiff --git a/packages/docs/static/generated/articles-docs-videos-prores.png b/packages/docs/static/generated/articles-docs-videos-prores.pngnew file mode 100644index 0000000000..91f13d5fc9Binary files /dev/null and b/packages/docs/static/generated/articles-docs-videos-prores.png differ