Runtime support
@remotion/media-parser
works in the Browser, Node.js and Bun.
However, all of these require some quite modern versions (considered modern as of August 2024).
For parsing
For parsing a video, the following minimum versions are required:
- Node.js: 20.0.0
- Bun 1.0.0
- Chrome 111
- Edge 111
- Safari 16.4
- Firefox 128
For using WebCodecs
WebCodecs support is not tied to @remotion/media-parser
itself, but if you use it to extract samples, you need to use the following minimum versions:
- Chrome 94
- Edge 94
- Safari 16.4 - No support for
AudioDecoder
- Firefox - No support, but in development
To check for AudioDecoder
support, use
ts
const audioDecoderSupported = typeof AudioDecoder !== 'undefined';
ts
const audioDecoderSupported = typeof AudioDecoder !== 'undefined';
To check if a video track can be decoded with WebCodecs, use
Checking if a video track can be decodedts
import {OnVideoTrack } from '@remotion/media-parser';constonVideoTrack :OnVideoTrack = async (track ) => {const {supported } = awaitVideoDecoder .isConfigSupported (track );if (!supported ) {// Don't receive unsupported video samplesreturn null;}return (videoSample ) => {console .log ('New video sample !',videoSample );// Accept video sample}}
Checking if a video track can be decodedts
import {OnVideoTrack } from '@remotion/media-parser';constonVideoTrack :OnVideoTrack = async (track ) => {const {supported } = awaitVideoDecoder .isConfigSupported (track );if (!supported ) {// Don't receive unsupported video samplesreturn null;}return (videoSample ) => {console .log ('New video sample !',videoSample );// Accept video sample}}
Checking if a audio track can be decodedts
import {OnAudioTrack } from '@remotion/media-parser';constonAudioTrack :OnAudioTrack = async (track ) => {const {supported } = awaitAudioDecoder .isConfigSupported (track );if (!supported ) {// Don't receive unsupported audio samplesreturn null;}return (audioSample ) => {console .log ('New audio sample!',audioSample );// Accept audio sample}}
Checking if a audio track can be decodedts
import {OnAudioTrack } from '@remotion/media-parser';constonAudioTrack :OnAudioTrack = async (track ) => {const {supported } = awaitAudioDecoder .isConfigSupported (track );if (!supported ) {// Don't receive unsupported audio samplesreturn null;}return (audioSample ) => {console .log ('New audio sample!',audioSample );// Accept audio sample}}