<?xml version="1.0" encoding="utf-8"?>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc version="3" ipr="trust200902" docName="draft-ietf-cellar-chapter-codecs-00" sortRefs="true" tocDepth="4" submissionType="IETF" category="std" xml:lang="en" xmlns:xi="http://www.w3.org/2001/XInclude" indexInclude="false" consensus="true">

<front>
<title abbrev="Matroska Chapter Codecs">Matroska Media Container Chapter Codecs Specifications</title><seriesInfo value="draft-ietf-cellar-chapter-codecs-00" stream="IETF" status="standard" name="Internet-Draft"></seriesInfo>
<author initials="S." surname="Lhomme" fullname="Steve Lhomme"><organization></organization><address><postal><street></street>
</postal><email>slhomme@matroska.org</email>
</address></author><author initials="M." surname="Bunkus" fullname="Moritz Bunkus"><organization></organization><address><postal><street></street>
</postal><email>moritz@bunkus.org</email>
</address></author><author initials="D." surname="Rice" fullname="Dave Rice"><organization></organization><address><postal><street></street>
</postal><email>dave@dericed.com</email>
</address></author><date year="2021" month="October" day="9"></date>
<area>art</area>
<workgroup>cellar</workgroup>
<keyword>binary</keyword>
<keyword>storage</keyword>
<keyword>matroska</keyword>
<keyword>ebml</keyword>
<keyword>tags</keyword>

<abstract>
<t>This document defines common Matroska Chapter Codecs, the basic Matroska Script and the DVD inspired DVD menu.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t><em>TODO</em></t>
</section>

<section anchor="status-of-this-document"><name>Status of this document</name>
<t>This document is a work-in-progress specification defining the Matroska file format as part
of the <eref target="https://datatracker.ietf.org/wg/cellar/charter/">IETF Cellar working group</eref>.
It uses basic elements and concepts already defined in the Matroska specifications defined by this workgroup.</t>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t><tt>Tag</tt> values can be either strings or binary blobs. This document inherits security
considerations from the EBML and Matroska documents.</t>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>To be determined.</t>
</section>

<section anchor="notation-and-conventions"><name>Notation and Conventions</name>
<t>The key words &quot;<bcp14>MUST</bcp14>&quot;, &quot;<bcp14>MUST NOT</bcp14>&quot;,
&quot;<bcp14>REQUIRED</bcp14>&quot;, &quot;<bcp14>SHALL</bcp14>&quot;, &quot;<bcp14>SHALL NOT</bcp14>&quot;,
&quot;<bcp14>SHOULD</bcp14>&quot;, &quot;<bcp14>SHOULD NOT</bcp14>&quot;,
&quot;<bcp14>RECOMMENDED</bcp14>&quot;, &quot;<bcp14>NOT RECOMMENDED</bcp14>&quot;,
&quot;<bcp14>MAY</bcp14>&quot;, and &quot;<bcp14>OPTIONAL</bcp14>&quot; in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"></xref> <xref target="RFC8174"></xref>
when, and only when, they appear in all capitals, as shown here.</t>
</section>

<section anchor="matroska-chapter-codecs"><name>Matroska Chapter Codecs</name>
<t><em>TODO</em></t>

<section anchor="matroska-script-0"><name>Matroska Script (0)</name>
<t>This is the case when <tt>ChapProcessCodecID</tt> = 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 &quot;;&quot;. You can also include comments
at the end of lines with &quot;//&quot; or comment many lines using &quot;/* */&quot;. The scripts are stored
in ChapProcessData. For the moment ChapProcessPrivate is not used.</t>
<t>The one and only command existing for the moment is <tt>GotoAndPlay( ChapterUID );</tt>. As the
same suggests, it means that, when this command is encountered, the <tt>Matroska Player</tt>
<bcp14>SHOULD</bcp14> jump to the <tt>Chapter</tt> specified by the UID and play it.</t>
</section>

<section anchor="dvd-menu-1"><name>DVD menu (1)</name>
<t>This is the case when <tt>ChapProcessCodecID</tt> = 1. Each level of a chapter corresponds
to a logical level in the DVD system that is stored in the first octet of the ChapProcessPrivate.
This DVD hierarchy is as follows:</t>
<table>
<thead>
<tr>
<th>ChapProcessPrivate</th>
<th>DVD Name</th>
<th>Hierarchy</th>
<th>Commands Possible</th>
<th>Comment</th>
</tr>
</thead>

<tbody>
<tr>
<td>0x30</td>
<td>SS</td>
<td>DVD domain</td>
<td>-</td>
<td>First Play, Video Manager, Video Title</td>
</tr>

<tr>
<td>0x2A</td>
<td>LU</td>
<td>Language Unit</td>
<td>-</td>
<td>Contains only PGCs</td>
</tr>

<tr>
<td>0x28</td>
<td>TT</td>
<td>Title</td>
<td>-</td>
<td>Contains only PGCs</td>
</tr>

<tr>
<td>0x20</td>
<td>PGC</td>
<td>Program Group Chain (PGC)</td>
<td>*</td>
<td></td>
</tr>

<tr>
<td>0x18</td>
<td>PG</td>
<td>Program 1 / Program 2 / Program 3</td>
<td>-</td>
<td></td>
</tr>

<tr>
<td>0x10</td>
<td>PTT</td>
<td>Part Of Title 1 / Part Of Title 2</td>
<td>-</td>
<td>Equivalent to the chapters on the sleeve.</td>
</tr>

<tr>
<td>0x08</td>
<td>CN</td>
<td>Cell 1 / Cell 2 / Cell 3 / Cell 4 / Cell 5 / Cell 6</td>
<td>-</td>
<td></td>
</tr>
</tbody>
</table><t>You can also recover wether a Segment is a Video Manager (VMG), Video Title Set (VTS)
or Video Title Set Menu (VTSM) from the ChapterTranslateID element found in the Segment Info.
This field uses 2 octets as follows:</t>

<ol>
<li>Domain Type: 0 for VMG, the domain number for VTS and VTSM</li>
<li>Domain Value: 0 for VMG and VTSM, 1 for the VTS source.</li>
</ol>
<t>For instance, the menu part from VTS<em>01</em>0.VOB would be coded [1,0] and the content
part from VTS<em>02</em>3.VOB would be [2,1]. The VMG is always [0,0]</t>
<t>The following octets of ChapProcessPrivate are as follows:</t>
<table>
<thead>
<tr>
<th>Octet 1</th>
<th>DVD Name</th>
<th>Following Octets</th>
</tr>
</thead>

<tbody>
<tr>
<td>0x30</td>
<td>SS</td>
<td>Domain name code (1: 0x00= First play, 0xC0= VMG, 0x40= VTSM, 0x80= VTS) + VTS(M) number (2)</td>
</tr>

<tr>
<td>0x2A</td>
<td>LU</td>
<td>Language code (2) + Language extension (1)</td>
</tr>

<tr>
<td>0x28</td>
<td>TT</td>
<td>global Title number (2) + corresponding TTN of the VTS (1)</td>
</tr>

<tr>
<td>0x20</td>
<td>PGC</td>
<td>PGC number (2) + Playback Type (1) + Disabled User Operations (4)</td>
</tr>

<tr>
<td>0x18</td>
<td>PG</td>
<td>Program number (2)</td>
</tr>

<tr>
<td>0x10</td>
<td>PTT</td>
<td>PTT-chapter number (1)</td>
</tr>

<tr>
<td>0x08</td>
<td>CN</td>
<td>Cell number [VOB ID(2)][Cell ID(1)][Angle Num(1)]</td>
</tr>
</tbody>
</table><t>If the level specified in ChapProcessPrivate is a PGC (0x20), there is an octet
called the Playback Type, specifying the kind of PGC defined:</t>

<ul>
<li>0x00: entry only/basic PGC</li>
<li>0x82: Title+Entry Menu (only found in the Video Manager domain)</li>
<li>0x83: Root Menu (only found in the VTSM domain)</li>
<li>0x84: Subpicture Menu (only found in the VTSM domain)</li>
<li>0x85: Audio Menu (only found in the VTSM domain)</li>
<li>0x86: Angle Menu (only found in the VTSM domain)</li>
<li>0x87: Chapter Menu (only found in the VTSM domain)</li>
</ul>
<t>The next 4 following octets correspond to the <tt>User Operation flags</tt>
in the standard PGC. When a bit is set, the command <bcp14>SHOULD</bcp14> be disabled.</t>
<t>ChapProcessData contains the pre/post/cell commands in binary format as there are stored on a DVD.
There is just an octet preceding these data to specify the number of commands in the element.
As follows: [# of commands(1)][command 1 (8)][command 2 (8)][command 3 (8)].</t>
<t>More information on the DVD commands and format on DVD
from the <xref target="DVD-Info"></xref> project.</t>
</section>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
</references>
<references><name>Informative References</name>
<reference anchor="DVD-Info" target="http://dvd.sourceforge.net/dvdinfo/">
  <front>
    <title>DVD-Video Information</title>
    <author></author>
  </front>
  <refcontent></refcontent>
</reference>
</references>

</back>

</rfc>
