@mediabunny/prores
v1.50.9
Published
Apple ProRes decoder extension for Mediabunny, based on TurboRes.
Maintainers
Readme
@mediabunny/prores
Browsers have no support for Apple ProRes in their WebCodecs implementations. This extension package provides a decoder for use with Mediabunny, allowing you to decode ProRes directly in the browser at unprecedented speed. It is implemented using Mediabunny's custom coder API and uses TurboRes, an extremely fast WASM-based ProRes decoder, under the hood.
This package, like the rest of Mediabunny, is enabled by its sponsors and their donations. If you've derived value from this package, please consider leaving a donation! 💘
Installation
This library peer-depends on Mediabunny. Install both using npm:
npm install mediabunny @mediabunny/proresAlternatively, directly include them using a script tag:
<script src="mediabunny.js"></script>
<script src="mediabunny-prores.js"></script>This will expose the global objects Mediabunny and MediabunnyProres. Use mediabunny-prores.d.ts to provide types for these globals. You can download the built distribution files from the releases page.
Setup
@mediabunny/prores can make use of shared-memory multithreading to achieve maximum performance. To enable this in browsers, your website must be cross-origin isolated by setting the following response headers:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corpAlternatively, you can use:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: credentiallesswhich is generally more permissive but is not supported in Safari (of course).
If you cannot enable cross-origin isolation, @mediabunny/prores will fall back to a slower multithreading algorithm.
Usage
import { registerProresDecoder } from '@mediabunny/prores';
registerProresDecoder();That's it - Mediabunny now uses the registered ProRes decoder automatically.
For all the ways of using Mediabunny, refer to its guide.
Building and development
The complete JavaScript package can be built alongside the rest of Mediabunny by running npm run build in Mediabunny's root.
