Get to know MDN better
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Note: This feature is only available in Dedicated Web Workers.
The Insertable Streams for MediaStreamTrack API provides a way to process the video frames of a MediaStreamTrack as they are consumed.
When processing real-time video, you sometimes want to insert visual elements or otherwise process the stream of video frames. For example, an application might include two tracks that need to be combined, such as a weather map and video of a presenter explaining the map. Or, you may want to do processing on a track to blur backgrounds, or introduce other elements (such as adding funny hats to people, and so on). The APIs described here provide direct access to the video stream, allowing you to manipulate it in real time.
To ensure optimal performance, the APIs are only available in dedicated workers (unless otherwise stated).
Consumes a MediaStreamTrack object's source and produces a stream of video frames.
VideoTrackGeneratorCreates a WritableStream that acts as a MediaStreamTrack video source.
MediaStreamTrackGeneratorCreates a WritableStream that acts as a MediaStreamTrack source for either video or audio. Only available on the main thread.
The following example is from the article Unbundling MediaStreamTrackProcessor and VideoTrackGenerator. It transfers a camera MediaStreamTrack to a worker for processing. The worker creates a pipeline that applies a sepia tone filter to the video frames and mirrors them. The pipeline culminates in a VideoTrackGenerator whose MediaStreamTrack is transferred back and played. The media now flows in real time through the transform off the main thread.
worker.js:
| MediaStreamTrack Insertable Media Processing using Streams |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 14, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.