@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:
- Support all relevant multimedia containers:
.mp4
,.mov
,.webm
,.mkv
,.avi
,.m3u8
,.ts
,.mp3
,.wav
,.aac
and.flac
. - Easily get various information from multimedia files
- Work in the browser, and server runtimes (Node.js, Bun, Edge, etc.)
- Satisfy your query with minimal fetching
- Functional TypeScript API
- Be useful when passing unsupported media
- Extract samples and enable WebCodecs use cases
- Pausable, resumable and cancellable
- Seeking - continue parsing in a different section of the file (not yet implemented)
- No dependencies
Installation
- npm
- yarn
- pnpm
- bun
npm i --save-exact @remotion/media-parser@4.0.266
pnpm i @remotion/media-parser@4.0.266
bun i @remotion/media-parser@4.0.266
yarn --exact add @remotion/media-parser@4.0.266
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
Getting video metadata
Simple examples of extracting video metadata
Available fields
Information you can get using the media parser
Fast and slow operations
Efficently use parseMedia()
Pause, resume and abort
Steer the parsing process
Extract ID3 tags and EXIF data
Get embedded tags from video files
Format support
What you can parse with Media Parser
Runtime support
Where you can run Media Parser
Foreign file types
Get information from the errors when passing unsupported file types
WebCodecs
How Media Parser integrates with WebCodecs
APIs
The following APIs are available:
parseMedia()
Parse a media file.
downloadAndParseMedia()
Download and parse a media file.
mediaParserController()
Pause, resume and abort the parse.
nodeReader
Read a file from the local file system.
fetchReader
Read a file using
fetch()
.webFileReader
Read a file from
<input type="file">
.nodeWriter
Write a file to the local file system using Node.