Matroska Media Container Control Track Specifications
slhomme@matroska.org
moritz@bunkus.org
dave@dericed.com
art
cellar
binary
storage
matroska
ebml
webm
codec
This document defines the Control Track usage found in the Matroska container.
Status of this document
This document is a work-in-progress specification defining the Matroska file format as part
of the IETF Cellar working group.
It uses basic elements and concept already defined in the Matroska specifications defined by this workgroup.
Security Considerations
This document inherits security considerations from the EBML and Matroska documents.
IANA Considerations
To be determined.
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 as
described in BCP 14
when, and only when, they appear in all capitals, as shown here.
Edition Flags
EditionFlagHidden
When the EditionFlagHidden flag is set to false it means the Edition is visible and selectable
in a Matroska Player.
All ChapterAtoms Elements MUST be interpreted with their own ChapterFlagHidden flags.
ChapterAtom visibility to the user
ChapterFlagHidden |
False |
True |
visible |
Chapter 1 |
X |
|
yes |
Chapter 2 |
|
X |
no |
When the EditionFlagHidden flag is set to true the Edition is hidden and SHOULD NOT be
selectable in a Matroska Player.
If all Editions EditionFlagHidden flags are set to true, there is no visible Edition.
In this case all ChapterAtoms Elements MUST also be interpreted as if their ChapterFlagHidden
flag is also set to true, regardless with their own ChapterFlagHidden flags.
ChapterAtom visibility in hidden editions
ChapterFlagHidden |
False |
True |
visible |
Chapter 1 |
X |
|
no |
Chapter 2 |
|
X |
no |
EditionFlagDefault
It is RECOMMENDED that no more than one Edition have an EditionFlagDefault Flag
set to true. The first Edition with both the EditionFlagDefault Flag set to true
and the EditionFlagHidden Flag set to false is the Default Edition. When all
EditionFlagDefault Flags are set to false, then the first Edition with the
EditionFlagHidden Flag set to false is the Default Edition. The Default Edition
is the edition that should be used for playback by default.
Default Edition
The Default Edition is the Edition that a Matroska Player SHOULD use for playback by default.
The first Edition with both the EditionFlagDefault flag set to true and the EditionFlagHidden
flag set to false is the Default Edition.
When all EditionFlagDefault flags are set to false and all EditionFlagHidden flag set to true,
then the first Edition is the Default Edition.
When all EditionFlagHidden flags are set to true, then the first Edition with the
EditionFlagDefault flag set to true is the Default Edition.
When all EditionFlagDefault flags are set to false, then the first Edition with the
EditionFlagHidden flag set to false is the Default Edition.
When there is no Edition with a EditionFlagDefault flag are set to true and a
EditionFlagHidden flags are set to false, then the first Edition with the EditionFlagHidden
flag set to false is the Default Edition.
In other words, in case the Default Edition is not obvious, the first Edition with a
EditionFlagHidden flag set to false SHOULD be preferred.
Default edition, some visible, all default
Edition |
FlagHidden |
FlagDefault |
Default Edition |
Edition 1 |
true |
true |
|
Edition 2 |
true |
true |
|
Edition 3 |
false |
true |
X |
Default edition, all hidden, no default
Edition |
FlagHidden |
FlagDefault |
Default Edition |
Edition 1 |
true |
false |
X |
Edition 2 |
true |
false |
|
Edition 3 |
true |
false |
|
Default edition, all hidden, with default
Edition |
FlagHidden |
FlagDefault |
Default Edition |
Edition 1 |
true |
false |
|
Edition 2 |
true |
true |
X |
Edition 3 |
true |
false |
|
Default edition, some visible, no default
Edition |
FlagHidden |
FlagDefault |
Default Edition |
Edition 1 |
true |
false |
|
Edition 2 |
false |
false |
X |
Edition 3 |
false |
false |
|
Default edition, some visible, some default
Edition |
FlagHidden |
FlagDefault |
Default Edition |
Edition 1 |
true |
false |
|
Edition 2 |
true |
true |
|
Edition 3 |
false |
false |
X |
Chapter Flags
If a Control Track toggles the parent's ChapterFlagHidden
flag to false, then only the parent ChapterAtom and its second child ChapterAtom
MUST be interpreted as if ChapterFlagHidden is set to false. The first child
ChapterAtom, which has the ChapterFlagHidden flag set to true, retains its value
until its value is toggled to false by a Control Track.
The ChapterFlagEnabled value can be toggled by control tracks.
ChapterFlagEnabled
If the ChapterFlagEnabled flag is set to false a Matroska Player MUST NOT use this
Chapter and all his Nested Chapters.
For Simple Chapters, a Matroska Player MAY display this enabled Chapter with a marker in
the timeline.
For Ordered Chapters a Matroska Player MUST use the duration of this enabled Chapter.
Chapter + Nested Chapter |
ChapterFlagEnabled |
used |
Chapter 1 |
true |
yes |
+Nested Chapter 1.1 |
true |
yes |
+Nested Chapter 1.2 |
false |
no |
++Nested Chapter 1.2.1 |
true |
no |
++Nested Chapter 1.2.2 |
false |
no |
Chapter 2 |
false |
no |
+Nested Chapter 2.1 |
true |
no |
+Nested Chapter 2.2 |
true |
no |
Matroska Schema
Extra elements used to handle Control Tracks and advanced selection features:
Segment
Chapters
EditionEntry
EditionFlagHidden Element
- name:
- EditionFlagHidden
- path:
- \Segment\Chapters\EditionEntry\EditionFlagHidden
- id:
- 0x45BD
- minOccurs:
- 1
- maxOccurs:
- 1
- range:
- 0-1
- default:
- 0
- type:
- uinteger
- definition:
- Set to 1 if an edition is hidden. Hidden editions SHOULD NOT be available to the user interface
(but still to Control Tracks; see on Chapter flags).
ChapterFlagEnabled Element
- name:
- ChapterFlagEnabled
- path:
- \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterFlagEnabled
- id:
- 0x4598
- minOccurs:
- 1
- maxOccurs:
- 1
- range:
- 0-1
- default:
- 1
- type:
- uinteger
- definition:
- Set to 1 if the chapter is enabled. It can be enabled/disabled by a Control Track.
When disabled, the movie SHOULD skip all the content between the TimeStart and TimeEnd of this chapter; see on Chapter flags.
ChapterTrack Element
- name:
- ChapterTrack
- path:
- \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterTrack
- id:
- 0x8F
- maxOccurs:
- 1
- type:
- master
- definition:
- List of tracks on which the chapter applies. If this Element is not present, all tracks apply
ChapterTrackUID Element
- name:
- ChapterTrackUID
- path:
- \Segment\Chapters\EditionEntry\+ChapterAtom\ChapterTrack\ChapterTrackUID
- id:
- 0x89
- minOccurs:
- 1
- range:
- not 0
- type:
- uinteger
- definition:
- UID of the Track to apply this chapter to.
In the absence of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks.
Absence of this Element indicates that the Chapter SHOULD be applied to any currently used Tracks.
Menu Specifications
This document is a draft of the Menu system that will be the default one in Matroska.
As it will just be composed of a Control Track, it will be seen as a "codec" and could be
replaced later by something else if needed.
A menu is like what you see on DVDs, when you have some screens to select the audio format,
subtitles or scene selection.
Requirements
What we'll try to have is a system that can do almost everything done on a DVD, or more,
or better, or drop the unused features if necessary.
As the name suggests, a Control Track is a track that can control the playback of the file
and/or all the playback features. To make it as simple as possible for Matroska Players,
the Control Track will just give orders to the Matroska Player and get the actions
associated with the highlights/hotspots.
Highlights/Hotspots
A highlight is basically a rectangle/key associated with an action UID. When that
rectangle/key is activated, the Matroska Player send the UID of the action to the
Control Track handler (codec). The fact that it can also be a key means that even for
audio only files, a keyboard shortcut or button panel could be used for menus.
But in that case, the hotspot will have to be associated with a name to display.
This highlight is sent from the Control Track to the Matroska Player. Then the
Matroska Player has to handle that highlight until it's deactivated; see .
The highlight contains a UID of the action, a displayable name (UTF-8), an associated
key (list of keys to be defined, probably up/down/left/right/select), a screen position/range
and an image to display. The image will be displayed either when the user place
the mouse over the rectangle (or any other shape), or when an option of the screen
is selected (not activated). There could be a second image used when the option is activated.
And there could be a third image that can serve as background. This way you could have
a still image (like in some DVDs) for the menu and behind that image blank video (small bitrate).
When a highlight is activated by the user, the Matroska Player has to send the UID of
the action to the Control Track. Then the Control Track codec will handle the action
and possibly give new orders to the Matroska Player.
The format used for storing images SHOULD be extensible. For the moment we'll use
PNG and BMP, both with alpha channel.
Playback features
All the following features will be sent from the Control Track to the Matroska Player :
- Jump to chapter (UID, prev, next, number)
- Disable all tracks of a kind (audio, video, subtitle)
- Enable track UID (the kind doesn't matter)
- Define/Disable a highlight
- Enable/Disable jumping
- Enable/Disable track selection of a kind
- Select Edition ID (see chapters)
- Pause playback
- Stop playback
- Enable/Disable a Chapter UID
- Hide/Unhide a Chapter UID
All the actions will be written in a normal Matroska track, with a timestamp.
A "Menu Frame" SHOULD be able to contain more that one action/highlight for a given
timestamp. (to be determined, EBML format structure)
Player requirements
Some Matroska Players might not support the control track. That mean they will play
the active/looped parts as part of the data. So I suggest putting the active/looped
parts of a movie at the end of a movie. When a Menu-aware Matroska Player encounter
the default Control Track of a Matroska file, the first order SHOULD be to jump at
the start of the active/looped part of the movie.
Working Graph
Matroska Source file -> Control Track <-> Player.
-> other tracks -> rendered
Normative References