0.0.23 • Published 1 month ago

@yume-chan/scrcpy-decoder-webcodecs v0.0.23

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

@yume-chan/scrcpy-decoder-webcodecs

Decode and render H.264 streams using the WebCodecs API.

It has no dependencies and high performance, but is only available on recent versions of Chrome.

WARNING: The public API is UNSTABLE. Open a GitHub discussion if you have any questions.

Compatibility

ChromeFirefoxSafariPerformanceSupported H.264 profile/level
94NoNoHigh with hardware accelerationHigh level 5

Usage

It draws frames onto decoder.renderer (a <canvas> element), you can insert it anywhere you want to display the video.

const decoder = new WebCodecsDecoder();
document.body.appendChild(decoder.renderer);

videoPacketStream // from `@yume-chan/scrcpy`
    .pipeTo(decoder.writable)
    .catch(() => {});