Skip to main content

Processing video with WebCodecs and @remotion/media-parser

parseMedia() is able to extract tracks and samples from audio and video in a format that is suitable for usage with WebCodecs APIs.

Minimal example

The following snippet is a basic, non-production ready example of how to use parseMedia() with WebCodecs.

Reading video frames
tsx
// ⚠️ Simple, but non-production ready example
import {parseMedia, MediaParserOnAudioTrack, MediaParserOnVideoTrack} from '@remotion/media-parser';
 
const result = await parseMedia({
src: 'https://remotion.media/video.mp4',
onVideoTrack: ({track}) => {
const decoder = new VideoDecoder({
output: console.log,
error: console.