Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup Chapter Codec document #833

Merged
merged 15 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ $(OUTPUT_CODEC).md: index_codec.md codec_specs.md subtitles.md block_additional_
$(OUTPUT_TAGS).md: index_tags.md tagging.md matroska_tagging_registry.md tagging_end.md tags_security.md tags_iana.md tags_iana_names.md rfc_backmatter_tags.md
cat $^ | sed -e "s/@BUILD_DATE@/$(shell date +'%F')/" \
-e "s/@BUILD_VERSION@/$(OUTPUT_TAGS)/" > $@
$(OUTPUT_CHAPTER_CODECS).md: index_chapter_codecs.md chapter_codecs.md rfc_backmatter_chapter_codecs.md

$(OUTPUT_CHAPTER_CODECS).md: index_chapter_codecs.md chapter_codecs.md chapter_codecs_security.md chapter_codecs_iana.md rfc_backmatter_chapter_codecs.md
cat $^ | sed -e "s/@BUILD_DATE@/$(shell date +'%F')/" \
-e "s/@BUILD_VERSION@/$(OUTPUT_CHAPTER_CODECS)/" > $@


$(OUTPUT_CONTROL).md: index_control.md control.md control_elements4rfc.md menu.md rfc_backmatter_control.md
$(OUTPUT_CONTROL).md: index_control.md control.md control_elements4rfc.md menu.md control_security.md control_iana.md rfc_backmatter_control.md
cat $^ | sed -e "s/@BUILD_DATE@/$(shell date +'%F')/" \
-e "s/@BUILD_VERSION@/$(OUTPUT_CONTROL)/" > $@

Expand All @@ -98,11 +98,11 @@ website:
jekyll b

clean:
$(RM) -f $(OUTPUT_MATROSKA).txt $(OUTPUT_MATROSKA).html $(OUTPUT_MATROSKA).md $(OUTPUT_MATROSKA).xml ebml_matroska_elements4rfc.md matroska_tagging_registry.md
$(RM) -f $(OUTPUT_MATROSKA).txt $(OUTPUT_MATROSKA).html $(OUTPUT_MATROSKA).md $(OUTPUT_MATROSKA).xml ebml_matroska_elements4rfc.md matroska_tagging_registry.md matroska_xsd.xml
$(RM) -f $(OUTPUT_CODEC).txt $(OUTPUT_CODEC).html $(OUTPUT_CODEC).md $(OUTPUT_CODEC).xml
$(RM) -f $(OUTPUT_TAGS).txt $(OUTPUT_TAGS).html $(OUTPUT_TAGS).md $(OUTPUT_TAGS).xml
$(RM) -f $(OUTPUT_CHAPTER_CODECS).txt $(OUTPUT_CHAPTER_CODECS).html $(OUTPUT_CHAPTER_CODECS).md $(OUTPUT_CHAPTER_CODECS).xml
$(RM) -f $(OUTPUT_CONTROL).txt $(OUTPUT_CONTROL).html $(OUTPUT_CONTROL).md $(OUTPUT_CONTROL).xml
$(RM) -f $(OUTPUT_CONTROL).txt $(OUTPUT_CONTROL).html $(OUTPUT_CONTROL).md $(OUTPUT_CONTROL).xml control_xsd.xml
$(RM) -rf _site

.PHONY: clean check website matroska codecs tags all
53 changes: 33 additions & 20 deletions chapter_codecs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Some `ChapProcess` elements hold commands to execute when entering/leaving a cha

When chapter codecs are used the `EditionFlagOrdered` of the edition they belong to **MUST** be set.

Each `ChapProcessCodecID` value in an edition **SHOULD** have a single interpreter for the whole `EditionEntry`,
if that `ChapProcessCodecID` value is supported by the `Matroska Player`.
This is necessary to be able to read/write global variables that can be used between chapters.

## Segment Linking

Chapter Codecs can reference another `Segment` and jump to that `Segment`.
Expand All @@ -18,7 +22,9 @@ For example, if a chapter codec of type "1" in SegmentA needs to link to Segment
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
Expand All @@ -42,6 +48,7 @@ When switching from a chapter to another:
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.

* the enter commands (`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.
Expand All @@ -52,23 +59,23 @@ the `Matroska Player` **MUST** execute its leaved commands, then the leave comma
until the parent of the chapter is the Edition.


## Matroska Script (0)
## Matroska Script

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
This is the case when `ChapProcessCodecID` = 0. This is a script language build for
Matroska purposes. The inspiration comes from [@?ActionScript], [@?ECMAScript] 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 semicolon ";". 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.
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.
**SHOULD** jump to the `Chapter` specified by the UID and play it, as long as this `Chapter` exists.

## DVD menu (1)
## DVD Menu

This is the case when `ChapProcessCodecID` = 1\. Each level of a chapter corresponds
to a logical level in the DVD system [@?DVD-Video] that is stored in the first octet of the ChapProcessPrivate.
This is the case when `ChapProcessCodecID` = 1. Each level of a chapter corresponds
to a logical level in the DVD system [@?DVD-Video] that is stored in the first octet of the `ChapProcessPrivate`.
This DVD hierarchy is as follows:

| ChapProcessPrivate | DVD Name | Hierarchy | Commands Possible | Comment |
Expand All @@ -91,7 +98,7 @@ This field uses 2 octets as follows:
For instance, the menu part from VTS_01_0.VOB would be coded [1,0] and the content
part from VTS_02_3.VOB would be [2,1]. The VMG is always [0,0]

The following octets of ChapProcessPrivate are as follows:
The following octets of `ChapProcessPrivate` are as follows:

| Octet 1 | DVD Name | Following Octets |
|---------|----------|----------------------------------------------------------------------------------------------|
Expand All @@ -103,21 +110,27 @@ The following octets of ChapProcessPrivate are as follows:
| 0x10 | PTT | PTT-chapter number (1) |
| 0x08 | CN | Cell number [VOB ID(2)][Cell ID(1)][Angle Num(1)] |

If the level specified in ChapProcessPrivate is a PGC (0x20), there is an octet
If the level specified in `ChapProcessPrivate` is a PGC (0x20), there is an octet
called the Playback Type, specifying the kind of PGC defined:

* 0x00: entry only/basic PGC
* 0x82: Title+Entry Menu (only found in the Video Manager domain)
* 0x83: Root Menu (only found in the VTSM domain)
* 0x84: Subpicture Menu (only found in the VTSM domain)
* 0x85: Audio Menu (only found in the VTSM domain)
* 0x86: Angle Menu (only found in the VTSM domain)
* 0x87: Chapter Menu (only found in the VTSM domain)
* `0x00`: entry only/basic PGC

* `0x82`: Title+Entry Menu (only found in the Video Manager domain)

* `0x83`: Root Menu (only found in the VTSM domain)

* `0x84`: Subpicture Menu (only found in the VTSM domain)

* `0x85`: Audio Menu (only found in the VTSM domain)

* `0x86`: Angle Menu (only found in the VTSM domain)

* `0x87`: Chapter Menu (only found in the VTSM domain)

The next 4 following octets correspond to the `User Operation flags`
in the standard PGC. When a bit is set, the command **SHOULD** be disabled.

ChapProcessData contains the pre/post/cell commands in binary format as there are stored on a DVD.
`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)].

Expand Down
7 changes: 7 additions & 0 deletions chapter_codecs_iana.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# IANA Considerations

The Chapter Codec ID values set in `ChapProcessCodecID` use the Matroska Chapter Codec IDs Registry
defined in [@!Matroska].

The initial values 0 and 1 are defined in (#matroska-script) and (#dvd-menu) respectively.

5 changes: 5 additions & 0 deletions chapter_codecs_security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Security Considerations

`Tag` values can be either strings or binary blobs. This document inherits security
considerations from the EBML [@!RFC8794] and Matroska [@!Matroska] documents.

4 changes: 4 additions & 0 deletions control_iana.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# IANA Considerations

To be determined.

4 changes: 4 additions & 0 deletions control_security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Security Considerations

This document inherits security considerations from the EBML [@!RFC8794] and Matroska [@!Matroska] documents.

16 changes: 6 additions & 10 deletions index_chapter_codecs.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,19 @@ This document defines common Matroska Chapter Codecs, the basic Matroska Script

# Introduction

*TODO*
The [@!Matroska] container can be expanded with Matroska Chapter Codecs. They define a set of instructions
that the `Matroska Player` should execute when entering, leaving or during playback of a Chapter.
This allows extra features not provided by the classical linear playback of files.

The Matroska Chapter Codecs codec is extensible. So any new codec can be created
and support added in players.

# 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](https://datatracker.ietf.org/wg/cellar/charter/).
It uses basic elements and concept already defined in the Matroska specifications defined by this workgroup [@!Matroska].

# Security Considerations

`Tag` values can be either strings or binary blobs. This document inherits security
considerations from the EBML [@!RFC8794] and Matroska [@!Matroska] documents.

# IANA Considerations

To be determined.

# Notation and Conventions

The key words "**MUST**", "**MUST NOT**",
Expand Down
8 changes: 0 additions & 8 deletions index_control.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ This document is a work-in-progress specification defining the Matroska file for
of the [IETF Cellar working group](https://datatracker.ietf.org/wg/cellar/charter/).
It uses basic elements and concept already defined in the Matroska specifications defined by this workgroup [@!Matroska].

# Security Considerations

This document inherits security considerations from the EBML [@!RFC8794] and Matroska [@!Matroska] documents.

# IANA Considerations

To be determined.

# Notation and Conventions

The key words "**MUST**", "**MUST NOT**",
Expand Down
24 changes: 22 additions & 2 deletions rfc_backmatter_chapter_codecs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@

{backmatter}

<reference anchor="ActionScript" target="https://en.wikipedia.org/wiki/ActionScript">
<front>
<title>ActionScript</title>
<author>
<organization>Wikipedia</organization>
</author>
</front>
</reference>

<reference anchor="ECMAScript" target="https://262.ecma-international.org/14.0/">
<front>
<title>ECMA-262 14th Edition, June 2022. ECMAScript 2023 language specification</title>
<author>
<organization>Ecma International</organization>
</author>
<date month="June" year="2023" />
</front>
</reference>

<reference anchor="DVD-Info" target="http://dvd.sourceforge.net/dvdinfo/">
<front>
<title>DVD-Video Information</title>
Expand All @@ -26,13 +45,14 @@
<date month="November" year="1995" />
</front>
</reference>

<reference anchor="Matroska">
<front>
<title>Media Container Specifications</title>
<author initials="S." surname="Lhomme" fullname="Steve Lhomme"> </author>
<author initials="M." surname="Bunkus" fullname="Moritz Bunkus"> </author>
<author initials="D." surname="Rice" fullname="Dave Rice"> </author>
<date month="May" day="1" year="2022"/>
<date month="April" day="24" year="2024"/>
</front>
<seriesInfo name="Internet-Draft" value="draft-ietf-cellar-matroska-10"/>
<seriesInfo name="Internet-Draft" value="draft-ietf-cellar-matroska-21"/>
</reference>
4 changes: 2 additions & 2 deletions rfc_backmatter_codec.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
<author initials="S." surname="Lhomme" fullname="Steve Lhomme"> </author>
<author initials="M." surname="Bunkus" fullname="Moritz Bunkus"> </author>
<author initials="D." surname="Rice" fullname="Dave Rice"> </author>
<date month="May" day="1" year="2022"/>
<date month="April" day="24" year="2024"/>
</front>
<seriesInfo name="Internet-Draft" value="draft-ietf-cellar-matroska-10"/>
<seriesInfo name="Internet-Draft" value="draft-ietf-cellar-matroska-21"/>
</reference>

<reference anchor="ST12" target="http://ieeexplore.ieee.org/document/7291029/">
Expand Down
5 changes: 3 additions & 2 deletions rfc_backmatter_control.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
<date month="November" year="1995" />
</front>
</reference>

<reference anchor="Matroska">
<front>
<title>Media Container Specifications</title>
<author initials="S." surname="Lhomme" fullname="Steve Lhomme"> </author>
<author initials="M." surname="Bunkus" fullname="Moritz Bunkus"> </author>
<author initials="D." surname="Rice" fullname="Dave Rice"> </author>
<date month="May" day="1" year="2022"/>
<date month="April" day="24" year="2024"/>
</front>
<seriesInfo name="Internet-Draft" value="draft-ietf-cellar-matroska-10"/>
<seriesInfo name="Internet-Draft" value="draft-ietf-cellar-matroska-21"/>
</reference>
4 changes: 2 additions & 2 deletions rfc_backmatter_tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
<author initials="S." surname="Lhomme" fullname="Steve Lhomme"> </author>
<author initials="M." surname="Bunkus" fullname="Moritz Bunkus"> </author>
<author initials="D." surname="Rice" fullname="Dave Rice"> </author>
<date month="October" day="8" year="2023"/>
<date month="April" day="24" year="2024"/>
</front>
<seriesInfo name="Internet-Draft" value="draft-ietf-cellar-matroska-20"/>
<seriesInfo name="Internet-Draft" value="draft-ietf-cellar-matroska-21"/>
</reference>

<reference anchor="MovieDB" target="https://developers.themoviedb.org/3/movies/get-movie-details">
Expand Down
Loading