-
Notifications
You must be signed in to change notification settings - Fork 51
Chapter timestamp clarifications #1015
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -108,48 +108,37 @@ The `ChapterAtom` is also called a `Chapter`. | |
| `ChapterTimeStart` is the timestamp of the start of `Chapter` with nanosecond accuracy and is not scaled by `TimestampScale`. | ||
| For `Simple Chapters`, this is the position of the chapter markers in the timeline. | ||
|
|
||
| For `Simple Chapters`, the start timestamp **MUST** be greater than or equal to the start timestamp of the preceding `ChapterAtom`. Otherwise the Chapter **SHOULD** be ignored. | ||
|
|
||
| ### ChapterTimeEnd | ||
| `ChapterTimeEnd` is the timestamp of the end of `Chapter` | ||
| with nanosecond accuracy and is not scaled by `TimestampScale`. The | ||
| timestamp defined by the `ChapterTimeEnd` is not part of the | ||
| `Chapter`. A `Matroska Player` calculates the duration of this | ||
| `Chapter` using the difference between the `ChapterTimeEnd` and | ||
| `ChapterTimeStart`. The end timestamp **MUST** be greater | ||
| than or equal to the start timestamp. | ||
|
|
||
| When the `ChapterTimeEnd` timestamp is equal to the `ChapterTimeStart` timestamp, | ||
| the timestamp is included in the `Chapter`. It can be useful to put markers in | ||
| a file or add chapter commands with ordered chapter commands without having to play anything; | ||
| see (#chapprocess-element). | ||
|
|
||
| Chapter | Start timestamp | End timestamp | Duration | ||
| :---------|:----------------|:--------------|:----- | ||
| Chapter 1 | 0 | 1000000000 | 1000000000 | ||
| Chapter 2 | 1000000000 | 5000000000 | 4000000000 | ||
| Chapter 3 | 6000000000 | 6000000000 | 0 | ||
| Chapter 4 | 9000000000 | 8000000000 | Invalid (-1000000000) | ||
| Table: ChapterTimeEnd Usage Possibilities{#ChapterTimeEndUsage} | ||
| `Chapter`. | ||
|
|
||
| The end timestamp **MUST** be greater than or equal to the start timestamp. | ||
| Otherwise the end timestamp **SHOULD** be ignored. | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the spec say what to do if the MUST is not met?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It already says so in the element:
|
||
|
|
||
| For `Simple Chapters`, the end timestamp **MUST** be equal to or smaller than the start timestamp of the next ChapterAtom. | ||
| Otherwise the start timestamp of the next Chapter **SHOULD** be used as the end timestamp of this Chapter. | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Having overlapping timestamps on Simple Chapters that are on the same level (i.e. not nested) seems like something to avoid.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
| Chapters with a duration of 0 are allowed, and might for example be used as markers such as bookmarks. | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The definition of a chapter as a half-open range seems quite natural. But I'm not sure what this was supposed to mean.
Chapters already act as markers, but I can see how zero-length chapters could work as a different kind of marker. They would work more like points instead of segments. To "add chapter commands with ordered chapter commands without having to play anything" is again not really an understandable sentence.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Chapter commands are only supported in Ordered Chapters. The 0 duration feature is supported there. |
||
|
|
||
| ### Nested Chapters | ||
|
|
||
| A `ChapterAtom` element can contain other `ChapterAtom` elements. | ||
| That element is a `Parent Chapter`, and the `ChapterAtom` elements it contains are `Nested Chapters`. | ||
|
|
||
| `Nested Chapters` can be useful to tag small parts of a `Segment` that already have tags or | ||
| add Chapter Codec commands on smaller parts of a `Segment` that already have Chapter Codec commands. | ||
|
|
||
| The `ChapterTimeStart` of a `Nested Chapter` **MUST** be greater than or equal to the `ChapterTimeStart` of its `Parent Chapter`. | ||
|
|
||
| If the `Parent Chapter` of a `Nested Chapter` has a `ChapterTimeEnd`, the `ChapterTimeStart` of that `Nested Chapter` | ||
| **MUST** be smaller than or equal to the `ChapterTimeEnd` of the `Parent Chapter`. | ||
| For `Simple Chapters`, the `ChapterTimeStart` of a `Nested Chapter` **MUST** be greater than or equal to the `ChapterTimeStart` of its `Parent Chapter`, and it **MUST** be smaller than the end timestamp of the `Parent Chapter`. | ||
| Otherwise the Nested Chapter **SHOULD** be ignored. | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Also I don't think the start timestamp of the Nested Chapter should be allowed to be equal to the end timestamp of the parent chapter, because the definition of the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For Simple Chapters there is no mandatory duration for a Chapter. So there can't be a rule around that. |
||
|
|
||
| ### Nested Chapters in Ordered Chapters | ||
|
|
||
| The `ChapterTimeEnd` of the lowest level of `Nested Chapters` **MUST** be set for `Ordered Chapters`. | ||
|
|
||
| When used with `Ordered Chapters`, the `ChapterTimeEnd` value of a `Parent Chapter` is useless for playback, | ||
| When used with `Ordered Chapters`, the `ChapterTimeStart` and `ChapterTimeEnd` values of a `Parent Chapter` **MUST** be ignored for playback, | ||
| as the proper playback sections are described in its `Nested Chapters`. | ||
| The `ChapterTimeEnd` **SHOULD NOT** be set in `Parent Chapters` and **MUST** be ignored for playback. | ||
| The `ChapterTimeStart` of the `Parent Chapter` **SHOULD** be equal to that of its first `Nested Chapter`, and the `ChapterTimeEnd` of the `Parent Chapter` **SHOULD NOT** be set. | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to me with Ordered Chapters not only the
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can have multiple chapters inside a parent chapter. In Ordered Chapters they just cannot start at the same time (as the parent). |
||
|
|
||
| ### ChapterFlagHidden | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ordered Chapters are sorted by definition. I think the spec should note whether Simple Chapters should be sorted by the player, or are required to be sorted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simple Chapters are not sorted. It's up to the player to reorder them if needed. And they should not be ignored if they are not ordered. This would break backward compatibility.