
Media Parser - A modern multimedia library for JavaScript | Remotion YouTube Video Summary
Jonny Burger from Remotion introduces the Remotion Media Parser, a modern, dependency-free multimedia library for JavaScript designed for both frontend and backend use. It is efficient and designed to stream media for metadata extraction, samples, and waveforms, and it supports a variety of formats with one unified API. It is also designed to take advantage of built-in browser APIs and is made with web codecs in mind
Detailed Summary:
Introduction to Remotion Media Parser
Jonny Burger, Chief Hacker at Remotion, introduces Remotion Media Parser, a multimedia library created for the web. The library is designed from the ground up, promising deeper media understanding than ever before.
Getting Video Metadata
Remotion Media Parser is useful for extracting metadata from video files, including duration and dimensions. It supports frame rates, keyframes, bitrates, identifying HDR videos, video codec, rotation, number of audio channels, and more.
Wide Format Support and Browser Compatibility
The parser supports a broader range of formats compared to what is typically supported by browsers. It works not just in browsers, including Chrome, Firefox and Safari, but also in Node.js and Bun.
Efficiency and Streaming Capabilities
Designed to only read the necessary data, the Remotion Media Parser works by only reading the minimum amount of data needed to satisfy a particular query and doesn't require the whole buffer to be present in the computer's memory. Whenever possible, data is streamed, making it both fast and efficient, even with larger files.
Extracting Frames and Waveforms
The library allows the extraction of audio and video samples, enabling users to get waveforms from audio or samples, with video codecs such as H.264, and turning them into images and waveforms.
WebCodecs API Integration
The Remotion Media Parser is designed with WebCodecs in mind, offering samples in the exact format expected by video and audio decoder APIs. This integration aims to lower the barrier of entry for using WebCodecs.
Use Cases and MP4 to WebM Converter
Using the Remotion Media Parser, Remotion has built the first client-side WebCodecs-based MP4 to WebM converter. Taking advantage of WebCodecs' hardware acceleration, conversions with Remotion become three to fifteen times faster than Web Assembly based solutions. This is possible due to new modern browser support for web codecs, which offer hardware acceleration that speeds up the rendering and encoding processes.
Working with Callbacks and Controllers
The Remotion Media Parser is designed to take advantage of JavaScript asynchronous nature with controllers, making it possible to pause, resume, abort, or seek a different time stamp. Callbacks, can be defined to be executed when new metadata is retrieved and will be awaited by the parser for predictable and consistent control flow.
Web Worker Support
To prevent blocking the UI thread, the parser provides support for running it on a web worker with the same API and behavior.
Media Format Probing
Remotion Media Parser also enables the use of downloading and parsing, while downloading user-provided videos onto the server to reject files that do not match the needs of the user in terms of duration or incorrect formats.
The parser can also determine if there is a PDF for example, with images, and can detect the format and size of that image and other filetypes.
License and Business Model
The Remotion Media Parser is released under the Remotion License, making it free for teams of up to three people. A commercial license is required for larger teams and is self-serve.
Acknowledgements
Remotion thanks Tella.com for their technical and financial support, sponsoring Remotion, for trusting the company and its project, and their help in getting Remotion Media Parser to this stage.
Conclusion
The new multimedia library for JavaScript runs on the web in Node.js and Bun. Remotion Media Parser embraces web standards and is meant for fine-grained querying, minimal data fetching, and easy streaming.