A modern JavaScript implementation of RFC8794 (EBML).
Go to file
2025-03-21 01:53:06 +08:00
assets feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
examples fix: fix master tag type 2025-03-18 02:46:18 +08:00
media feat: first step 2025-03-16 00:22:42 +08:00
scripts feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
src feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
tests feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
.gitignore feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
biome.jsonc feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
LICENSE feat: first step 2025-03-16 00:22:42 +08:00
package.json feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
pnpm-lock.yaml feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
README.md feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
rslib.config.ts feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
tsconfig.base.json fix: fix master tag type 2025-03-18 02:46:18 +08:00
tsconfig.example.json fix: fix master tag type 2025-03-18 02:46:18 +08:00
tsconfig.json feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
tsconfig.lib.json feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
tsconfig.scripts.json feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00
tsconfig.spec.json fix: fix master tag type 2025-03-18 02:46:18 +08:00
vitest.config.ts feat: support matroska v4 and add codegen 2025-03-21 01:53:06 +08:00

logo
Konoebml
version-badge status-badge

A modern JavaScript implementation of RFC8794 (EBML).

Note

EBML stands for Extensible Binary Meta-Language and is somewhat of a binary version of XML. It's used for container formats like WebM or MKV.

This package is serving as a fork with extensive rewrites and enhancements to ebml-web-stream and ebml-stream, providing:

Install

Install via NPM:

npm install konoebml

Usage and Examples

This example reads a media file into memory and decodes it.

import fs from 'node:fs/promises';
import {
  ReadableStream,
  WritableStream,
  type TransformStream,
} from 'node:stream/web';
import { EbmlStreamDecoder } from 'konoebml';

async function main() {
  const fileBuffer = await fs.readFile('media/test.webm');
  await new ReadableStream({
    pull(controller) {
      controller.enqueue(fileBuffer);
      controller.close();
    },
  })
    .pipeThrough(new EbmlStreamDecoder() as unknown as TransformStream)
    .pipeTo(new WritableStream({ write: console.log }));
}

main();

Todo: add more docs and tests

State of this project

Parsing and writing should both work. If something is broken, please create an issue.

Any additional feature requests can also be submitted as an issue.

If any well-known tags have special parsing/encoding rules or data structures that aren't implemented, pull requests are welcome!

License

MIT

Other Contributors

(in alphabetical order)