Skip to content

πŸŽ₯ Make videos programmatically with React

`@remotion/media`: Don't auto-register AC-3 decoder

Jonny Burger3328acb28322
diff --git a/package.json b/package.json
index a964667206..c351e2148f 100644
--- a/package.json
+++ b/package.json
@@ -103,7 +103,6 @@
"@types/bun": "1.3.3",
"mediabunny": "1.34.4",
"@mediabunny/mp3-encoder": "1.34.4",
- "@mediabunny/ac3": "1.34.4",
"next": "16.1.5",
"three": "0.178.0",
"sharp": "0.34.5",
diff --git a/packages/cli/src/extra-packages.ts b/packages/cli/src/extra-packages.ts
index 2ea64760ad..ecb994c613 100644
--- a/packages/cli/src/extra-packages.ts
+++ b/packages/cli/src/extra-packages.ts
@@ -1,9 +1,12 @@
export const EXTRA_PACKAGES: Record<string, string> = {
mediabunny: '1.34.4',
+ '@mediabunny/ac3': '1.34.4',
zod: '4.3.6',
};
export const EXTRA_PACKAGES_DOCS: Record<string, string> = {
mediabunny: 'https://www.remotion.dev/docs/mediabunny/version',
+ '@mediabunny/ac3':
+ 'https://www.remotion.dev/docs/mediabunny/formats#ac-3-and-e-ac-3',
zod: 'https://zod.dev',
};
diff --git a/packages/docs/docs/mediabunny/formats.mdx b/packages/docs/docs/mediabunny/formats.mdx
index a10b66b4c6..12de4b49ab 100644
--- a/packages/docs/docs/mediabunny/formats.mdx
+++ b/packages/docs/docs/mediabunny/formats.mdx
@@ -10,7 +10,7 @@ The following features from Remotion are using [Mediabunny](https://mediabunny.d
- [`<Video>`](/docs/media/video) from [`@remotion/media`](/docs/media)
- [`<Audio>`](/docs/media/audio) from [`@remotion/media`](/docs/media)
-Therefore, format support is bound to the [formats and codecs supported by Mediabunny](https://mediabunny.dev/guide/supported-formats-and-codecs).
+Therefore, format support is bound to the [formats and codecs supported by Mediabunny](https://mediabunny.dev/guide/supported-formats-and-codecs).
Mediabunny's compatibility data is mirrored on this page.
## Supported container formats
@@ -32,7 +32,7 @@ Mediabunny's compatibility data is mirrored on this page.
- `'hevc'` - High Efficiency Video Coding (HEVC) / H.265
:::note
-Chrome Headless Shell does not support HEVC in headless mode.
+Chrome Headless Shell does not support HEVC in headless mode.
This means that during rendering of Remotion videos server-side, HEVC videos cannot be decoded using [`<Video>`](/docs/media/video) from [`@remotion/media`](/docs/media).
:::
@@ -61,13 +61,23 @@ This means that during rendering of Remotion videos server-side, HEVC videos can
- `'pcm-f64be'` - 64-bit big-endian float PCM
- `'ulaw'` - ΞΌ-law PCM
- `'alaw'` - A-law PCM
-- `'ac3'` - Dolby Digital (AC-3)
-- `'eac3'` - Dolby Digital Plus (E-AC-3)
-:::note
-AC-3 and E-AC-3 are not natively supported by WebCodecs.
-Remotion registers a software decoder from [`@mediabunny/ac3`](https://www.npmjs.com/package/@mediabunny/ac3) to enable decoding of these codecs.
-:::
+### AC-3 and E-AC-3<AvailableFrom v="4.0.427"/>
+
+AC-3 (Dolby Digital) and E-AC-3 (Dolby Digital Plus) are not natively supported by WebCodecs and are not enabled by default in [`@remotion/media`](/docs/media).
+
+If you need AC-3/E-AC-3 support, [you can enable it yourself](https://mediabunny.dev/guide/extensions/ac3) by installing and registering the decoder:
+
+```bash
+npx remotion add @mediabunny/ac3
+```
+
+```tsx title="src/Root.tsx"
+import {registerAc3Decoder, registerAc3Encoder} from '@mediabunny/ac3';
+
+registerAc3Decoder();
+registerAc3Encoder();
+```
## Compatibility table
@@ -102,6 +112,10 @@ Not all codecs can be used with all containers. The following table specifies th
| `'ac3'` | βœ“ | βœ“ | βœ“ | | | | | | | βœ“ |
| `'eac3'` | βœ“ | βœ“ | βœ“ | | | | | | | βœ“ |
+:::note
+AC-3 and E-AC-3 entries in the table above require [manual registration](#ac-3-and-e-ac-3) of the `@mediabunny/ac3` decoder.
+:::
+
## CORS
All media files must be either CORS-enabled or served from the bundle using [`staticFile()`](/docs/staticfile).
diff --git a/packages/media/bundle.ts b/packages/media/bundle.ts
index 1e3c593af1..e8e1604e13 100644
--- a/packages/media/bundle.ts
+++ b/packages/media/bundle.ts
@@ -17,7 +17,6 @@ const output = await build({
'react/jsx-dev-runtime',
'react-dom',
'mediabunny',
- '@mediabunny/ac3',
],
});
diff --git a/packages/media/package.json b/packages/media/package.json
index 35bc6dc02c..6be7c465b4 100644
--- a/packages/media/package.json
+++ b/packages/media/package.json
@@ -22,7 +22,6 @@
},
"dependencies": {
"mediabunny": "catalog:",
- "@mediabunny/ac3": "catalog:",
"remotion": "workspace:*"
},
"peerDependencies": {
diff --git a/packages/media/src/index.ts b/packages/media/src/index.ts
index 71f3c206b2..6bc908ec34 100644
--- a/packages/media/src/index.ts
+++ b/packages/media/src/index.ts
@@ -1,4 +1,3 @@
-import {registerAc3Decoder} from '@mediabunny/ac3';
import {Audio} from './audio/audio';
import {Video} from './video/video';
/**
@@ -16,5 +15,3 @@ export {AudioProps, FallbackHtml5AudioProps} from './audio/props';
export {MediaErrorAction} from './on-error';
export {FallbackOffthreadVideoProps, VideoProps} from './video/props';
export {Audio, Video};
-
-registerAc3Decoder();
diff --git a/packages/studio-shared/src/package-info.ts b/packages/studio-shared/src/package-info.ts
index 9644fa91e4..c8e8b94ea6 100644
--- a/packages/studio-shared/src/package-info.ts
+++ b/packages/studio-shared/src/package-info.ts
@@ -102,6 +102,12 @@ export const extraPackages: ExtraPackage[] = [
description: 'Multimedia library used by Remotion',
docsUrl: 'https://www.remotion.dev/docs/mediabunny/version',
},
+ {
+ name: '@mediabunny/ac3',
+ version: '1.34.4',
+ description: 'AC-3 and E-AC-3 audio codec support for Mediabunny',
+ docsUrl: 'https://www.remotion.dev/docs/mediabunny/formats#ac-3-and-e-ac-3',
+ },
{
name: 'zod',
version: '4.3.6',