Skip to content

🎥 Make videos programmatically with React

nice

Jonny Burger62cc4188b6bf
diff --git a/packages/docs/docs/media-parser/foreign-file-types.mdx b/packages/docs/docs/media-parser/foreign-file-types.mdx
index fba1d9474c..58279c105d 100644
--- a/packages/docs/docs/media-parser/foreign-file-types.mdx
+++ b/packages/docs/docs/media-parser/foreign-file-types.mdx
@@ -29,7 +29,12 @@ try {
});
} catch (e) {
if (e instanceof IsAnImageError) {
- console.log('The file is an image of format:', e.imageType, 'dimensions:' e.dimensions);
+ console.log(
+ 'The file is an image of format:',
+ e.imageType,
+ 'dimensions:',
+ e.dimensions,
+ );
} else if (e instanceof IsAGifError) {
console.log('The file is a GIF');
} else if (e instanceof IsAPdfError) {
diff --git a/packages/docs/docs/media-parser/webcodecs.mdx b/packages/docs/docs/media-parser/webcodecs.mdx
index 2df63180f3..57eaef5d6f 100644
--- a/packages/docs/docs/media-parser/webcodecs.mdx
+++ b/packages/docs/docs/media-parser/webcodecs.mdx
@@ -13,7 +13,17 @@ crumb: '@remotion/media-parser'
**Unstable API**: This package is experimental. We might change the API at any time, until we remove this notice.
:::
-## Minimal example
+## With `@remotion/webcodecs`
+
+[`@remotion/webcodecs`](/docs/webcodecs) is a package that uses `@remotion/media-parser` to provide video processing in the browser.
+It handles various browser quirks and hard implementation details for you.
+
+We recommend it if you want to build a solution based on WebCodecs.
+It is a higher-level API that is easier to use than `@remotion/media-parser`.
+
+## Using `@remotion/media-parser`
+
+`@remotion/media-parser` is a lower-level API that allows you to interface with WebCodecs directly.
```tsx twoslash title="Reading video frames"
// @module: es2022
diff --git a/packages/docs/docs/webcodecs/TableOfContents.tsx b/packages/docs/docs/webcodecs/TableOfContents.tsx
index 612f53b1bb..c0ad3da2aa 100644
--- a/packages/docs/docs/webcodecs/TableOfContents.tsx
+++ b/packages/docs/docs/webcodecs/TableOfContents.tsx
@@ -2,6 +2,27 @@ import React from 'react';
import {Grid} from '../../components/TableOfContents/Grid';
import {TOCItem} from '../../components/TableOfContents/TOCItem';
+export const WebCodecsGuide: React.FC = () => {
+ return (
+ <div>
+ <Grid>
+ <TOCItem link="/docs/webcodecs/convert-a-video">
+ <strong>Convert a video</strong>
+ <div>from one format to another</div>
+ </TOCItem>
+ <TOCItem link="/docs/webcodecs/rotate-a-video">
+ <strong>Rotate a video</strong>
+ <div>Fix bad orientation</div>
+ </TOCItem>
+ <TOCItem link="/docs/webcodecs/fix-mediarecorder-video">
+ <strong>Fix a MediaRecorder video</strong>
+ <div>Fix missing video duration and poor seeking performance</div>
+ </TOCItem>
+ </Grid>
+ </div>
+ );
+};
+
export const TableOfContents: React.FC = () => {
return (
<div>
diff --git a/packages/docs/docs/webcodecs/index.mdx b/packages/docs/docs/webcodecs/index.mdx
index 41bbb24668..3d3c154988 100644
--- a/packages/docs/docs/webcodecs/index.mdx
+++ b/packages/docs/docs/webcodecs/index.mdx
@@ -6,7 +6,7 @@ title: '@remotion/webcodecs'
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
-import {TableOfContents} from './TableOfContents';
+import {TableOfContents, WebCodecsGuide} from './TableOfContents';
_available from v4.0.229_
@@ -20,11 +20,11 @@ import {UnstableDisclaimer} from './UnstableDisclaimer';
In browsers that implement WebCodecs, you can use this package to:
-- Convert videos from one format to another (.mp4 and .webm bidirectional, .avi, .mkv, .mov as import)
+- [Convert videos from one format to another](/docs/webcodecs/convert-a-video) (.mp4 and .webm bidirectional, .avi, .mkv, .mov as import)
- [Rotate videos](/docs/webcodecs/rotate-a-video)
- Extract audio from a video
- Manipulate the pixels of a video
-- Fix videos that were recorded with `MediaRecorder`
+- [Fix videos that were recorded with `MediaRecorder`](/docs/webcodecs/fix-mediarecorder-video)
- Soon: Compress, trim, crop videos
## 💼 License Disclaimer
@@ -39,6 +39,10 @@ In browsers that implement WebCodecs, you can use this package to:
<Installation pkg="@remotion/webcodecs" />
+## Guide
+
+<WebCodecsGuide />
+
## APIs
The following APIs are available:
diff --git a/packages/docs/sidebars.js b/packages/docs/sidebars.js
index 3b6735fce7..09f515ac88 100644
--- a/packages/docs/sidebars.js
+++ b/packages/docs/sidebars.js
@@ -577,7 +577,11 @@ module.exports = {
id: 'webcodecs/index',
},
items: [
- 'webcodecs/index',
+ {
+ type: 'link',
+ href: '/docs/webcodecs/convert-a-video',
+ label: 'Guide',
+ },
'webcodecs/track-transformation',
'webcodecs/convert-media',
'webcodecs/get-available-containers',
@@ -910,7 +914,16 @@ module.exports = {
{
type: 'category',
label: 'WebCodecs',
+ link: {
+ type: 'doc',
+ id: 'webcodecs/index',
+ },
items: [
+ {
+ type: 'link',
+ href: '/docs/webcodecs/convert-media',
+ label: 'API Reference',
+ },
'webcodecs/convert-a-video',
'webcodecs/rotate-a-video',
'webcodecs/fix-mediarecorder-video',