ya-webadb/libraries/scrcpy-decoder-webcodecs
2023-01-20 14:03:09 +08:00
..
src feat(decoder): disable VSync 2023-01-20 14:02:44 +08:00
.eslintrc.cjs chore: integrate ESLint 2022-12-22 01:42:24 +08:00
.npmignore chore: integrate ESLint 2022-12-22 01:42:24 +08:00
CHANGELOG.json v0.0.17 2022-10-18 17:46:19 +08:00
CHANGELOG.md v0.0.17 2022-10-18 17:46:19 +08:00
jest.config.js chore: update jest config 2022-11-16 00:42:53 +08:00
LICENSE chore: update license year 2023-01-13 02:02:31 +08:00
package.json doc: update README and comments 2023-01-20 14:03:09 +08:00
README.md doc: update README and comments 2023-01-20 14:03:09 +08:00
tsconfig.build.json chore: integrate ESLint 2022-12-22 01:42:24 +08:00
tsconfig.json refactor(scrcpy): move decoders to own packages 2022-07-19 16:36:34 +08:00
tsconfig.test.json chore: integrate ESLint 2022-12-22 01:42:24 +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. If you have any questions, please open an issue.

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(() => {});