ya-webadb/libraries/scrcpy-decoder-webcodecs
2024-06-23 05:28:50 +08:00
..
src feat: support render to offscreen canvas 2024-06-20 17:20:38 +08:00
.npmignore chore: integrate ESLint 2022-12-22 01:42:24 +08:00
CHANGELOG.json chore: bump version to 0.0.24 2024-06-18 10:54:42 +08:00
CHANGELOG.md chore: bump version to 0.0.24 2024-06-18 10:54:42 +08:00
jest.config.js chore: update dependencies 2023-07-07 18:30:13 +08:00
LICENSE chore: update license 2024-05-10 08:13:52 +08:00
package.json chore: update dependencies 2024-06-23 05:28:50 +08:00
README.md feat(scrcpy): support Scrcpy 2.0 (#495) 2023-04-15 19:50:46 +08:00
tsconfig.build.json chore: remove dependency on @types/dom-webcodecs 2023-09-28 14:44:40 +08:00
tsconfig.json feat: add utilities for read/write Uint8Array 2024-04-16 22:17:36 +08:00
tsconfig.test.json chore: remove dependency on @types/dom-webcodecs 2023-09-28 14:44:40 +08:00

@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

Chrome Firefox Safari Performance Supported H.264 profile/level
94 No No High with hardware acceleration High 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(() => {});