Skip to content

🎥 Make videos programmatically with React

update MP4 codec docs

Jonny Burger034f5f12d71d
diff --git a/packages/docs/docs/importing-assets.md b/packages/docs/docs/importing-assets.md
index 49b900ea18..ab66f85a56 100644
--- a/packages/docs/docs/importing-assets.md
+++ b/packages/docs/docs/importing-assets.md
@@ -6,7 +6,7 @@ title: Importing assets
Remotion allows you to include several types of files in your project:
- Images (`.png`, `.svg`, `.jpg`, `.jpeg`, `.webp`, `.gif`, `.bmp`)
-- Videos (`.webm`, `.mp4`), with constraints
+- Videos (`.webm`, `.mp4`)
- Audio (`.mp3`, `.wav`, `.aac`), preview only
- [Fonts (`.woff` and `.woff2`) - read the separate page for fonts](fonts)
@@ -69,9 +69,7 @@ export const MyComp: React.FC = () => {
}
```
-:::info
-Since Puppeteer doesn't include the proprietary codec to read MP4 videos, you must convert your videos to WebM before rendering.
-:::
+Be aware that if you are rendering using Chromium (as opposed to Chrome), the codec for MP4 videos is not included. Read the section on the [`<Video/ >`](/docs/video#codec-support) page for more information.
## Using Audio
diff --git a/packages/docs/docs/video.md b/packages/docs/docs/video.md
index 2314f27151..658228a11c 100644
--- a/packages/docs/docs/video.md
+++ b/packages/docs/docs/video.md
@@ -5,12 +5,8 @@ id: video
This component allows you to include a video file in your Remtotion project. While in the preview, the video will just play in a HTML5 `<video>` tag, during render, the exact frame needed will be extracted.
-:::info
-Please note that while H.264 video (the codec of MP4 videos) will show up during Preview, it will not work during render unless you sets custom puppeteer browser executable using command line `--browser-executable` or [configure](config#setbrowserexecutable) `Config.Puppeteer.setBrowserExecutable()` in remotion config file. This is because by default Puppeteer with Chromium is used during rendering, which does not ship with H.264 codecs.
-:::
-
:::warning
-Videos with audio are not supported - audio will be muted in the final render.
+Videos with audio are not supported - yet! Audio will be muted in the final render.
:::
## API / Example
@@ -34,6 +30,17 @@ export const MyVideo = () => {
}
```
+## Codec support
+
+Pay attention to the codec of the video that you are importing. During the render process, Chrome needs to support playing the video that you are embedding. If Remotion cannot find a preinstalled version of Chrome, it will download a Chromium executable which does not support the playback of H264 (common codec for MP4 videos). To work around this problem, you have multiple options:
+
+- Tell Remotion which path for Chrome to use by using the command line flag `--browser-executable` or [configure](config#setbrowserexecutable) `Config.Puppeteer.setBrowserExecutable()` in a config file.
+- Convert your videos to WebM before embedding them.
+
+Prior to Remotion 1.5, Remotion will always use an internal Puppeteer binary and MP4 videos are therefore not supported.
+
+If you would like Remotion to warn you when you import an MP4 video, you can turn on the `@remotion/no-mp4-import` ESLint rule.
+
## See also
- [`<Audio />`](audio)
diff --git a/packages/eslint-config/src/index.ts b/packages/eslint-config/src/index.ts
index 0c4a339791..3cbc3490e2 100644
--- a/packages/eslint-config/src/index.ts
+++ b/packages/eslint-config/src/index.ts
@@ -37,6 +37,7 @@ const getRules = (typescript: boolean) => {
},
],
// Enable Remotion specific rules
+ "@remotion/no-mp4-import": "off",
"@remotion/warn-native-media-tag": "warn",
"@remotion/deterministic-randomness": "warn",
"@remotion/no-string-assets": "warn",