Skip to main content

@remotion/media-parser

available from v4.0.190

This is a package that parses video and audio files to extract metadata and samples.

warning

Unstable API: This package is experimental. The API may change in the future.
The API for getting video metadata is stable and may be used in production.

Design goals:

Installation

npm i --save-exact @remotion/media-parser@4.0.271
This assumes you are currently using v4.0.271 of Remotion.
Also update remotion and all `@remotion/*` packages to the same version.
Remove all ^ character in front of the version numbers of it as it can lead to a version conflict.

Guide

APIs

The following APIs are available:

Readers

Choose the appropriate reader for your file source:

Writers

Choose how to store files downloaded using downloadAndParseMedia():

How does this compare to FFmpeg?

FFmpeg generally is a more mature software and carries more capabilities.
We advise you to use it always if you don't need to call it from JavaScript.

We built @remotion/media-parser with the focus on making it work well on the web:

  • Importing this library is a lot lighter than FFmpeg.wasm, which loads at least 10MB.
  • Functional, promise-based API
  • Direct integration and intentional usage of JavaScript APIs like fetch(), File, Worker, AbortController, node:fs, resizable ArrayBuffer
  • Samples are returned in a WebCodecs-compatible format, which makes it easier to decode them in the browser with full hardware acceleration.

How does this compare to MP4Box.js?

We aim to support more container formats than MP4Box.js, so that multimedia files of any kind can be passed in.
MP4Box.js focuses on the ISO Base Media Format and supports reading more boxes, however it does not support reading other container formats.

Thank you

Tella for boosting the development of @remotion/media-parser with $10.000!

License

Remotion License