π₯ Make videos programmatically with React
Media Parser Blog Post + Announcement Bar
Jonny Burgerce18526fdf2f
diff --git a/packages/docs/blog/2025-05-20-media-parser.mdx b/packages/docs/blog/2025-05-20-media-parser.mdxnew file mode 100644index 0000000000..3364a1bc7e--- /dev/null+++ b/packages/docs/blog/2025-05-20-media-parser.mdx@@ -0,0 +1,107 @@+---+slug: media-parser+title: Remotion Media Parser+author: Jonny Burger+author_title: Chief Hacker @ Remotion+author_url: https://github.com/JonnyBurger+author_image_url: https://avatars2.githubusercontent.com/u/1629785?s=460&u=12eb94da6070d00fc924761ce06e3a428d01b7e9&v=4+image: /img/media-parser.png+---++We're taking video even more seriously with our own multimedia library, designed from the ground up for JavaScript and the web!++<iframe+ style={{+ width: '100%',+ aspectRatio: '16 / 9',+ }}+ src="https://www.youtube.com/embed/r3dUGdfVnkM"+ title="YouTube video player"+ frameborder="0"+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"+ allowfullscreen+/>+<br />++[**Remotion Media Parser Docs**](/docs/media-parser)++In short, what does Remotion Media Parser achieve?++### Better metadata retrieval++Get more information from more file formats, faster. An universal API that works on both the server and the client.++You can choose which metadata you want to retrieve, and Media Parser will choose the fastest way.++```tsx twoslash title="Get metadata from a video"+import {parseMedia} from '@remotion/media-parser';++// ---cut---+const result = await parseMedia({+ src: 'https://parser.media/video.mp4',+ fields: {+ durationInSeconds: true,+ dimensions: true,+ fps: true,+ slowKeyframes: true,+ slowVideoBitrate: true,+ isHdr: true,+ videoCodec: true,+ rotation: true,+ numberOfAudioChannels: true,+ sampleRate: true,+ metadata: true,+ },+});++console.log(result.durationInSeconds);+// ^?+```++### Video decoding and processing++Media Parser ties into the WebCodecs API β hardware-accelerated decoding, built right into the browser. Previously hard to use, now made accessible!++<img src="/img/decoding.png" alt="Video decoding" />++```tsx twoslash title="Decode video frames"+import {parseMedia} from '@remotion/media-parser';++// ---cut---+const result = await parseMedia({+ src: 'https://parser.media/video.mp4',+ onVideoTrack: (track) => {+ const videoDecoder = new VideoDecoder({+ output: console.log,+ error: console.error,+ });++ return (sample) => {+ videoDecoder.decode(new EncodedVideoChunk(sample));+ };+ },+});+```++:::note+This is an oversimplified example - you might get performance problems running this code with longer videos because samples are being passed [faster than they can be decoded](/docs/media-parser/webcodecs).+:::++### Unlock new use cases++<img src="/img/webcodecs-use-cases.png" alt="WebCodecs use cases" />++Developers need a better way to work with video on the web.++Media Parser is a foundational library that unlocks many upcoming improvements to Remotion and for the web in general. We will be implementing many of these ideas ourselves, but also invite you to build with Media Parser.++### We built the fastest video converter on the web++Try out [remotion.dev/convert](https://remotion.dev/convert), our web video converter powered by Remotion Media Parser and WebCodecs. Because it works offline and the conversion is hardware-accelerated, it is faster than any other web converter we could find!++<img src="/img/converter.webp" alt="Converter" />++<hr />++- **Upvote Remotion Media Parser on [Product Hunt](https://www.producthunt.com/posts/remotion-media-parser)**+- [**View Docs**](/docs/media-parser)diff --git a/packages/docs/docs/media-parser/index.mdx b/packages/docs/docs/media-parser/index.mdxindex 958fc003e9..79405e27c5 100644--- a/packages/docs/docs/media-parser/index.mdx+++ b/packages/docs/docs/media-parser/index.mdx@@ -8,7 +8,11 @@ import Tabs from '@theme/Tabs';import TabItem from '@theme/TabItem';import {TableOfContents, MediaParserGuideTableOfContents, ReadersTableOfContents, WritersTableOfContents, TypesTableOfContents} from './TableOfContents';-_available from v4.0.190_+# @remotion/media-parser++<img src="/img/media-parser.png" alt="Media Parser" />+<br />+<br />This is a package that parses video and audio files to extract metadata and samples.@@ -25,6 +29,21 @@ Design goals:- [Be able to seek to a different position in a media file](/docs/media-parser/seeking)- No dependencies+## Introduction video++<iframe+ style={{+ width: '100%',+ aspectRatio: '16 / 9',+ }}+ src="https://www.youtube.com/embed/r3dUGdfVnkM"+ title="YouTube video player"+ frameborder="0"+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"+ allowfullscreen+/>+<br />+## Installation<Installation pkg="@remotion/media-parser" />diff --git a/packages/docs/docusaurus.config.js b/packages/docs/docusaurus.config.jsindex e6d3218303..09913d1409 100644--- a/packages/docs/docusaurus.config.js+++ b/packages/docs/docusaurus.config.js@@ -17,6 +17,14 @@ const config = (mode) => ({experimental_faster: true,},themeConfig: {+ announcementBar: {+ id: 'support_us',+ content:+ '<div style="text-align: center; background-color: var(--ifm-navbar-background-color); padding: 10px;"><a href="/blog/media-parser">Announcing Remotion Media Parser</a></div>',+ backgroundColor: 'var(--ifm-navbar-background-color);',+ textColor: 'var(--ifm-navbar-link-color)',+ isCloseable: false,+ },algolia: {appId: 'PLSDUOL1CA',apiKey: '3e42dbd4f895fe93ff5cf40d860c4a85',diff --git a/packages/docs/static/img/converter.webp b/packages/docs/static/img/converter.webpnew file mode 100644index 0000000000..0674e133f8Binary files /dev/null and b/packages/docs/static/img/converter.webp differdiff --git a/packages/docs/static/img/decoding.png b/packages/docs/static/img/decoding.pngnew file mode 100644index 0000000000..dba43b748aBinary files /dev/null and b/packages/docs/static/img/decoding.png differdiff --git a/packages/docs/static/img/media-parser.png b/packages/docs/static/img/media-parser.pngnew file mode 100644index 0000000000..e708b54e50Binary files /dev/null and b/packages/docs/static/img/media-parser.png differdiff --git a/packages/docs/static/img/webcodecs-use-cases.png b/packages/docs/static/img/webcodecs-use-cases.pngnew file mode 100644index 0000000000..d0e2599fafBinary files /dev/null and b/packages/docs/static/img/webcodecs-use-cases.png differdiff --git a/packages/promo-pages/src/components/Homepage.tsx b/packages/promo-pages/src/components/Homepage.tsxindex eafff5cd2f..a4824ae66f 100644--- a/packages/promo-pages/src/components/Homepage.tsx+++ b/packages/promo-pages/src/components/Homepage.tsx@@ -25,7 +25,7 @@ export const NewLanding: React.FC<{return (<ColorModeProvider colorMode={colorMode} setColorMode={setColorMode}><div className="bg-[var(--background)] relative">- <div>+ <div style={{overflow: 'hidden'}}><div><BackgroundAnimation /></div>