Internet-Draft | Matroska Chapter Codecs | July 2023 |
Lhomme, et al. | Expires 3 January 2024 | [Page] |
This document defines common Matroska Chapter Codecs, the basic Matroska Script and the DVD inspired DVD menu [DVD-Video].¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 3 January 2024.¶
Copyright (c) 2023 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 Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
TODO¶
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 [Matroska].¶
Tag
values can be either strings or binary blobs. This document inherits security
considerations from the EBML and Matroska documents.¶
To be determined.¶
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 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
Chapter codecs are a way to add more complex playback features than the usual linear playback.¶
Some ChapProcess
elements hold commands to execute when entering/leaving a chapter.¶
When chapter codecs are used the EditionFlagOrdered
of the edition they belong to MUST be set.¶
Chapter Codecs can reference another Segment
and jump to that Segment
.¶
The Chapter Codecs MAY store the Segment information in their own format, possibly not using the SegmentUUID
format.
The ChapterTranslate
element and its child elements SHOULD be used
to link the internal chapter codec representation, the chapter codec number and the actual Segment it represents.¶
For example, if a chapter codec of type "1" in SegmentA needs to link to SegmentB, it can store that information as "SegB" in its internal data.¶
The translation ChapterTranslate
in SegmentB would use the following elements:
* ChapterTranslate\ChapterTranslateCodec
= 1
* ChapterTranslate\ChapterTranslateID
= "SegB"¶
The Matroska Player
MUST use the SegmentFamily
to find all Segments that need translation
between the chapter codec values and the actual segment it targets.¶
When Nested Chapters
contain chapters codecs -- via the ChapProcess
Element --
the enter/leave commands -- ChapProcessTime Element -- MUST be executed in a specific order,
if the Matroska Player supports the chapter codecs included in the chapters.¶
When starting playback, the Matroska Player
MUST start at the ChapterTimeStart
of the first chapter of the ordered chapter.
The enter commands of that chapter MUST be executed.
If that chapter contains Nested Chapters
, the enter commands of the Nested Chapter
with the same ChapterTimeStart
MUST be executed.
If that chapter contains Nested Chapters
, the enter commands of the Nested Chapter
with the same ChapterTimeStart
MUST be executed,
and so on until there is no Nested Chapter
with the same ChapterTimeStart
.¶
When switching from a chapter to another:¶
ChapProcessTime
=2) of the
chapter MUST be executed, then the leave commands of its parent chapter, etc. until the
common Parent Chapter
or Edition
element. The leave command of that Parent Chapter
or Edition
element
MUST NOT be executed.¶
ChapProcessTime
=1) of the Nested Chapter
of the common Parent Chapter
or Edition
element,
to reach the chapter we switch to, MUST be executed, then the enter commands of its Nested Chapter
to reach the chapter we switch to MUST be executed, until that chapter is the chapter we switch to.
The enter commands of that chapter MUST be executed as well.¶
When the last Chapter finished playing -- i.e. its ChapterTimeEnd
has been reached --
the Matroska Player
MUST execute its leaved commands, then the leave commands of it's Parent Chapter
,
until the parent of the chapter is the Edition.¶
This is the case when ChapProcessCodecID
= 0. This is a script language build for
Matroska purposes. The inspiration comes from ActionScript, javascript and other similar
scripting languages. The commands are stored as text commands, in UTF-8. The syntax is C like,
with commands spanned on many lines, each terminating with a ";". You can also include comments
at the end of lines with "//" or comment many lines using "/* */". The scripts are stored
in ChapProcessData. For the moment ChapProcessPrivate is not used.¶
The one and only command existing for the moment is GotoAndPlay( ChapterUID );
. As the
same suggests, it means that, when this command is encountered, the Matroska Player
SHOULD jump to the Chapter
specified by the UID and play it.¶