Movatterモバイル変換


[0]ホーム

URL:


RFC 8794EBMLJuly 2020
Lhomme, et al.Standards Track[Page]
Stream:
Internet Engineering Task Force (IETF)
RFC:
8794
Category:
Standards Track
Published:
ISSN:
2070-1721
Authors:
S. Lhomme
D. Rice
M. Bunkus

RFC 8794

Extensible Binary Meta Language

Abstract

This document defines the Extensible Binary Meta Language (EBML) format as a binary container format designed for audio/video storage. EBML is designed as a binary equivalent to XML and uses a storage-efficient approach to build nested Elements with identifiers, lengths, and values. Similar to how an XML Schema defines the structure and semantics of an XML Document, this document defines how EBML Schemas are created to convey the semantics of an EBML Document.

Status of This Memo

This is an Internet Standards Track document.

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841.

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained athttps://www.rfc-editor.org/info/rfc8794.

Copyright Notice

Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

Table of Contents

1.Introduction

EBML, short for Extensible Binary Meta Language, specifies a binary formataligned with octets (bytes) and inspired by the principle of XML (a framework forstructuring data).

The goal of this document is to define a generic, binary, space-efficientformat that can be used to define more complex formats using an EBMLSchema. EBML is used by the multimedia container, Matroska[Matroska]. The applicability of EBML for otheruse cases is beyond the scope of this document.

The definition of the EBML format recognizes the idea behind HTML and XMLas a good one: separate structure and semantics allowing the same structurallayer to be used with multiple, possibly widely differing, semanticlayers. Except for the EBML Header and a few Global Elements, thisspecification does not define particular EBML format semantics; however, thisspecification is intended to define how other EBML-based formats can bedefined, such as the audio/video container formats Matroska and WebM[WebM].

EBML uses a simple approach of building Elements upon three pieces of data (tag, length, and value), as this approach is well known, easy to parse, and allows selective data parsing. The EBML structure additionally allows for hierarchical arrangement to support complex structural formats in an efficient manner.

A typical EBML file has the following structure:

EBML Header (master)  + DocType (string)  + DocTypeVersion (unsigned integer)EBML Body Root (master)  + ElementA (utf-8)  + Parent (master)    + ElementB (integer)  + Parent (master)    + ElementB (integer)

2.Notation and Conventions

The key words "MUST", "MUST NOT","REQUIRED", "SHALL", "SHALL NOT","SHOULD", "SHOULD NOT","RECOMMENDED", "NOT RECOMMENDED","MAY", and "OPTIONAL" in this document are to be interpreted asdescribed in BCP 14[RFC2119][RFC8174]when, and only when, they appear in all capitals, as shown here.

This document defines specific terms in order to define the format andapplication ofEBML. Specific terms are defined below:

EBML:
Extensible Binary Meta Language
EBML Document Type:
A name provided by anEBML Schema to designate a particularimplementation ofEBML for a data format (e.g., Matroska and WebM).
EBML Schema:
A standardized definition for the structure of anEBML Document Type.
EBML Document:
A datastream comprised of only two components, anEBML Header andanEBML Body.
EBML Reader:
A data parser that interprets the semantics of anEBML Documentand creates a way for programs to useEBML.
EBML Stream:
A file that consists of one or moreEBML Documents that areconcatenated together.
EBML Header:
A declaration that provides processing instructions and identification oftheEBML Body. TheEBML Header is analogous to an XML Declaration[XML] (see Section 2.8 on "Prolog and Document Type Declaration").
EBML Body:
All data of anEBML Document following theEBML Header.
Variable-Size Integer:
A compact variable-length binary value that defines its own length.
VINT:
Also known asVariable-Size Integer.
EBML Element:
A foundation block of data that contains three parts: anElement ID,anElement Data Size, andElement Data.
Element ID:
A binary value, encoded as aVariable-Size Integer,used to uniquely identify a definedEBML Element within a specificEBML Schema.
Element Data Size:
An expression, encoded as aVariable-Size Integer, of the lengthin octets ofElement Data.
VINTMAX:
The maximum possible value that can be stored asElement Data Size.
Unknown-Sized Element:
AnElement with an unknownElement Data Size.
Element Data:
The value(s) of theEBML Element, which is identified by itsElement ID andElement Data Size. The form of theElement Data isdefined by this document and the correspondingEBML Schema of theElement'sEBML Document Type.
Root Level:
The starting level in the hierarchy of anEBML Document.
Root Element:
A mandatory, nonrepeatingEBML Element that occurs at the toplevel of the path hierarchy within anEBML Body and contains all otherEBML Elements of theEBML Body, excepting optionalVoid Elements.
Top-Level Element:
AnEBML Element defined to only occur as aChild Elementof theRoot Element.
Master Element:
TheMaster Element contains zero, one, or many otherEBML Elements.
Child Element:
AChild Element is a relative term to describe theEBML Elementsimmediately contained within aMaster Element.
Parent Element:
A relative term to describe theMaster Element that contains aspecified element. For any specifiedEBML Element that is not atRoot Level, theParent Element refers to theMaster Elementin which thatEBML Element is directly contained.
Descendant Element:
A relative term to describe anyEBML Elements contained within aMaster Element, including any of theChild Elements of itsChild Elements, and so on.
Void Element:
AnElement used to overwrite data orreserve space within aMaster Element for later use.
Element Name:
The human-readable name of theEBML Element.
Element Path:
The hierarchy ofParent Element where theEBML Elementis expected to be found in theEBML Body.
Empty Element:
AnEBML Element that has anElement Data Size with allVINT_DATA bits set to zero, which indicatesthat theElement Data of theElement is zero octets inlength.

3.Structure

EBML uses a system of Elements to compose an EBML Document. EBML Elements incorporate three parts: an Element ID, an Element Data Size, and Element Data. The Element Data, which is described by the Element ID, includes either binary data, one or more other EBML Elements, or both.

4.Variable-Size Integer

The Element ID and Element Data Size are both encoded as a Variable-SizeInteger. The Variable-Size Integer is composed of a VINT_WIDTH, VINT_MARKER,and VINT_DATA, in that order. Variable-Size IntegersMUSTleft-pad the VINT_DATA value with zero bits so that the whole Variable-SizeInteger is octet aligned. The Variable-Size Integer will be referred to asVINT for shorthand.

4.1.VINT_WIDTH

Each Variable-Size Integer starts with a VINT_WIDTH followed by aVINT_MARKER. VINT_WIDTH is a sequence of zero or more bits of value0and is terminated by the VINT_MARKER, which is a single bit of value1. The total length in bits of both VINT_WIDTH and VINT_MARKER is thetotal length in octets in of the Variable-Size Integer.

The single bit1 starts a Variable-Size Integer with a length ofone octet. The sequence of bits01 starts a Variable-Size Integerwith a length of two octets.001 starts a Variable-Size Integer witha length of three octets, and so on, with each additional0 bit adding oneoctet to the length of the Variable-Size Integer.

4.2.VINT_MARKER

The VINT_MARKER serves as a separator between the VINT_WIDTH and VINT_DATA. Each Variable-Size IntegerMUST contain exactly one VINT_MARKER. The VINT_MARKER is one bit in length and contain a bit with a value of one. The first bit with a value of one within the Variable-Size Integer is the VINT_MARKER.

4.3.VINT_DATA

The VINT_DATA portion of the Variable-Size Integer includes all data following(but not including) the VINT_MARKER until end of the Variable-SizeInteger whose length is derived from the VINT_WIDTH. The bits required for theVINT_WIDTH and the VINT_MARKER use one out of every eight bits of the totallength of the Variable-Size Integer. Thus, a Variable-Size Integer of 1-octetlength supplies 7 bits for VINT_DATA, a 2-octet length supplies 14 bits forVINT_DATA, and a 3-octet length supplies 21 bits for VINT_DATA. If the numberof bits required for VINT_DATA is less than the bit size of VINT_DATA, thenVINT_DATAMUST be zero-padded to the left to a size thatfits. The VINT_DATA valueMUST be expressed as a big-endianunsigned integer.

4.4.VINT Examples

Table 1 shows examples of Variable-SizeIntegers with lengths from 1 to 5 octets. The "Usable Bits" column refers to thenumber of bits that can be used in the VINT_DATA. The "Representation" columndepicts a binary expression of Variable-Size Integers where VINT_WIDTH isdepicted by0, the VINT_MARKER as1, and the VINT_DATA asx.

Table 1:VINT examples depicting usable bits
Octet LengthUsable BitsRepresentation
171xxx xxxx
21401xx xxxx xxxx xxxx
321001x xxxx xxxx xxxx xxxx xxxx
4280001 xxxx xxxx xxxx xxxx xxxx xxxx xxxx
5350000 1xxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx xxxx

A Variable-Size Integer may be rendered at octet lengths largerthan needed to store the data in order to facilitate overwriting it at a laterdate -- e.g., when its final size isn't known in advance. InTable 2, an integer2 (with acorresponding binary value of 0b10) is shown encoded as different Variable-SizeIntegers with lengths from one octet to four octets. All four encodedexamples have identical semantic meaning, though the VINT_WIDTH and the paddingof the VINT_DATA vary.

Table 2:VINT examples depicting the sameinteger value rendered at different VINT lengths
IntegerOctet LengthAs Represented in VINT (binary)As Represented in VINT (hexadecimal)
211000 00100x82
220100 0000 0000 00100x4002
230010 0000 0000 0000 0000 00100x200002
240001 0000 0000 0000 0000 0000 0000 00100x10000002

5.Element ID

An Element ID is a Variable-Size Integer. By default, Element IDs are fromone octet to four octets in length, although Element IDs of greater lengthsMAY be used if the EBMLMaxIDLength Element of the EBML Headeris set to a value greater than four (seeSection 11.2.4). The bits of the VINT_DATA componentof the Element IDMUST NOT be all0 values or all1 values. The VINT_DATA component of the Element IDMUST be encoded at the shortest valid length. For example, anElement ID with binary encoding of1011 1111 is valid, whereas anElement ID with binary encoding of0100 0000 0011 1111 stores asemantically equal VINT_DATA but is invalid, because a shorter VINT encoding ispossible. Additionally, an Element ID with binary encoding of1111 1111is invalid, since the VINT_DATA section is set to all one values,whereas an Element ID with binary encoding of0100 0000 0111 1111stores a semantically equal VINT_DATA and is the shortest-possible VINTencoding.

Table 3 details these specific examples further:

Table 3:Examples of valid and invalid Element IDs
VINT_WIDTHVINT_MARKERVINT_DATAElement ID Status
10000000Invalid: VINT_DATAMUST NOT be set to all 0
0100000000000000Invalid: VINT_DATAMUST NOT be set to all 0
10000001Valid
0100000000000001Invalid: A shorter VINT_DATA encoding is available.
10111111Valid
0100000000111111Invalid: A shorter VINT_DATA encoding is available.
11111111Invalid: VINT_DATAMUST NOT be set to all 1
0100000001111111Valid

The range and count of possible Element IDs are determined by theiroctet length. Examples of this are provided inTable 4.

Table 4:Examples of count and range forElement IDs at various octet lengths
Element ID Octet LengthRange of Valid Element IDsNumber of Valid Element IDs
10x81 - 0xFE126
20x407F - 0x7FFE16,256
30x203FFF - 0x3FFFFE2,080,768
40x101FFFFF - 0x1FFFFFFE268,338,304

6.Element Data Size

6.1.Data Size Format

The Element Data Size expresses the length in octets of Element Data. TheElement Data Size itself is encoded as a Variable-Size Integer. By default,Element Data Sizes can be encoded in lengths from one octet to eight octets,although Element Data Sizes of greater lengthsMAY be used ifthe octet length of the longest Element Data Size of the EBML Document isdeclared in the EBMLMaxSizeLength Element of the EBML Header (seeSection 11.2.5). Unlike the VINT_DATA of theElement ID, the VINT_DATA component of the Element Data Size is not mandatedto be encoded at the shortest valid length. For example, an Element Data Sizewith binary encoding of 1011 1111 or a binary encoding of 0100 0000 0011 1111are both valid Element Data Sizes and both store a semantically equal value(both 0b00000000111111 and 0b0111111, the VINT_DATA sections of the examples,represent the integer 63).

Although an Element ID with all VINT_DATA bits set to zero is invalid, anElement Data Size with all VINT_DATA bits set to zero is allowed for EBMLElement Types that do not mandate a nonzero length (seeSection 7). An Element Data Size with all VINT_DATAbits set to zero indicates that the Element Data is zero octets inlength. Such an EBML Element is referred to as an Empty Element. If an EmptyElement has a default value declared, then the EBML ReaderMUSTinterpret the value of the Empty Element as the default value. If an EmptyElement has no default value declared, then the EBML ReaderMUSTuse the value of the Empty Element for the corresponding EBML Element Type ofthe Element ID, 0 for numbers and an empty string for strings.

6.2.Unknown Data Size

An Element Data Size with all VINT_DATA bits set to one is reserved as anindicator that the size of the EBML Element is unknown. The only reservedvalue for the VINT_DATA of Element Data Size is all bits set to one. An EBMLElement with an unknown Element Data Size is referred to as an Unknown-SizedElement. Only a Master Element is allowed to be of unknown size, and it canonly be so if theunknownsizeallowed attribute of its EBML Schema isset to true (seeSection 11.1.6.10).

The use of Unknown-Sized Elements allows an EBML Element to be written and read before the size of the EBML Element is known. Unknown-Sized ElementsMUST only be used if the Element Data Size is not known before the Element Data is written, such as in some cases of datastreaming. The end of an Unknown-Sized Element is determined by whichever comes first:

  • Any EBML Element that is a valid Parent Element of the Unknown-Sized Element according to the EBML Schema, Global Elements excluded.

  • Any valid EBML Element according to the EBML Schema, Global Elementsexcluded, that is not a Descendant Element of the Unknown-Sized Element butshares a common direct parent, such as a Top-Level Element.

  • Any EBML Element that is a valid Root Element according to the EBML Schema, Global Elements excluded.

  • The end of the Parent Element with a known size has been reached.

  • The end of the EBML Document, either when reaching the end of the file or because a new EBML Header started.

Consider an Unknown-Sized Element whose EBML path is\root\level1\level2\elt. When reading a new Element ID, assuming theEBML Path of that new Element is valid, here are some possible and impossibleways that this new Element is endingelt:

Table 5:Examples of determining the end of an Unknown-Sized Element
EBML Path of new elementStatus
\root\level1\level2Ends the Unknown-Sized Element, as it is a new Parent Element
\root\level1Ends the Unknown-Sized Element, as it is a new Parent Element
\rootEnds the Unknown-Sized Element, as it is a new Root Element
\root2Ends the Unknown-Sized Element, as it is a new Root Element
\root\level1\level2\otherEnds the Unknown-Sized Element, as they share the same parent
\root\level1\level2\eltEnds the Unknown-Sized Element, as they share the same parent
\root\level1\level2\elt\insideDoesn't end the Unknown-Sized Element; it's a child ofelt
\root\level1\level2\elt\<global>Global Element is valid; it's a child ofelt
\root\level1\level2\<global>Global Element cannot be interpreted with this path; while parsingelt, a Global Element can only be a child ofelt

6.3.Data Size Values

For Element Data Sizes encoded at octet lengths from one to eight,Table 6 depicts the range of possible valuesthat can be encoded as an Element Data Size. An Element Data Size with anoctet length of 8 is able to express a size of 256-2 or72,057,594,037,927,934 octets (or about 72 petabytes). The maximum possiblevalue that can be stored as Element Data Size is referred to as VINTMAX.

Table 6:Possible range of values thatcan be stored in VINTs, by octet length
Octet LengthPossible Value Range
10 to 27 - 2
20 to 214 - 2
30 to 221 - 2
40 to 228 - 2
50 to 235 - 2
60 to 242 - 2
70 to 249 - 2
80 to 256 - 2

If the length of Element Data equals 2n*7-1, then the octetlength of the Element Data SizeMUST be at least n+1. This ruleprevents an Element Data Size from being expressed as the unknown-sizevalue.Table 7 clarifies this rule byshowing a valid and invalid expression of an Element Data Size with aVINT_DATA of 127 (which is equal to 21*7-1) and 16,383 (which is equal to22*7-1).

Table 7:Demonstration of VINT_DATAreservation for VINTs of unknown size
VINT_WIDTHVINT_MARKERVINT_DATAElement Data Size Status
11111111Reserved (meaning Unknown)
0100000001111111Valid (meaning 127 octets)
001000000000000001111111Valid (meaning 127 octets)
0111111111111111Reserved (meaning Unknown)
001000000011111111111111Valid (16,383 octets)

7.EBML Element Types

EBML Elements are defined by an EBML Schema (seeSection 11.1), whichMUST declare one of thefollowing EBML Element Types for each EBML Element. An EBML Element Typedefines a concept of storing data within an EBML Element that describes suchcharacteristics as length, endianness, and definition.

EBML Elements that are defined as a Signed Integer Element, UnsignedInteger Element, Float Element, or Date Element use big-endian storage.

7.1.Signed Integer Element

A Signed Integer ElementMUST declare a length from zero to eight octets. If the EBML Element is not defined to have a default value, then a Signed Integer Element with a zero-octet length represents an integer value of zero.

A Signed Integer Element stores an integer (meaning that it can be writtenwithout a fractional component) that could be negative, positive, orzero. Signed Integers are stored with two's complement notation with theleftmost bit being the sign bit. Because EBML limits Signed Integers to 8octets in length, a Signed Integer Element stores a number from-9,223,372,036,854,775,808 to +9,223,372,036,854,775,807.

7.2.Unsigned Integer Element

An Unsigned Integer ElementMUST declare a length from zero to eight octets. If the EBML Element is not defined to have a default value, then an Unsigned Integer Element with a zero-octet length represents an integer value of zero.

An Unsigned Integer Element stores an integer (meaning that it can bewritten without a fractional component) that could be positive orzero. Because EBML limits Unsigned Integers to 8 octets in length, an UnsignedInteger Element stores a number from 0 to 18,446,744,073,709,551,615.

7.3.Float Element

A Float ElementMUST declare a length of either zero octets(0 bit), four octets (32 bit), or eight octets (64 bit). If the EBML Elementis not defined to have a default value, then a Float Element with a zero-octetlength represents a numerical value of zero.

A Float Element stores a floating-point number in the 32-bit and 64-bitbinary interchange format, as defined in[IEEE.754].

7.4.String Element

A String ElementMUST declare a length in octets from zero to VINTMAX. If the EBML Element is not defined to have a default value, then a String Element with a zero-octet length represents an empty string.

A String ElementMUST either be empty (zero-length) or contain printable ASCII characters[RFC0020] in the range of 0x20 to 0x7E, with an exception made for termination (seeSection 13).

7.5.UTF-8 Element

A UTF-8 ElementMUST declare a length in octets from zero to VINTMAX. If the EBML Element is not defined to have a default value, then a UTF-8 Element with a zero-octet length represents an empty string.

A UTF-8 Element contains only a valid Unicode string as defined in[RFC3629], with an exception made for termination (seeSection 13).

7.6.Date Element

A Date ElementMUST declare a length of either zero octets or eight octets. If the EBML Element is not defined to have a default value, then a Date Element with a zero-octet length represents a timestamp of 2001-01-01T00:00:00.000000000 UTC[RFC3339].

The Date Element stores an integer in the same format as the Signed Integer Element that expresses a point in time referenced in nanoseconds from the precise beginning of the third millennium of the Gregorian Calendar in Coordinated Universal Time (also known as 2001-01-01T00:00:00.000000000 UTC). This provides a possible expression of time from 1708-09-11T00:12:44.854775808 UTC to 2293-04-11T11:47:16.854775807 UTC.

7.7.Master Element

A Master ElementMUST declare a length in octets from zero to VINTMAX or be of unknown length. SeeSection 6 for rules that apply to elements of unknown length.

The Master Element contains zero or more other elements. EBML Elements contained within a Master ElementMUST have the EBMLParentPath of their Element Path equal to the EBMLFullPath of the Master Element Element Path (seeSection 11.1.6.2). Element Data stored within Master ElementsSHOULD only consist of EBML Elements andSHOULD NOT contain any data that is not part of an EBML Element. The EBML Schema identifies what Element IDs are valid within the Master Elements for that version of the EBML Document Type. Any data contained within a Master Element that is not part of a Child ElementMUST be ignored.

7.8.Binary Element

A Binary ElementMUST declare a length in octets from zero to VINTMAX.

The contents of a Binary Element should not be interpreted by the EBML Reader.

8.EBML Document

An EBML Document is composed of only two components, an EBML Header and an EBML Body. An EBML DocumentMUST start with an EBML Header that declares significant characteristics of the entire EBML Body. An EBML Document consists of EBML Elements andMUST NOT contain any data that is not part of an EBML Element.

8.1.EBML Header

The EBML Header is a declaration that provides processing instructions and identification of the EBML Body. The EBML Header of an EBML Document is analogous to the XML Declaration of an XML Document.

The EBML Header documents the EBML Schema (also known as the EBML DocType)that is used to semantically interpret the structure and meaning of the EBMLDocument. Additionally, the EBML Header documents the versions of both EBMLand the EBML Schema that were used to write the EBML Document and the versionsrequired to read the EBML Document.

The EBML HeaderMUST contain a single Master Element with anElement Name ofEBML and Element ID of0x1A45DFA3 (seeSection 11.2.1); the Master Element may have any number ofadditional EBML Elements within it. The EBML Header of an EBML Document thatuses an EBMLVersion of 1MUST only contain EBML Elements thatare defined as part of this document.

Elements within an EBML Header can be at most 4 octets long, except for theEBML Element with Element NameEBML and Element ID0x1A45DFA3 (seeSection 11.2.1); this Element can be upto 8 octets long.

8.2.EBML Body

All data of an EBML Document following the EBML Header is the EBML Body. The end of the EBML Body, as well as the end of the EBML Document that contains the EBML Body, is reached at whichever comes first: the beginning of a new EBML Header at the Root Level or the end of the file. This document defines precisely which EBML Elements are to be used within the EBML Header but does not name or define which EBML Elements are to be used within the EBML Body. The definition of which EBML Elements are to be used within the EBML Body is defined by an EBML Schema.

Within the EBML Body, the maximum octet length allowed for any Element IDis set by the EBMLMaxIDLength Element of the EBML Header, and the maximum octetlength allowed for any Element Data Size is set by the EBMLMaxSizeLengthElement of the EBML Header.

9.EBML Stream

An EBML Stream is a file that consists of one or more EBML Documents that are concatenated together. An occurrence of an EBML Header at the Root Level marks the beginning of an EBML Document.

10.EBML Versioning

An EBML Document handles 2 different versions: the version of the EBML Header and the version of the EBML Body. Both versions are meant to be backward compatible.

10.1.EBML Header Version

The version of the EBML Header is found in EBMLVersion. An EBML parser can read an EBML Header if it can read either the EBMLVersion version or a version equal or higher than the one found in EBMLReadVersion.

10.2.EBML Document Version

The version of the EBML Body is found in EBMLDocTypeVersion. A parser for the particular DocType format can read the EBML Document if it can read either the EBMLDocTypeVersion version of that format or a version equal or higher than the one found in EBMLDocTypeReadVersion.

11.Elements semantics

11.1.EBML Schema

An EBML Schema is a well-formed XML Document[XML] that defines the properties,arrangement, and usage of EBML Elements that compose a specific EBML DocumentType. The relationship of an EBML Schema to an EBML Document is analogous tothe relationship of an XML Schema[XML-SCHEMA] to an XMLDocument[XML]. An EBML SchemaMUST be clearly associated with one or more EBML DocumentTypes. An EBML Document Type is identified by a string stored within the EBMLHeader in the DocType Element -- for example, Matroska or WebM (seeSection 11.2.6). The DocType value for an EBML Document TypeMUST be unique, persistent, and described in the IANA registry(seeSection 17.2).

An EBML SchemaMUST declare exactly one EBML Element at Root Level (referred to as the Root Element) that occurs exactly once within an EBML Document. The Void ElementMAY also occur at Root Level but is not a Root Element (seeSection 11.3.2).

The EBML SchemaMUST document all Elements of the EBMLBody. The EBML Schema does not document Global Elements that are defined bythis document (namely, the Void Element and the CRC-32 Element).

The EBML SchemaMUST NOT use the Element ID0x1A45DFA3, which is reserved for the EBML Header for the purpose ofresynchronization.

An EBML SchemaMAY constrain the use of EBML Header Elements(seeSection 11.2) by adding or constrainingthat Element'srange attribute. For example, an EBML SchemaMAY constrain the EBMLMaxSizeLength to a maximum value of8 orMAY constrain the EBMLVersion to only support avalue of1. If an EBML Schema adopts the EBML Header Element as is,then it is not required to document that Element within the EBML Schema. If anEBML Schema constrains the range of an EBML Header Element, then that ElementMUST be documented within an<element> node ofthe EBML Schema. This document provides an example of an EBML Schema; seeSection 11.1.1.

11.1.1.EBML Schema Example

<?xml version="1.0" encoding="utf-8"?><EBMLSchema xmlns="urn:ietf:rfc:8794"  docType="files-in-ebml-demo" version="1"> <!-- constraints to the range of two EBML Header Elements --> <element name="EBMLReadVersion" path="\EBML\EBMLReadVersion"   minOccurs="1" maxOccurs="1" range="1" default="1"   type="uinteger"/> <element name="EBMLMaxSizeLength"   path="\EBML\EBMLMaxSizeLength" minOccurs="1"   maxOccurs="1" range="8" default="8" type="uinteger"/> <!-- Root Element--> <element name="Files" path="\Files"   type="master">  <documentation lang="en"    purpose="definition">Container of data and  attributes representing one or many files.</documentation> </element> <element name="File" path="\Files\File"   type="master" minOccurs="1">  <documentation lang="en" purpose="definition">    An attached file.  </documentation> </element> <element name="FileName" path="\Files\File\FileName"   type="utf-8"   minOccurs="1">  <documentation lang="en" purpose="definition">    Filename of the attached file.  </documentation> </element> <element name="MimeType" path="\Files\File\MimeType"   type="string"     minOccurs="1">  <documentation lang="en" purpose="definition">    MIME type of the file.  </documentation> </element> <element name="ModificationTimestamp"   path="\Files\File\ModificationTimestamp"   type="date" minOccurs="1">  <documentation lang="en" purpose="definition">    Modification timestamp of the file.  </documentation> </element> <element name="Data" path="\Files\File\Data"   type="binary" minOccurs="1">  <documentation lang="en" purpose="definition">    The data of the file.  </documentation> </element></EBMLSchema>

11.1.2.<EBMLSchema> Element

Within an EBML Schema, the XPath[XPath] of the<EBMLSchema> element is/EBMLSchema.

When used as an XML Document, the EBML SchemaMUST use<EBMLSchema> as the top-level element. The<EBMLSchema> element can contain<element>subelements.

11.1.3.<EBMLSchema> Namespace

The namespace URI for elements of the EBML Schema is a URN as defined by[RFC8141] that uses the namespace identifier 'ietf' defined by[RFC2648]and extended by[RFC3688]. This URN isurn:ietf:rfc:8794.

11.1.4.<EBMLSchema> Attributes

Within an EBML Schema, the<EBMLSchema> element uses thefollowing attributes to define an EBML Element:

11.1.4.1.docType

Within an EBML Schema, the XPath of the@docType attribute is/EBMLSchema/@docType.

The docType lists the official name of the EBML Document Type that isdefined by the EBML Schema; for example,<EBMLSchema docType="matroska">.

ThedocType attribute isREQUIRED within the<EBMLSchema> Element.

11.1.4.2.version

Within an EBML Schema, the XPath of the@version attribute is/EBMLSchema/@version.

The version lists a nonnegative integer that specifies the version of the docType documented by the EBML Schema. Unlike XML Schemas, an EBML Schemadocuments all versions of a docType's definition rather than using separateEBML Schemas for each version of a docType. EBML Elements may be introducedand deprecated by using theminver andmaxver attributes of<element>.

Theversion attribute isREQUIRED within the<EBMLSchema> Element.

11.1.4.3.ebml

Within an EBML Schema, the XPath of the@ebml attribute is/EBMLSchema/@ebml.

Theebml attribute is a positive integer that specifies theversion of the EBML Header (seeSection 11.2.2)used by the EBML Schema. If the attribute is omitted, the EBML Header versionis 1.

11.1.5.<element> Element

Within an EBML Schema, the XPath of the<element> element is/EBMLSchema/element.

Each<element> defines one EBML Element through the use ofseveral attributes that are defined inSection 11.1.6. EBML SchemasMAY containadditional attributes to extend the semantics butMUST NOTconflict with the definitions of the<element> attributesdefined within this document.

The<element> nodes contain a description of the meaning and use of the EBML Element stored within one or more<documentation> subelements, followed by optional<implementation_note> subelements, followed by zero or one<restriction> subelement, followed by optional<extension> subelements. All<element> nodesMUST be subelements of the<EBMLSchema>.

11.1.6.<element> Attributes

Within an EBML Schema, the<element> uses the followingattributes to define an EBML Element:

11.1.6.1.name

Within an EBML Schema, the XPath of the@name attribute is/EBMLSchema/element/@name.

The name provides the human-readable name of the EBML Element. The value ofthe nameMUST be in the form of characters "A" to"Z", "a" to "z", "0" to "9","-", and ".". The first character of the nameMUST be in the form of an "A" to "Z","a" to "z", or "0" to "9" character.

Thename attribute isREQUIRED.

11.1.6.2.path

Within an EBML Schema, the XPath of the@path attribute is/EBMLSchema/element/@path.

The path defines the allowed storage locations of the EBML Element withinan EBML Document. This pathMUST be defined with the fullhierarchy of EBML Elements separated with a\. The top EBML Elementin the path hierarchy is the first in the value. The syntax of thepath attribute is defined using this Augmented Backus-Naur Form(ABNF)[RFC5234] with the case-sensitive update[RFC7405] notation:

Thepath attribute isREQUIRED.

EBMLFullPath           = EBMLParentPath EBMLElementEBMLParentPath         = PathDelimiter [EBMLParents]EBMLParents            = 0*IntermediatePathAtom EBMLLastParentIntermediatePathAtom   = EBMLPathAtom / GlobalPlaceholderEBMLLastParent         = EBMLPathAtom / GlobalPlaceholderEBMLPathAtom           = [IsRecursive] EBMLAtomName PathDelimiterEBMLElement            = [IsRecursive] EBMLAtomNamePathDelimiter          = "\"IsRecursive            = "+"EBMLAtomName           = ALPHA / DIGIT 0*EBMLNameCharEBMLNameChar           = ALPHA / DIGIT / "-" / "."GlobalPlaceholder      = "(" GlobalParentOccurrence "\)"GlobalParentOccurrence = [PathMinOccurrence] "-" [PathMaxOccurrence]PathMinOccurrence      = 1*DIGIT ; no upper limitPathMaxOccurrence      = 1*DIGIT ; no upper limit

The*,(, and) symbols are interpreted as defined in[RFC5234].

The EBMLAtomName of the EBMLElement partMUST be equal to the@name attribute of the EBML Schema.If the EBMLElement part contains an IsRecursive part, the EBML Element can occur within itself recursively (seeSection 11.1.6.11).

The starting PathDelimiter of EBMLParentPath corresponds to the root of the EBML Document.

The@path valueMUST be unique within the EBML Schema. The@id value corresponding to this@pathMUST NOT be defined for use within another EBML Element with the same EBMLParentPath as this@path.

A path with a GlobalPlaceholder as the EBMLLastParent defines a Global Element; seeSection 11.3.If the element has no EBMLLastParent part, or the EBMLLastParent part is not aGlobalPlaceholder, then the Element is not a Global Element.

The GlobalParentOccurrence part is interpreted as the number of valid EBMLPathAtom parts that can replace the GlobalPlaceholder in the path.PathMinOccurrence represents the minimum number of EBMLPathAtoms required toreplace the GlobalPlaceholder. PathMaxOccurrence represents the maximum numberof EBMLPathAtoms possible to replace the GlobalPlaceholder.

If PathMinOccurrence is not present, then that GlobalParentOccurrence has aPathMinOccurrence value of 0.If PathMaxOccurrence is not present, then there is no upper bound for thepermitted number of EBMLPathAtoms possible to replace the GlobalPlaceholder.PathMaxOccurrenceMUST NOT have the value 0, as it would meanno EBMLPathAtom can replace the GlobalPlaceholder, and the EBMLFullPath wouldbe the same without that GlobalPlaceholder part.PathMaxOccurrenceMUST be bigger than, or equal to,PathMinOccurrence.

For example, in\a\(0-1\)global, the Element path\a\x\global corresponds to an EBMLPathAtom occurrence of 1. TheElement\a\x\y\global corresponds to an EBMLPathAtom occurrence of 2,etc. In those cases,\a\x or\a\x\yMUST be validpaths to be able to contain the elementglobal.

Consider another EBML Path,\a\(1-\)global. There has to be atleast one EBMLPathAtom between the\a\ part andglobal.So theglobal EBML Element cannot be found inside the\aEBML Element, as it means the resulting path\a\global has noEBMLPathAtom between the\a\ andglobal. However, theglobal EBML Element can be found inside the\a\b EBMLElement, because the resulting path,\a\b\global, has one EBMLPathAtombetween the\a\ andglobal. Alternatively, it can be foundinside the\a\b\c EBML Element (two EBMLPathAtom), or inside the\a\b\c\d EBML Element (three EBMLPathAtom), etc.

Consider another EBML Path,\a\(0-1\)global. There has to be atmost one EBMLPathAtom between the\a\ part andglobal.So theglobal EBML Element can be found inside either the\aEBML Element (0 EBMLPathAtom replacing GlobalPlaceholder) or the\a\b EBML Element (one replacement EBMLPathAtom).But it cannot be found inside the\a\b\c EBML Element, because theresulting path,\a\b\c\global, has two EBMLPathAtom between\a\ andglobal.

11.1.6.3.id

Within an EBML Schema, the XPath of the@id attribute is/EBMLSchema/element/@id.

The Element ID is encoded as a Variable-Size Integer. It is read and stored in big-endianorder. In the EBML Schema, it is expressed inhexadecimal notation prefixed by a 0x. To reduce the risk of false positives while parsing EBML Streams, theElement IDs of the Root Element and Top-Level ElementsSHOULDbe at least 4 octets in length. Element IDs defined for use at Root Level ordirectly under the Root LevelMAY use shorter octet lengths tofacilitate padding and optimize edits to EBML Documents; for instance, theVoid Element uses an Element ID with a length of one octet to allow its usagein more writing and editing scenarios.

The Element ID of any Element found within an EBML DocumentMUST only match a single@path value of its corresponding EBML Schema, but a separate instance of that Element ID value defined by the EBML SchemaMAY occur within a different@path. If more than one Element is defined to use the same@id value, then the@path values of those ElementsMUST NOT share the same EBMLParentPath. ElementsMUST NOT be defined to use the same@id value if one of their common Parent Elements could be an Unknown-Sized Element.

Theid attribute isREQUIRED.

11.1.6.4.minOccurs

Within an EBML Schema, the XPath of the@minOccurs attribute is/EBMLSchema/element/@minOccurs.

minOccurs is a nonnegative integer expressing the minimum permitted numberof occurrences of this EBML Element within its Parent Element.

Each instance of the Parent ElementMUST contain at least this many instances of this EBML Element.If the EBML Element has an empty EBMLParentPath, thenminOccurs refers toconstraints on the occurrence of the EBML Element within the EBML Document.EBML Elements withminOccurs set to "1" that also have a defaultvalue (seeSection 11.1.6.8) declared are notREQUIRED to be stored but areREQUIRED to beinterpreted; seeSection 11.1.19.

An EBML Element defined with aminOccurs value greater than zero is calleda Mandatory EBML Element.

TheminOccurs attribute isOPTIONAL. If theminOccursattribute is not present, then that EBML Element has aminOccurs value of0.

The semantic meaning ofminOccurs within an EBML Schema is analogous to the meaning ofminOccurs within an XML Schema.

11.1.6.5.maxOccurs

Within an EBML Schema, the XPath of the@maxOccurs attribute is/EBMLSchema/element/@maxOccurs.

maxOccurs is a nonnegative integer expressing the maximum permitted numberof occurrences of this EBML Element within its Parent Element.

Each instance of the Parent ElementMUST contain at mostthis many instances of this EBML Element, including the unwritten mandatoryelement with a default value; seeSection 11.1.19.If the EBML Element has an empty EBMLParentPath, thenmaxOccurs refers toconstraints on the occurrence of the EBML Element within the EBMLDocument.

ThemaxOccurs attribute isOPTIONAL. If themaxOccursattribute is not present, then there is no upper bound for the permittednumber of occurrences of this EBML Element within its Parent Element or withinthe EBML Document, depending on whether or not the EBMLParentPath of the EBML Elementis empty.

The semantic meaning ofmaxOccurs within an EBML Schema is analogous to themeaning ofmaxOccurs within an XML Schema; when it is not present, it'ssimilar to xml:maxOccurs="unbounded" in an XML Schema.

11.1.6.6.range

Within an EBML Schema, the XPath of the@range attribute is/EBMLSchema/element/@range.

A numerical range for EBML Elements that are of numerical types (UnsignedInteger, Signed Integer, Float, and Date). If specified, the value of the EBMLElementMUST be within the defined range. SeeSection 11.1.6.6.1 for rules applied to expression of rangevalues.

Therange attribute isOPTIONAL. If therange attribute isnot present, then any value legal for thetype attribute is valid.

11.1.6.6.1.Expression of range

Therange attributeMUST only be used with EBML Elementsthat are either signed integer, unsigned integer, float, or date. Theexpression defines the upper, lower, exact, or excluded value of the EBMLElement and optionally an upper boundary value combined with a lowerboundary. The range expression may contain whitespace (using the ASCII 0x20character) for readability, but whitespace within a range expressionMUST NOT convey meaning.

To set a fixed value for the range, the value is used as the attributevalue. For example,1234 means the EBML element always has the value1234. The value can be prefixed withnot to indicate that the fixedvalueMUST NOT be used for that Element. For example,not 1234 means the Element can use all values of its type except 1234.

The> sign is used for an exclusive lower boundary, and the>= sign is used for an inclusive lower boundary. For example,>3 means the Element valueMUST be greater than 3,and>=0x1p+0 means the Element valueMUST begreater than or equal to the floating value 1.0; seeSection 11.1.18.

The< sign is used for an exclusive upper boundary, and the<= sign is used for an inclusive upper boundary. For example,<-2 means the Element valueMUST be less than -2,and<=10 means the Element valueMUST be less thanor equal to 10.

The lower and upper bounds can be combined into an expression to form aclosed boundary. The lower boundary comes first, followed by the upperboundary, separated by a comma. For example,>3,<= 20 means theElement valueMUST be greater than 3 and less than or equal to20.

A special form of lower and upper bounds using the- separator ispossible, meaning the Element valueMUST be greater than, or equal to,the first value andMUST be less than or equal to thesecond value. For example,1-10 is equivalent to>=1,<=10. If the upper boundary is negative, therange attributeMUST only use the latter form.

11.1.6.7.length

Within an EBML Schema, the XPath of the@length attribute is/EBMLSchema/element/@length.

Thelength attribute is a value to express the valid length of the ElementData as written, measured in octets. The length provides a constraint inaddition to the Length value of the definition of the corresponding EBMLElement Type. This lengthMUST be expressed as either anonnegative integer or a range (seeSection 11.1.6.6.1) that consists of only nonnegativeintegers and valid operators.

Thelength attribute isOPTIONAL. If thelength attribute isnot present for that EBML Element, then that EBML Element is only limited inlength by the definition of the associated EBML Element Type.

11.1.6.8.default

Within an EBML Schema, the XPath of the@default attribute is/EBMLSchema/element/@default.

If an Element is mandatory (has aminOccurs value greater than zero) but not written within its Parent Element or stored as an Empty Element, then the EBML Reader of the EBML DocumentMUST semantically interpret the EBML Element as present with this specified default value for the EBML Element.An unwritten mandatory Element with a declared default value is semantically equivalent to that Element if written with the default value stored as the Element Data.EBML Elements that are Master ElementsMUST NOT declare a default value.EBML Elements with aminOccurs value greater than 1MUST NOT declare a default value.

The default attribute isOPTIONAL.

11.1.6.9.type

Within an EBML Schema, the XPath of the@type attribute is/EBMLSchema/element/@type.

The typeMUST be set to one of the following values:integer (signed integer),uinteger (unsigned integer),float,string,date,utf-8,master, orbinary. The content of each type is definedinSection 7.

Thetype attribute isREQUIRED.

11.1.6.10.unknownsizeallowed

Within an EBML Schema, the XPath of the@unknownsizeallowedattribute is/EBMLSchema/element/@unknownsizeallowed.

This attribute is a boolean to express whether an EBML Element is permitted tobe an Unknown-Sized Element (having all VINT_DATA bits of Element Data Size setto 1). EBML Elements that are not Master ElementsMUST NOT setunknownsizeallowed to true. An EBML Element that is defined with anunknownsizeallowed attribute set to 1MUST also have theunknownsizeallowed attribute of its Parent Element set to 1.

An EBML Element with theunknownsizeallowed attribute set to 1MUST NOT have itsrecursive attribute set to 1.

Theunknownsizeallowed attribute isOPTIONAL. If theunknownsizeallowed attribute is not used, then that EBML Element is notallowed to use an unknown Element Data Size.

11.1.6.11.recursive

Within an EBML Schema, the XPath of the@recursive attribute is/EBMLSchema/element/@recursive.

This attribute is a boolean to express whether an EBML Element is permitted tobe stored recursively. If it is allowed, the EBML ElementMAY bestored within another EBML Element that has the same Element ID, which itselfcan be stored in an EBML Element that has the same Element ID, and so on. EBMLElements that are not Master ElementsMUST NOT set recursive totrue.

If the EBMLElement part of the@path contains an IsRecursive part,then therecursive valueMUST be true; otherwise, itMUST be false.

An EBML Element with therecursive attribute set to 1MUST NOThave itsunknownsizeallowed attribute set to 1.

Therecursive attribute isOPTIONAL. If therecursiveattribute is not present, then the EBML ElementMUST NOT beused recursively.

11.1.6.12.recurring

Within an EBML Schema, the XPath of the@recurring attribute is/EBMLSchema/element/@recurring.

This attribute is a boolean to express whether or not an EBML Element is defined as anIdentically Recurring Element; seeSection 11.1.17.

Therecurring attribute isOPTIONAL. If therecurringattribute is not present, then the EBML Element is not an IdenticallyRecurring Element.

11.1.6.13.minver

Within an EBML Schema, the XPath of the@minver attribute is/EBMLSchema/element/@minver.

Theminver (minimum version) attribute stores a nonnegative integer thatrepresents the first version of the docType to support the EBML Element.

Theminver attribute isOPTIONAL. If theminverattribute is not present, then the EBML Element has a minimum version of"1".

11.1.6.14.maxver

Within an EBML Schema, the XPath of the@maxver attribute is/EBMLSchema/element/@maxver.

Themaxver (maximum version) attribute stores a nonnegative integer thatrepresents the last or most recent version of the docType to support theelement.maxverMUST be greater than or equal tominver.

Themaxver attribute isOPTIONAL. If themaxver attribute isnot present, then the EBML Element has a maximum version equal to the valuestored in theversion attribute of<EBMLSchema>.

11.1.7.<documentation> Element

Within an EBML Schema, the XPaths of the<documentation>elements are/EBMLSchema/element/documentation and/EBMLSchema/element/restriction/enum/documentation.

The<documentation> element provides additional informationabout EBML Elements or enumeration values. Within the<documentation> element, thefollowing XHTML[XHTML] elementsMAY beused:<a>,<br>, and<strong>.

11.1.8.<documentation> Attributes

11.1.8.1.lang

Within an EBML Schema, the XPath of the@lang attribute is/EBMLSchema/element/documentation/@lang.

Thelang attribute is set to the value from[RFC5646] ofthe language of the element's documentation.

Thelang attribute isOPTIONAL.

11.1.8.2.purpose

Within an EBML Schema, the XPath of the@purpose attribute is/EBMLSchema/element/documentation/@purpose.

Apurpose attribute distinguishes the meaning of the documentation. Valuesfor the<documentation> subelement'spurpose attributeMUST include one of the values listed inTable 8.

Table 8:Definitions of the permittedvalues for thepurpose attribute of the documentation Element
value ofpurpose attributedefinition
definitionA "definition" is recommended for every defined EBML Element. This documentation explains the semantic meaning of the EBML Element.
rationaleAn explanation about the reason or catalyst for the definition of the Element.
usage notesRecommended practices or guidelines for both reading, writing, or interpreting the Element.
referencesInformational references to support the contextualization and understanding of the value of the Element.

Thepurpose attribute isREQUIRED.

11.1.9.<implementation_note> Element

Within an EBML Schema, the XPath of the<implementation_note>element is/EBMLSchema/element/implementation_note.

In some cases within an EBML Document Type, the attributes of the<element> element are not sufficient to clearly communicate howthe defined EBML Element is intended to be implemented.For instance, one EBML Element might only be mandatory if another EBML Elementis present. As another example, the default value of an EBML Element mightbe derived from a related Element's content. In these cases where the Element'sdefinition is conditional or advanced implementation notes are needed, one or many<implementation_note> elements can be used to store thatinformation.The<implementation_note> refers to a specific attribute of theparent<element> as expressed by thenote_attributeattribute (seeSection 11.1.10.1).

11.1.10.<implementation_note> Attributes

11.1.10.1.note_attribute

Within an EBML Schema, the XPath of the@note_attribute attributeis/EBMLSchema/element/implementation_note/@note_attribute.

Thenote_attribute attribute references which of the attributes of the<element> the<implementation_note> relates to.Thenote_attribute attributeMUST be set to one of thefollowing values (corresponding to that attribute of the parent<element>):minOccurs,maxOccurs,range,length,default,minver, ormaxver. The<implementation_note>SHALLsupersede the parent<element>'s attribute that is named in thenote_attribute attribute.An<element>SHALL NOT have more than one<implementation_note> of the samenote_attribute.

Thenote_attribute attribute isREQUIRED.

11.1.10.2.<implementation_note> Example

The following fragment of an EBML Schema demonstrates how an<implementation_note> is used. In this case, an EBML Schemadocuments a list of items that are described with an optional cost. TheCurrency Element uses an<implementation_note> to say that theCurrency Element isREQUIRED if the Cost Element is set,otherwise not.

<element name="Items" path="\Items" type="master"  minOccurs="1" maxOccurs="1">  <documentation lang="en" purpose="definition">    A set of items.  </documentation></element><element name="Item" path="\Items\Item"  type="master">  <documentation lang="en" purpose="definition">    An item.  </documentation></element><element name="Cost" path="\Items\Item\Cost"  type="float" maxOccurs="1">  <documentation lang="en" purpose="definition">    The cost of the item, if any.  </documentation></element><element name="Currency" path="\Items\Item\Currency"  type="string" maxOccurs="1">  <documentation lang="en" purpose="definition">    The currency of the item's cost.  </documentation>  <implementation_note note_attribute="minOccurs">    Currency MUST be set (minOccurs=1) if the associated Item stores    a Cost, else Currency MAY be unset (minOccurs=0).  </implementation_note></element>

11.1.11.<restriction> Element

Within an EBML Schema, the XPath of the<restriction>element is/EBMLSchema/element/restriction.

The<restriction> element provides information aboutrestrictions to the allowable values for the EBML Element, which are listed in<enum> elements.

11.1.12.<enum> Element

Within an EBML Schema, the XPath of the<enum> element is/EBMLSchema/element/restriction/enum.

The<enum> element stores a list of values allowed forstorage in the EBML Element. The valuesMUST match the type ofthe EBML Element (for example,<enum value="Yes">cannot be a valid value for an EBML Element that is defined as an unsignedinteger). An<enum> elementMAY also store<documentation> elements to further describe the<enum>.

11.1.13.<enum> Attributes

11.1.13.1.label

Within an EBML Schema, the XPath of the@label attribute is/EBMLSchema/element/restriction/enum/@label.

The label provides a concise expression for human consumption thatdescribes what the value of<enum> represents.

Thelabel attribute isOPTIONAL.

11.1.13.2.value

Within an EBML Schema, the XPath of the@value attribute is/EBMLSchema/element/restriction/enum/@value.

The value represents data thatMAY be stored within the EBML Element.

Thevalue attribute isREQUIRED.

11.1.14.<extension> Element

Within an EBML Schema, the XPath of the<extension>element is/EBMLSchema/element/extension.

The<extension> element provides an unconstrained element tocontain information about the associated EBML<element>, whichis undefined by this document butMAY be defined by theassociated EBML Document Type. The<extension> elementMUST contain atype attribute and alsoMAY contain any other attribute or subelement as long as theEBML Schema remains as a well-formed XML Document. All<extension> elementsMUST be subelements of the<element>.

11.1.15.<extension> Attributes

11.1.15.1.type

Within an EBML Schema, the XPath of the@type attribute is/EBMLSchema/element/extension/@type.

Thetype attribute should reference a name or identifier of theproject or authority associated with the contents of the<extension> element.

Thetype attribute isREQUIRED.

11.1.16.XML Schema for EBML Schema

The following provides an XML Schema[XML-SCHEMA] forfacilitating verification of an EBML Schema described inSection 11.1.

<?xml version="1.0" encoding="UTF-8"?><xs:schema xmlns="urn:ietf:rfc:8794"  targetNamespace="urn:ietf:rfc:8794"  xmlns:xs="http://www.w3.org/2001/XMLSchema"  xmlns:xhtml="http://www.w3.org/1999/xhtml"  elementFormDefault="qualified" version="01">  <!-- for HTML in comments -->  <xs:import namespace="http://www.w3.org/1999/xhtml"    schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"/>  <xs:element name="EBMLSchema" type="EBMLSchemaType"/>  <xs:complexType name="EBMLSchemaType">    <xs:sequence>      <xs:element name="element" type="elementType"        minOccurs="0" maxOccurs="unbounded"/>    </xs:sequence>    <xs:attribute name="docType" use="required"/>    <xs:attribute name="version" use="required" type="xs:integer"/>    <xs:attribute name="ebml" type="xs:positiveInteger"      default="1"/>  </xs:complexType>  <xs:complexType name="elementType">    <xs:sequence>      <xs:element name="documentation" type="documentationType"        minOccurs="0" maxOccurs="unbounded"/>      <xs:element name="implementation_note" type="noteType"        minOccurs="0" maxOccurs="unbounded"/>      <xs:element name="restriction" type="restrictionType"        minOccurs="0" maxOccurs="1"/>      <xs:element name="extension" type="extensionType"        minOccurs="0" maxOccurs="unbounded"/>    </xs:sequence>    <xs:attribute name="name" use="required">      <xs:simpleType>        <xs:restriction base="xs:string">          <xs:pattern value="[0-9A-Za-z.-]([0-9A-Za-z.-])*"/>        </xs:restriction>      </xs:simpleType>    </xs:attribute>    <xs:attribute name="path" use="required">      <!-- <xs:simpleType>        <xs:restriction base="xs:integer">          <xs:pattern value="[0-9]*\*[0-9]*()"/>        </xs:restriction>      </xs:simpleType> -->    </xs:attribute>    <xs:attribute name="id" use="required">      <xs:simpleType>        <xs:restriction base="xs:string">          <xs:pattern value="0x([0-9A-F][0-9A-F])+"/>        </xs:restriction>      </xs:simpleType>    </xs:attribute>    <xs:attribute name="minOccurs" default="0">      <xs:simpleType>        <xs:restriction base="xs:integer">          <xs:minInclusive value="0"/>        </xs:restriction>      </xs:simpleType>    </xs:attribute>    <xs:attribute name="maxOccurs" default="1">      <xs:simpleType>        <xs:restriction base="xs:integer">          <xs:minInclusive value="0"/>        </xs:restriction>      </xs:simpleType>    </xs:attribute>    <xs:attribute name="range"/>    <xs:attribute name="length"/>    <xs:attribute name="default"/>    <xs:attribute name="type" use="required">      <xs:simpleType>        <xs:restriction base="xs:string">          <xs:enumeration value="integer"/>          <xs:enumeration value="uinteger"/>          <xs:enumeration value="float"/>          <xs:enumeration value="string"/>          <xs:enumeration value="date"/>          <xs:enumeration value="utf-8"/>          <xs:enumeration value="master"/>          <xs:enumeration value="binary"/>        </xs:restriction>      </xs:simpleType>    </xs:attribute>    <xs:attribute name="unknownsizeallowed" type="xs:boolean"      default="false"/>    <xs:attribute name="recursive" type="xs:boolean"      default="false"/>    <xs:attribute name="recurring" type="xs:boolean"      default="false"/>    <xs:attribute name="minver" default="1">      <xs:simpleType>        <xs:restriction base="xs:integer">          <xs:minInclusive value="0"/>        </xs:restriction>      </xs:simpleType>    </xs:attribute>    <xs:attribute name="maxver">      <xs:simpleType>        <xs:restriction base="xs:integer">          <xs:minInclusive value="0"/>        </xs:restriction>      </xs:simpleType>    </xs:attribute>  </xs:complexType>  <xs:complexType name="restrictionType">    <xs:sequence>      <xs:element name="enum" type="enumType"        minOccurs="0" maxOccurs="unbounded"/>    </xs:sequence>  </xs:complexType>  <xs:complexType name="extensionType">    <xs:sequence>      <xs:any processContents="skip"        minOccurs="0" maxOccurs="unbounded"/>    </xs:sequence>    <xs:attribute name="type" use="required"/>    <xs:anyAttribute processContents="skip"/>  </xs:complexType>  <xs:complexType name="enumType">    <xs:sequence>      <xs:element name="documentation" type="documentationType"        minOccurs="0" maxOccurs="unbounded"/>    </xs:sequence>    <xs:attribute name="label"/>    <xs:attribute name="value" use="required"/>  </xs:complexType>  <xs:complexType name="documentationType" mixed="true">    <xs:sequence>      <xs:element name="a"      type="xhtml:xhtml.a.type"        minOccurs="0" maxOccurs="unbounded"/>      <xs:element name="br"     type="xhtml:xhtml.br.type"        minOccurs="0" maxOccurs="unbounded"/>      <xs:element name="strong" type="xhtml:xhtml.strong.type"        minOccurs="0" maxOccurs="unbounded"/>    </xs:sequence>    <xs:attribute name="lang"/>    <xs:attribute name="purpose" use="required">      <xs:simpleType>        <xs:restriction base="xs:string">          <xs:enumeration value="definition"/>          <xs:enumeration value="rationale"/>          <xs:enumeration value="references"/>          <xs:enumeration value="usage notes"/>        </xs:restriction>      </xs:simpleType>    </xs:attribute>  </xs:complexType>  <xs:complexType name="noteType">    <xs:simpleContent>      <xs:extension base="xs:string">        <xs:attribute name="note_attribute" use="required">          <xs:simpleType>            <xs:restriction base="xs:string">              <xs:enumeration value="minOccurs"/>              <xs:enumeration value="maxOccurs"/>              <xs:enumeration value="range"/>              <xs:enumeration value="length"/>              <xs:enumeration value="default"/>              <xs:enumeration value="minver"/>              <xs:enumeration value="maxver"/>            </xs:restriction>          </xs:simpleType>        </xs:attribute>      </xs:extension>    </xs:simpleContent>  </xs:complexType></xs:schema>

11.1.17.Identically Recurring Elements

An Identically Recurring Element is an EBML Element thatMAYoccur within its Parent Element more than once, but each recurrence of itwithin that Parent ElementMUST be identical both in storageand semantics. Identically Recurring Elements are permitted to be storedmultiple times within the same Parent Element in order to increase dataresilience and optimize the use of EBML in transmission. For instance, apertinent Top-Level Element could be periodically resent within a datastreamso that an EBML Reader that starts reading the stream from the middle couldbetter interpret the contents. Identically Recurring ElementsSHOULD include a CRC-32 Element as a Child Element; this isespecially recommended when EBML is used for long-term storage ortransmission. If a Parent Element contains more than one copy of anIdentically Recurring Element that includes a CRC-32 Element as a ChildElement, then the first instance of the Identically Recurring Element with avalid CRC-32 value should be used for interpretation. If a Parent Elementcontains more than one copy of an Identically Recurring Element that does notcontain a CRC-32 Element, or if CRC-32 Elements are present but none are valid,then the first instance of the Identically Recurring Element should be usedfor interpretation.

11.1.18.Textual expression of floats

When a float value is represented textually in an EBML Schema, such aswithin a default or range value, the float valuesMUST beexpressed as Hexadecimal Floating-Point Constants as defined in the C11standard[ISO9899] (see Section 6.4.4.2 on FloatingConstants).Table 9 provides examples ofexpressions of float ranges.

Table 9:Example of Floating-Point values andranges as decimal and Hexadecimal Floating-Point Constants
as decimalas Hexadecimal Floating-Point Constants
0.00x0p+1
0.0-1.00x0p+1-0x1p+0
1.0-256.00x1p+0-0x1p+8
0.8574218750x1.b7p-1
-1.0--0.857421875-0x1p+0--0x1.b7p-1

Within an expression of a float range, as in an integer range, the- (hyphen) character is the separator between the minimum and maximum valuespermitted by the range. Hexadecimal Floating-Point Constants also use a -(hyphen) when indicating a negative binary power. Within a float range, when a- (hyphen) is immediately preceded by a letter p, then the - (hyphen) is apart of the Hexadecimal Floating-Point Constant that notes negative binarypower. Within a float range, when a - (hyphen) is not immediately preceded bya letter p, then the - (hyphen) represents the separator between the minimumand maximum values permitted by the range.

11.1.19.Note on the use of default attributes to define Mandatory EBML Elements

If a Mandatory EBML Element has a default value declared by an EBML Schemaand the value of the EBML Element is equal to the declared default value, thenthat EBML Element is not required to be present within the EBML Document ifits Parent Element is present. In this case, the default value of theMandatory EBML ElementMUST be read by the EBML Reader,although the EBML Element is not present within its Parent Element.

If a Mandatory EBML Element has no default value declared by an EBML Schemaand its Parent Element is present, then the EBML ElementMUSTbe present, as well. If a Mandatory EBML Element has a default value declaredby an EBML Schema, and its Parent Element is present, and the value of the EBMLElement is NOT equal to the declared default value, then the EBML ElementMUST be present.

Table 10 clarifies whether a MandatoryEBML ElementMUST be written, according to whether the default valueis declared, the value of the EBML Element is equal to the declared defaultvalue, and/or the Parent Element is used.

Table 10:Demonstration of the conditionalrequirements of VINT Storage
Is the default value declared?Is the value equal to default?Is the Parent Element present?Then is storing the EBML ElementREQUIRED?
YesYesYesNo
YesYesNoNo
YesNoYesYes
YesNoNoNo
Non/aYesYes
Non/aNoNo

11.2.EBML Header Elements

This document contains definitions of all EBML Elements of the EBML Header.

11.2.1.EBML Element

name:
EBML
path:
\EBML
id:
0x1A45DFA3
minOccurs:
1
maxOccurs:
1
type:
Master Element
description:
Set the EBML characteristics of the data to follow. Each EBML Document hasto start with this.

11.2.2.EBMLVersion Element

name:
EBMLVersion
path:
\EBML\EBMLVersion
id:
0x4286
minOccurs:
1
maxOccurs:
1
range:
not 0
default:
1
type:
Unsigned Integer
description:
The version of EBML specifications used to create the EBML Document. Theversion of EBML defined in this document is 1, so EBMLVersionSHOULD be 1.

11.2.3.EBMLReadVersion Element

name:
EBMLReadVersion
path:
\EBML\EBMLReadVersion
id:
0x42F7
minOccurs:
1
maxOccurs:
1
range:
1
default:
1
type:
Unsigned Integer
description:
The minimum EBML version an EBML Reader has to support to read this EBMLDocument. The EBMLReadVersion ElementMUST be less than or equal to EBMLVersion.

11.2.4.EBMLMaxIDLength Element

name:
EBMLMaxIDLength
path:
\EBML\EBMLMaxIDLength
id:
0x42F2
minOccurs:
1
maxOccurs:
1
range:
>=4
default:
4
type:
Unsigned Integer
description:
The EBMLMaxIDLength Element stores the maximum permitted length in octetsof the Element IDs to be found within the EBML Body. An EBMLMaxIDLength Element value of fourisRECOMMENDED, though larger values are allowed.

11.2.5.EBMLMaxSizeLength Element

name:
EBMLMaxSizeLength
path:
\EBML\EBMLMaxSizeLength
id:
0x42F3
minOccurs:
1
maxOccurs:
1
range:
not 0
default:
8
type:
Unsigned Integer
description:
The EBMLMaxSizeLength Element stores the maximum permitted length inoctets of the expressions of all Element Data Sizes to be found within the EBML Body. TheEBMLMaxSizeLength Element documents an upper bound for thelength ofall Element Data Size expressions within the EBML Body and not an upper boundfor thevalue of all Element Data Size expressionswithin the EBML Body. EBML Elements that have an Element Data Size expression that is larger in octetsthan what is expressed by EBMLMaxSizeLength Element are invalid.

11.2.6.DocType Element

name:
DocType
path:
\EBML\DocType
id:
0x4282
minOccurs:
1
maxOccurs:
1
length:
>0
type:
String
description:
A string that describes and identifies the content of the EBML Body thatfollows this EBML Header.

11.2.7.DocTypeVersion Element

name:
DocTypeVersion
path:
\EBML\DocTypeVersion
id:
0x4287
minOccurs:
1
maxOccurs:
1
range:
not 0
default:
1
type:
Unsigned Integer
description:
The version of DocType interpreter used to create the EBML Document.

11.2.8.DocTypeReadVersion Element

name:
DocTypeReadVersion
path:
\EBML\DocTypeReadVersion
id:
0x4285
minOccurs:
1
maxOccurs:
1
range:
not 0
default:
1
type:
Unsigned Integer
description:
The minimum DocType version an EBML Reader has to support to read thisEBML Document. The value of the DocTypeReadVersion ElementMUSTbe less than or equal to the value of the DocTypeVersion Element.

11.2.9.DocTypeExtension Element

name:
DocTypeExtension
path:
\EBML\DocTypeExtension
id:
0x4281
minOccurs:
0
type:
Master Element
description:
A DocTypeExtension adds extra Elements to the main DocType+DocTypeVersiontuple it's attached to. An EBML ReaderMAY know these extra Elements and howto use them. A DocTypeExtensionMAY be used to iterate betweenexperimental Elements before they are integrated into a regularDocTypeVersion. Reading one DocTypeExtension version of aDocType+DocTypeVersion tuple doesn't imply one should be able to read upperversions of this DocTypeExtension.

11.2.10.DocTypeExtensionName Element

name:
DocTypeExtensionName
path:
\EBML\DocTypeExtension\DocTypeExtensionName
id:
0x4283
minOccurs:
1
maxOccurs:
1
length:
>0
type:
String
description:
The name of the DocTypeExtension to differentiate it from otherDocTypeExtensions of the same DocType+DocTypeVersion tuple. A DocTypeExtensionName valueMUST be unique within the EBML Header.

11.2.11.DocTypeExtensionVersion Element

name:
DocTypeExtensionVersion
path:
\EBML\DocTypeExtension\DocTypeExtensionVersion
id:
0x4284
minOccurs:
1
maxOccurs:
1
range:
not 0
type:
Unsigned Integer
description:
The version of the DocTypeExtension. Different DocTypeExtensionVersionvalues of the same DocType + DocTypeVersion + DocTypeExtensionName tupleMAY contain completely different sets of extra Elements. AnEBML ReaderMAY support multiple versionsof the same tuple, only one version of the tuple, or not support the tuple at all.

11.3.Global Elements

EBML allows some special Elements to be found within more than one parentin an EBML Document or optionally at the Root Level of an EBML Body. TheseElements are called Global Elements. There are two Global Elements that can befound in any EBML Document: the CRC-32 Element and the Void Element. An EBMLSchemaMAY add other Global Elements to the format itdefines. These extra elements apply only to the EBML Body, not the EBMLHeader.

Global Elements are EBML Elements whose EBMLLastParent part of the path hasa GlobalPlaceholder. Because it is the last Parent part of the path, a GlobalElement might also have EBMLParentPath parts in its path. In this case, theGlobal Element can only be found within this EBMLParentPath path -- i.e., it'snot fully "global".

A Global Element can be found in many Parent Elements, allowing the same number of occurrences in each Parent where this Element is found.

11.3.1.CRC-32 Element

name:
CRC-32
path:
\(1-\)CRC-32
id:
0xBF
minOccurs:
0
maxOccurs:
1
length:
4
type:
Binary
description:
The CRC-32 Element contains a 32-bit Cyclic Redundancy Check value of allthe Element Data of the Parent Element as stored except for the CRC-32 Elementitself. When the CRC-32 Element is present, the CRC-32 ElementMUST be the first ordered EBML Element within its ParentElement for easier reading. All Top-Level Elements of an EBML Document thatare Master ElementsSHOULD include a CRC-32 Element as a ChildElement. The CRC in use is the IEEE-CRC-32 algorithm as used in the[ISO3309] standard and in Section 8.1.1.6.2 of[ITU.V42], with initial value of 0xFFFFFFFF. The CRC valueMUST be computed on a little-endian bytestream andMUST use little-endian storage.

11.3.2.Void Element

name:
Void
path:
\(-\)Void
id:
0xEC
minOccurs:
0
type:
Binary
description:
Used to void data or to avoid unexpected behaviors when using damageddata. The content is discarded. Also used to reserve space in a subelement forlater use.

12.Considerations for Reading EBML Data

The following scenarios describe events to consider when reading EBMLDocuments, as well as the recommended design of an EBML Reader.

If a Master Element contains a CRC-32 Element that doesn't validate, thenthe EBML ReaderMAY ignore all contained data except forDescendant Elements that contain their own valid CRC-32 Element.

In the following XML representation of a simple, hypothetical EBMLfragment, a Master Element called CONTACT contains two Child Elements, NAMEand ADDRESS. In this example, some data within the NAME Element had beenaltered so that the CRC-32 of the NAME Element does not validate, and thus anyAncestor Element with a CRC-32 would therefore also no longervalidate. However, even though the CONTACT Element has a CRC-32 that does notvalidate (because of the changed data within the NAME Element), the CRC-32 ofthe ADDRESS Element does validate, and thus the contents and semantics of theADDRESS ElementMAY be used.

<CONTACT>    <CRC-32>c119a69b</CRC-32><!-- does not validate -->    <NAME>        <CRC-32>1f59ee2b</CRC-32><!-- does not validate -->        <FIRST-NAME>invalid data</FIRST-NAME>        <LAST-NAME>invalid data</LAST-NAME>    </NAME>    <ADDRESS>        <CRC-32>df941cc9</CRC-32><!-- validates -->        <STREET>valid data</STREET>        <CITY>valid data</CITY>    </ADDRESS></CONTACT>

If a Master Element contains more occurrences of a Child Master Elementthan permitted according to themaxOccurs andrecurringattributes of thedefinition of that Element, then the occurrences in addition tomaxOccursMAY be ignored.

If a Master Element contains more occurrences of a Child Element thanpermitted according to themaxOccurs attribute of the definition of thatElement, then all instances of that Element after the firstmaxOccursoccurrences from the beginning of its Parent ElementSHOULD beignored.

13.Terminating Elements

Null Octets, which are octets with all bits set to zero,MAY follow the value of a String Element or UTF-8 Element to serve as a terminator.An EBML WriterMAY terminate a String Element or UTF-8 Elementwith Null Octets in order to overwrite a stored value with a new value oflesser length while maintaining the same Element Data Size; this can preventthe need to rewrite large portions of an EBML Document. Otherwise, the use ofNull Octets within a String Element or UTF-8 Element isNOT RECOMMENDED.The Element Data of a UTF-8 ElementMUSTbe a valid UTF-8 string up to whichever comes first: the end of the Element orthe first occurring Null octet. Within the Element Data of a String or UTF-8 Element,any Null octet itself and any following data within that ElementSHOULD be ignored. A string value and a copy of that stringvalue terminated by one or more Null Octets are semantically equal.

Table 11 shows examples of semanticsand validation for the use of Null Octets. Values to represent Stored Valuesand the Semantic Meaning as represented as hexadecimal values.

Table 11:Examples of semantics for NullOctets in VINT_DATA
Stored ValueSemantic Meaning
0x65 0x62 0x6D 0x6C0x65 0x62 0x6D 0x6C
0x65 0x62 0x00 0x6C0x65 0x62
0x65 0x62 0x00 0x000x65 0x62
0x65 0x620x65 0x62

14.Guidelines for Updating Elements

An EBML Document can be updated without requiring that the entire EBMLDocument be rewritten. These recommendations describe strategies for changingthe Element Data of a written EBML Element with minimal disruption to the restof the EBML Document.

14.1.Reducing Element Data in Size

There are three methods to reduce the size of Element Data of a written EBML Element.

14.1.1.Adding a Void Element

When an EBML Element is changed to reduce its total length by more than one octet, an EBML WriterSHOULD fill the freed space with a Void Element.

14.1.2.Extending the Element Data Size

The same value for Element Data SizeMAY be written in various lengths, so for minor reductions of the Element Data, the Element SizeMAY be written to a longer octet length to fill the freed space.

For example, the first row ofTable 12 depicts a String Element that storesan Element ID (3 octets), Element Data Size (1 octet), and Element Data (4octets). If the Element Data is changed to reduce the length by one octet, andif the current length of the Element Data Size is less than its maximumpermitted length, then the Element Data Size of that ElementMAY be rewritten to increase its length by one octet. Thus,before and after the change, the EBML Element maintains the same length of 8octets, and data around the Element does not need to be moved.

Table 12:Example of editing a VINT toreduce VINT_DATA length by one octet
StatusElement IDElement Data SizeElement Data
Before edit0x3B40400x840x65626D6C
After edit0x3B40400x40030x6D6B76

This method isRECOMMENDED when the Element Data isreduced by a single octet; for reductions by two or more octets, it isRECOMMENDED to fill the freed space with a Void Element.

Note that if the Element Data length needs to be rewritten as shortened byone octet and the Element Data Size could be rewritten as a shorter VINT, thenit isRECOMMENDED to rewrite the Element Data Size as one octetshorter, shorten the Element Data by one octet, and follow that Element with aVoid Element. For example,Table 13 depicts a String Elementthat stores an Element ID (3 octets), Element Data Size (2 octets, but couldbe rewritten in one octet), and Element Data (3 octets). If the Element Datais to be rewritten to a two-octet length, then another octet can be taken fromElement Data Size so that there is enough space to add a two-octet VoidElement.

Table 13:Example of editing aVINT to reduce VINT_DATA length by more than one octet
StatusElement IDElement Data SizeElement DataVoid Element
Before0x3B40400x40030x6D6B76
After0x3B40400x820x68690xEC80

14.1.3.Terminating Element Data

For String Elements and UTF-8 Elements, the length of Element Data could bereduced by adding Null Octets to terminate the Element Data (seeSection 13).

InTable 14, Element Data four octetslong is changed to a value three octets long, followed by a Null Octet; theElement Data Size includes any Null Octets used to terminate Element Data and thereforeremains unchanged.

Table 14:Example of terminating VINT_DATAwith a Null Octet when reducing VINT length during an edit
StatusElement IDElement Data SizeElement Data
Before edit0x3B40400x840x65626D6C
After edit0x3B40400x840x6D6B7600

Note that this method isNOT RECOMMENDED. Forreductions of one octet, the method for Extending the Element Data SizeSHOULD be used. For reduction by more than one octet, themethod for Adding a Void ElementSHOULD be used.

14.2.Considerations when Updating Elements with Cyclic Redundancy Check (CRC)

If the Element to be changed is a Descendant Element of any Master Elementthat contains a CRC-32 Element (seeSection 11.3.1),then the CRC-32 ElementMUST be verified before permitting thechange. Additionally, the CRC-32 Element valueMUST besubsequently updated to reflect the changed data.

15.Backward and Forward Compatibility

Elements of an EBML formatSHOULD be designed with backward and forward compatibility in mind.

15.1.Backward Compatibility

Backward compatibility of new EBML Elements can be achieved by using default values for mandatory elements. The default valueMUST represent the state that was assumed for previous versions of the EBML Schema, without this new EBML Element. If such a state doesn't make sense for previous versions, then the new EBML ElementSHOULD NOT be mandatory.

Non-mandatory EBML Elements can be added in a new EBMLDocTypeVersion. Sincethey are not mandatory, they won't be found in older versions of theEBMLDocTypeVersion, just as they might not be found in newer versions. Thiscauses no compatibility issue.

15.2.Forward Compatibility

EBML ElementsMAY be marked as deprecated in a newEBMLDocTypeVersion using themaxver attribute of the EBML Schema. If such anElement is found in an EBML Document with a newer version of theEBMLDocTypeVersion, itSHOULD be discarded.

16.Security Considerations

EBML itself does not offer any kind of security and does not provide confidentiality. EBML does not provide any kind of authorization. EBML only offers marginally useful and effective data integrity options, such as CRC elements.

Even if the semantic layer offers any kind of encryption, EBML itself couldleak information at both the semantic layer (as declared via the DocTypeElement) and within the EBML structure (the presence of EBML Elements can bederived even with an unknown semantic layer using a heuristic approach -- notwithout errors, of course, but with a certain degree of confidence).

An EBML Document that has the following issues may still be handled by theEBML Reader and the data accepted as such, depending on how strict the EBMLReader wants to be:

Element IDs that are unknown to the EBML ReaderMAY beaccepted as valid EBML IDs in order to skip such elements.

EBML Elements with a string type may contain extra data after the first0x00. These dataMUST be discarded according to theSection 13 rules.

An EBML Reader may discard some or all data if the following errors are found in the EBML Document:

Side-channel attacks could exploit:

17.IANA Considerations

17.1.EBML Element IDs Registry

This document creates a new IANA registry called the"EBML Element IDs" registry.

Element IDs are described inSection 5. ElementIDs are encoded using the VINT mechanism described inSection 4 and can be between one and fiveoctets long. Five-octet-long Element IDs are possible only if declaredin the header.

This IANA registry only applies to Elements that can be containedin the EBML Header, thus including Global Elements. Elements onlyfound in the EBML Body have their own set of independent Element IDsand are not part of this IANA registry.

One-octet Element IDsMUST be between 0x81 and0xFE. These items are valuable because they are short, and they needto be used for commonly repeated elements. Element IDs are to beallocated within this range according to the "RFC Required"policy[RFC8126].

The following one-octet Element IDs are RESERVED: 0xFF and0x80.

Values in the one-octet range of 0x00 to 0x7F are not valid for useas an Element ID.

Two-octet Element IDsMUST be between 0x407F and0x7FFE. Element IDs are to be allocated within this range according tothe "Specification Required" policy[RFC8126].

The following two-octet Element IDs are RESERVED: 0x7FFF and0x4000.

Values in the two-octet ranges of 0x0000 to 0x3FFF and 0x8000 to 0xFFFF arenot valid for use as an Element ID.

Three-octet Element IDsMUST be between 0x203FFF and 0x3FFFFE. Element IDs are to be allocated within this range according to the "First Come First Served" policy[RFC8126].

The following three-octet Element IDs are RESERVED: 0x3FFFFF and0x200000.

Values in the three-octet ranges of 0x000000 to 0x1FFFFF and0x400000 to 0xFFFFFF are not valid for use as an Element ID.

Four-octet Element IDsMUST be between 0x101FFFFFand 0x1FFFFFFE. Four-octet Element IDs are somewhat special in thatthey are useful for resynchronizing to major structures in the eventof data corruption or loss. As such, four-octet Element IDs are splitinto two categories. Four-octet Element IDs whose lower three octets(as encoded) would make printable 7-bit ASCII values (0x20 to 0x7E,inclusive)MUST be allocated by the "SpecificationRequired" policy. Sequential allocation of values is notrequired: specificationsSHOULD include a specificrequest and are encouraged to do early allocations.

To be clear about the above category: four-octet Element IDs always startwith hex 0x10 to 0x1F, and that octet may be chosen so that the entire VINThas some desirable property, such as a specific CRC. The other three octets,when ALL having values between 0x20 (32, ASCII Space) and 0x7E (126, ASCII"~"), fall into this category.

Other four-octet Element IDs may be allocated by the "First Come First Served" policy.

The following four-octet Element IDs are RESERVED: 0x1FFFFFFF and 0x10000000.

Values in the four-octet ranges of 0x00000000 to 0x0FFFFFFF and 0x20000000to 0xFFFFFFFF are not valid for use as an Element ID.

Five-octet Element IDs (values from 0x080FFFFFFF to 0x0FFFFFFFFE) are RESERVED according to the "Experimental Use" policy[RFC8126]: they may be used by anyone at any time, but there is no coordination.

ID Values found in this document are assigned as initial values as follows:

Table 15:IDs and Names for EBML Elements assigned by this document
Element IDElement NameReference
0x1A45DFA3EBMLDescribed inSection 11.2.1
0x4286EBMLVersionDescribed inSection 11.2.2
0x42F7EBMLReadVersionDescribed inSection 11.2.3
0x42F2EBMLMaxIDLengthDescribed inSection 11.2.4
0x42F3EBMLMaxSizeLengthDescribed inSection 11.2.5
0x4282DocTypeDescribed inSection 11.2.6
0x4287DocTypeVersionDescribed inSection 11.2.7
0x4285DocTypeReadVersionDescribed inSection 11.2.8
0x4281DocTypeExtensionDescribed inSection 11.2.9
0x4283DocTypeExtensionNameDescribed inSection 11.2.10
0x4284DocTypeExtensionVersionDescribed inSection 11.2.11
0xBFCRC-32Described inSection 11.3.1
0xECVoidDescribed inSection 11.3.2

17.2.EBML DocTypes Registry

This document creates a new IANA registry called the "EBML DocTypes" registry.

To register a new DocType in this registry, one needs a DocType name, a Description of the DocType, a Change Controller (IESG or email of registrant), and an optional Reference to a document describing the DocType.

DocType values are described inSection 11.1.4.1. DocTypesare ASCII strings, defined inSection 7.4, whichlabel the official name of the EBML Document Type. The strings may beallocated according to the "First Come First Served" policy.

The use of ASCII corresponds to the types and code already in use; thevalue is not meant to be visible to the user.

DocType string values of "matroska" and "webm" are RESERVED to the IETF for future use.These can be assigned via the "IESG Approval" or "RFC Required" policies[RFC8126].

18.Normative References

[IEEE.754]
IEEE,"IEEE Standard for Binary Floating-Point Arithmetic",,<https://standards.ieee.org/standard/754-2019.html>.
[ISO3309]
International Organization for Standardization,"Data communication -- High-level data link control procedures -- Frame structure",ISO 3309, 3rd Edition,,<https://www.iso.org/standard/8558.html>.
[ISO9899]
International Organization for Standardization,"Information technology -- Programming languages -- C",ISO/IEC 9899:2011,,<https://www.iso.org/standard/57853.html>.
[ITU.V42]
International Telecommunications Union,"Error-correcting procedures for DCEs using asynchronous-to-synchronous conversion",ITU-T Recommendation V.42,,<https://www.itu.int/rec/T-REC-V.42>.
[RFC0020]
Cerf, V.,"ASCII format for network interchange",STD 80,RFC 20,DOI 10.17487/RFC0020,,<https://www.rfc-editor.org/info/rfc20>.
[RFC2119]
Bradner, S.,"Key words for use in RFCs to Indicate Requirement Levels",BCP 14,RFC 2119,DOI 10.17487/RFC2119,,<https://www.rfc-editor.org/info/rfc2119>.
[RFC2648]
Moats, R.,"A URN Namespace for IETF Documents",RFC 2648,DOI 10.17487/RFC2648,,<https://www.rfc-editor.org/info/rfc2648>.
[RFC3339]
Klyne, G. and C. Newman,"Date and Time on the Internet: Timestamps",RFC 3339,DOI 10.17487/RFC3339,,<https://www.rfc-editor.org/info/rfc3339>.
[RFC3629]
Yergeau, F.,"UTF-8, a transformation format of ISO 10646",STD 63,RFC 3629,DOI 10.17487/RFC3629,,<https://www.rfc-editor.org/info/rfc3629>.
[RFC3688]
Mealling, M.,"The IETF XML Registry",BCP 81,RFC 3688,DOI 10.17487/RFC3688,,<https://www.rfc-editor.org/info/rfc3688>.
[RFC5234]
Crocker, D., Ed. and P. Overell,"Augmented BNF for Syntax Specifications: ABNF",STD 68,RFC 5234,DOI 10.17487/RFC5234,,<https://www.rfc-editor.org/info/rfc5234>.
[RFC5646]
Phillips, A., Ed. and M. Davis, Ed.,"Tags for Identifying Languages",BCP 47,RFC 5646,DOI 10.17487/RFC5646,,<https://www.rfc-editor.org/info/rfc5646>.
[RFC7405]
Kyzivat, P.,"Case-Sensitive String Support in ABNF",RFC 7405,DOI 10.17487/RFC7405,,<https://www.rfc-editor.org/info/rfc7405>.
[RFC8126]
Cotton, M., Leiba, B., and T. Narten,"Guidelines for Writing an IANA Considerations Section in RFCs",BCP 26,RFC 8126,DOI 10.17487/RFC8126,,<https://www.rfc-editor.org/info/rfc8126>.
[RFC8141]
Saint-Andre, P. and J. Klensin,"Uniform Resource Names (URNs)",RFC 8141,DOI 10.17487/RFC8141,,<https://www.rfc-editor.org/info/rfc8141>.
[RFC8174]
Leiba, B.,"Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words",BCP 14,RFC 8174,DOI 10.17487/RFC8174,,<https://www.rfc-editor.org/info/rfc8174>.
[XHTML]
McCarron, S.,"XHTML(tm) Basic 1.1 -- Second Edition",Latest version available at https://www.w3.org/TR/xhtml-basic,,<https://www.w3.org/TR/2018/SPSD-xhtml-basic-20180327/>.
[XML]
Bray, T., Ed., Paoli, J., Ed., Sperberg-McQueen, C.M., Ed., Maler, E., Ed., and F. Yergeau, Ed.,"Extensible Markup Language (XML) 1.0 (Fifth Edition)",Latest version available at https://www.w3.org/TR/xml/,,<https://www.w3.org/TR/2008/REC-xml-20081126/>.
[XML-SCHEMA]
Fallside, D.C. and P. Walmsley,"XML Schema Part 0: Primer Second Edition",Latest version available at http://www.w3.org/TR/xmlschema-0/,,<https://www.w3.org/TR/2004/REC-xmlschema-0-20041028/>.

19.Informative References

[Matroska]
Lhomme, S., Bunkus, M., and D. Rice,"Matroska Media Container Format Specifications",Work in Progress,Internet-Draft, draft-ietf-cellar-matroska-05,,<https://tools.ietf.org/html/draft-ietf-cellar-matroska-05>.
[WebM]
The WebM Project,"WebM Container Guidelines",,<https://www.webmproject.org/docs/container/>.
[XPath]
Clark, J., Ed. and S. DeRose,"XML Path Language (XPath) Version 1.0",Latest version available at https://www.w3.org/TR/xpath,,<https://www.w3.org/TR/1999/REC-xpath-19991116>.

Authors' Addresses

Steve Lhomme
Email:slhomme@matroska.org
Dave Rice
Email:dave@dericed.com
Moritz Bunkus
Email:moritz@bunkus.org

[8]ページ先頭

©2009-2025 Movatter.jp