Skip to main content

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 decoded
ts
import {OnVideoTrack} from '@remotion/media-parser';
 
const onVideoTrack: OnVideoTrack = async (track) => {
const {supported} = await VideoDecoder.isConfigSupported(track);
 
if (!supported) {
// Don't receive unsupported video samples
return null;
}
 
return (videoSample) => {
console.log('New video sample !', videoSample);
// Accept video sample
}
}
Checking if a video track can be decoded
ts
import {OnVideoTrack} from '@remotion/media-parser';
 
const onVideoTrack: OnVideoTrack = async (track) => {
const {supported} = await VideoDecoder.isConfigSupported(track);
 
if (!supported) {
// Don't receive unsupported video samples
return null;
}
 
return (videoSample) => {
console.log('New video sample !', videoSample);
// Accept video sample
}
}
Checking if a audio track can be decoded
ts
import {OnAudioTrack} from '@remotion/media-parser';
 
const onAudioTrack: OnAudioTrack = async (track) => {
const {supported} = await AudioDecoder.isConfigSupported(track);
 
if (!supported) {
// Don't receive unsupported audio samples
return null;
}
 
return (audioSample) => {
console.log('New audio sample!', audioSample);
// Accept audio sample
}
}
Checking if a audio track can be decoded
ts
import {OnAudioTrack} from '@remotion/media-parser';
 
const onAudioTrack: OnAudioTrack = async (track) => {
const {supported} = await AudioDecoder.isConfigSupported(track);
 
if (!supported) {
// Don't receive unsupported audio samples
return null;
}
 
return (audioSample) => {
console.log('New audio sample!', audioSample);
// Accept audio sample
}
}