Matroska and EBML Schema Definitions

2.1.0 · maintenance · verified Wed Apr 22

This package, `matroska-schema`, provides the official Matroska and EBML (Extensible Binary Meta Language) schema definitions for JavaScript environments. It serves as an MIT-licensed alternative to the previously GPL-licensed `schema.js` embedded within the `node-matroska` project, addressing licensing compatibility concerns for developers. The schema is automatically generated directly from the latest Matroska and EBML specifications maintained by the IETF-WG-CELLAR group, ensuring it remains current with the evolving standards for multimedia container formats. Currently at version 2.1.0, the package's release cadence is directly tied to updates in the upstream specifications, providing a reliable and permissively licensed data structure for libraries that parse, validate, or generate Matroska files, such as `node-matroska` or `node-ebml`.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to import the Matroska schema and access a specific element definition within it.

import matroskaSchema from 'matroska-schema';

console.log('Successfully loaded Matroska schema. Total entries:', matroskaSchema.length);

// Example: Find the 'Segment' top-level element definition
const segmentElement = matroskaSchema.find(entry => entry.name === 'Segment');

if (segmentElement) {
  console.log('Found Segment element:', segmentElement.name, 'ID:', segmentElement.id.toString(16));
  console.log('Segment element description:', segmentElement.description.substring(0, 70) + '...');
} else {
  console.log('Segment element not found in schema.');
}

// To see a specific part of the schema, e.g., the EBML Header definition
const ebmlHeader = matroskaSchema.find(entry => entry.name === 'EBMLHeader');
if (ebmlHeader) {
    console.log('\nEBMLHeader definition:');
    console.dir(ebmlHeader, { depth: 2 });
}

view raw JSON →