Skip to content

🎥 Make videos programmatically with React

document config

Jonny Burger7f01e4883963
diff --git a/packages/core/src/config.ts b/packages/core/src/config.ts
index db2c36e497..7b3a6b9b7c 100644
--- a/packages/core/src/config.ts
+++ b/packages/core/src/config.ts
@@ -34,6 +34,10 @@ type FlatConfig = ObjectConfig['Bundling'] &
ObjectConfig['Puppeteer'] &
ObjectConfig['Output'] &
ObjectConfig['Rendering'] & {
+ /**
+ * Set the audio codec to use for the output video.
+ * See the Encoding guide in the docs for defaults and available options.
+ */
setAudioCodec: (codec: 'pcm-16' | 'aac' | 'mp3' | 'opus') => void;
};
diff --git a/packages/docs/docs/config.md b/packages/docs/docs/config.md
index fb52814a16..fda3569a8b 100644
--- a/packages/docs/docs/config.md
+++ b/packages/docs/docs/config.md
@@ -520,7 +520,6 @@ Choose one of the supported codecs: `h264` _(default)_, `h265`, `vp8`, `vp9`.
- `mp3` will export audio only as an MP3 file _(available from v2.0)_
- `wav` will export audio only as an WAV file _(available from v2.0)_
- `aac` will export audio only as an AAC file _(available from v2.0)_
-- `mkv` will export using H264 codec, MKV container format and WAV audio codec. _(available from v2.1.12)_
```ts twoslash title="remotion.config.ts"
import { Config } from "remotion";
@@ -532,6 +531,25 @@ The [command line flag](/docs/cli/render#--codec) `--codec` will take precedence
**See also**: [Encoding guide](/docs/encoding)
+## setAudioCodec()
+
+```ts twoslash title="remotion.config.ts"
+import { Config } from "remotion";
+// ---cut---
+Config.setAudioCodec("pcm-16");
+```
+
+Choose the encoding of your audio.
+
+- The default is dependent on the chosen `codec`.
+- Choose `pcm-16` if you need uncompressed audio.
+- Not all video containers support all audio codecs.
+- This option takes precedence if the `codec` option also specifies an audio codec.
+
+The [command line flag](/docs/cli/render#--audio-codec) `--audio-codec` will take precedence over this option.
+
+Refer to the [Encoding guide](/docs/encoding) to see defaults and supported combinations.
+
## setProResProfile()
_Available from Version 2.1.6._
diff --git a/packages/docs/docs/lambda/rendermediaonlambda.md b/packages/docs/docs/lambda/rendermediaonlambda.md
index f7c4d49f2d..9bc295ab0b 100644
--- a/packages/docs/docs/lambda/rendermediaonlambda.md
+++ b/packages/docs/docs/lambda/rendermediaonlambda.md
@@ -103,8 +103,8 @@ _"pcm-16" | "aac" | "mp3" | "opus", available from v3.3.41_
Choose the encoding of your audio.
- Each Lambda chunk might actually choose an uncompressed codec and convert it in the final encoding stage to prevent audio artifacts.
-- Default is dependent on the chosen `codec`
-- Choose `pcm-16` if you need uncompressed audio
+- The default is dependent on the chosen `codec`.
+- Choose `pcm-16` if you need uncompressed audio.
- Not all video containers support all audio codecs.
- This option takes precedence if the `codec` option also specifies an audio codec.
diff --git a/packages/docs/docs/renderer/render-media.md b/packages/docs/docs/renderer/render-media.md
index 85507e006a..263bb76592 100644
--- a/packages/docs/docs/renderer/render-media.md
+++ b/packages/docs/docs/renderer/render-media.md
@@ -49,8 +49,8 @@ _"pcm-16" | "aac" | "mp3" | "opus", available from v3.3.41_
Choose the encoding of your audio.
-- Default is dependent on the chosen `codec`
-- Choose `pcm-16` if you need uncompressed audio
+- The default is dependent on the chosen `codec`.
+- Choose `pcm-16` if you need uncompressed audio.
- Not all video containers support all audio codecs.
- This option takes precedence if the `codec` option also specifies an audio codec.
diff --git a/packages/docs/docs/renderer/stitch-frames-to-video.md b/packages/docs/docs/renderer/stitch-frames-to-video.md
index 889828df6b..f156c5bfed 100644
--- a/packages/docs/docs/renderer/stitch-frames-to-video.md
+++ b/packages/docs/docs/renderer/stitch-frames-to-video.md
@@ -69,8 +69,8 @@ _"pcm-16" | "aac" | "mp3" | "opus", available from v3.3.41_
Choose the encoding of your audio.
-- Default is dependent on the chosen `codec`
-- Choose `pcm-16` if you need uncompressed audio
+- The default is dependent on the chosen `codec`.
+- Choose `pcm-16` if you need uncompressed audio.
- Not all video containers support all audio codecs.
- This option takes precedence if the `codec` option also specifies an audio codec.