-
Notifications
You must be signed in to change notification settings - Fork 45
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
add T_QUICKTIME codec mapping #112
base: master
Are you sure you want to change the base?
Conversation
Related message at https://mailarchive.ietf.org/arch/msg/cellar/flGPjiu-YBdpAgDQ-IUZNBY1wfk |
f3e95cc
to
951a5e2
Compare
This PR was rewritten to split T_QUICKTIME into T_QUICKTIME/SINGLE and T_QUICKTIME/MULTIPLE. The SINGLE version only uses a single Cluster and timecode value to associate a virtual continuous QuickTime timecode with the Matroska timecode. This is the way most QuickTime timecode tracks work, a single value stored, and every other value calculated based off private data. The MULTIPLE version infers that more than one value may be stored. I may add some example math here but wanted some review of the concepts here. Ping to @JeromeMartinez. |
|
||
Codec Name: QuickTime timecode track (continuous) | ||
|
||
Description: `T_QUICKTIME/SINGLE` is used to identify Timecode tracks as stored in QuickTime. The `QuickTime Timecode Sample Data` is stored within the Block's data section. For an explanation of `QuickTime Timecode Sample Data` read [QuickTime File Format Specification](https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-57421). In the context of Matroska, `T_QUICKTIME/SINGLE` tracks MUST only relate to exactly one `Cluster` which MUST have a `Cluster Timecode` of zero and exactly one `SimpleBlock` or `BlockGroup Element`. The storage of the `QuickTime Timecode Sample Data` with the `SimpleBlock` or `BlockGroup Element` allows the `QuickTime Timecode` to be mapped to the `Matroska Timecode` at a single point. The `QuickTime Timecode` value MAY then be evaluated at any point in the `Matroska Timecode` by using the initialised `Timecode Sample Description`, the single `QuickTime Timecode Sample Data` value, and the `Matroska Timecode`. |
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.
British initialised
or American initialized
? The rest seems to me American.
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.
Two things I'd like to discuss:
In the context of Matroska,
T_QUICKTIME/SINGLE
tracks MUST only relate to exactly oneCluster
which MUST have aCluster Timecode
of zero and exactly oneSimpleBlock
orBlockGroup Element
.
I honestly don't understand what this is supposed to mean, especially the verb "relate". Do you mean to say that for a track with the CodecID T_QUICKTIME/SINGLE
there MUST be exactly one BlockGroup
or SimpleBlock
, that this singular block is stored in a cluster with ClusterTimecode
set to 0, and that there MUST NOT be any other cluster in the file with ClusterTimecode
set to 0?
If yes, why such severe restrictions? Why not allow multiple Clusters
that start at 0 (by simply omitting the restriction)? What about files whose first cluster doesn't start at 0 — how would that be interpreted? And why are you saying something about the Cluster Timecode
but not about the timecode parts of the blocks?
In other words: can you please describe all of your thoughts in much more detail? We can then see how to turn that into unambiguous verbiage.
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.
The second issue I have is with linking to other web pages as part of the format specification. I'd rather we refer to existing PDF documentation or publications. In the case of linking to the QuickTime specification this is both possible and a bit difficult: possible because there is a PDF version of the QuickTime specs, and harder because it doesn't contain numbered chapters and sections. I still prefer to say something like this:
For an explanation of the format read the section "Timecode Media", sub-section "Timecode Sample Description", of Apple's QuickTime File Format Specification (2001).
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.
In this case, I suggest that T_QUICKTIME/SINGLE
implies that only a single Cluster is associated with that track. I didn't mean that imply that other tracks could not share the same timecode value. Upon reflection I think the requirement to use a Cluster Timecode is unnecessary. What is needed in T_QUICKTIME/SINGLE is for a single QuickTime Timecode Sample Data
value to be stored in a single BlockGroup
or SimpleBlock
of a single Cluster
, then the QuickTime Timecode Sample Data
(within the Block) and the Timecode Sample Description
(in Private Data) and the Cluster Timecode
and the Block Timecode
can be used to calculate what the QuickTime Timecode value should be relative to any Matroska Timecode value. Still for a Matroska Reader that needs to quickly associate any Matroska Timecode value with a QuickTime Timecode value it would be good to know where that Cluster is quickly. I had intended to have Cluster as 0 timecode to mean that it should be one of the first Clusters, but of course that is not a good expectation.
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.
If finding the (single) BlockGroup
/SimpleBlock
is the goal, then just say that the BlockGroup
/SimpleBlock
SHOULD be referenced via Cues
.
I don't like requiring that the first or one of the first cluster contains that data as that seems problematic wrt streaming Matroska files.
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.
Are there any other Codec Mappings that require Cues?
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.
None that I know of.
|
||
Description: `T_QUICKTIME/SINGLE` is used to identify Timecode tracks as stored in QuickTime. The `QuickTime Timecode Sample Data` is stored within the Block's data section. For an explanation of `QuickTime Timecode Sample Data` read [QuickTime File Format Specification](https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-57421). In the context of Matroska, `T_QUICKTIME/SINGLE` tracks MUST only relate to exactly one `Cluster` which MUST have a `Cluster Timecode` of zero and exactly one `SimpleBlock` or `BlockGroup Element`. The storage of the `QuickTime Timecode Sample Data` with the `SimpleBlock` or `BlockGroup Element` allows the `QuickTime Timecode` to be mapped to the `Matroska Timecode` at a single point. The `QuickTime Timecode` value MAY then be evaluated at any point in the `Matroska Timecode` by using the initialised `Timecode Sample Description`, the single `QuickTime Timecode Sample Data` value, and the `Matroska Timecode`. | ||
|
||
Initialisation: The `Private Data` contains the `Timecode Sample Description` which in QuickTime is stored within the 'tmcd' atom after the mandatory `data reference index` value. For an explanation of the `Timecode Sample Description` read [QuickTime File Format Specification](https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-69831). |
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.
same here (and below)
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.
Same issue with referencing web pages vs. a published standard (as a PDF).
|
||
Codec Name: QuickTime timecode track (continuous) | ||
|
||
Description: `T_QUICKTIME/SINGLE` is used to identify Timecode tracks as stored in QuickTime. The `QuickTime Timecode Sample Data` is stored within the Block's data section. For an explanation of `QuickTime Timecode Sample Data` read [QuickTime File Format Specification](https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-57421). In the context of Matroska, `T_QUICKTIME/SINGLE` tracks MUST only relate to exactly one `Cluster` which MUST have a `Cluster Timecode` of zero and exactly one `SimpleBlock` or `BlockGroup Element`. The storage of the `QuickTime Timecode Sample Data` with the `SimpleBlock` or `BlockGroup Element` allows the `QuickTime Timecode` to be mapped to the `Matroska Timecode` at a single point. The `QuickTime Timecode` value MAY then be evaluated at any point in the `Matroska Timecode` by using the initialised `Timecode Sample Description`, the single `QuickTime Timecode Sample Data` value, and the `Matroska Timecode`. |
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.
Two things I'd like to discuss:
In the context of Matroska,
T_QUICKTIME/SINGLE
tracks MUST only relate to exactly oneCluster
which MUST have aCluster Timecode
of zero and exactly oneSimpleBlock
orBlockGroup Element
.
I honestly don't understand what this is supposed to mean, especially the verb "relate". Do you mean to say that for a track with the CodecID T_QUICKTIME/SINGLE
there MUST be exactly one BlockGroup
or SimpleBlock
, that this singular block is stored in a cluster with ClusterTimecode
set to 0, and that there MUST NOT be any other cluster in the file with ClusterTimecode
set to 0?
If yes, why such severe restrictions? Why not allow multiple Clusters
that start at 0 (by simply omitting the restriction)? What about files whose first cluster doesn't start at 0 — how would that be interpreted? And why are you saying something about the Cluster Timecode
but not about the timecode parts of the blocks?
In other words: can you please describe all of your thoughts in much more detail? We can then see how to turn that into unambiguous verbiage.
|
||
Codec Name: QuickTime timecode track (continuous) | ||
|
||
Description: `T_QUICKTIME/SINGLE` is used to identify Timecode tracks as stored in QuickTime. The `QuickTime Timecode Sample Data` is stored within the Block's data section. For an explanation of `QuickTime Timecode Sample Data` read [QuickTime File Format Specification](https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-57421). In the context of Matroska, `T_QUICKTIME/SINGLE` tracks MUST only relate to exactly one `Cluster` which MUST have a `Cluster Timecode` of zero and exactly one `SimpleBlock` or `BlockGroup Element`. The storage of the `QuickTime Timecode Sample Data` with the `SimpleBlock` or `BlockGroup Element` allows the `QuickTime Timecode` to be mapped to the `Matroska Timecode` at a single point. The `QuickTime Timecode` value MAY then be evaluated at any point in the `Matroska Timecode` by using the initialised `Timecode Sample Description`, the single `QuickTime Timecode Sample Data` value, and the `Matroska Timecode`. |
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.
The second issue I have is with linking to other web pages as part of the format specification. I'd rather we refer to existing PDF documentation or publications. In the case of linking to the QuickTime specification this is both possible and a bit difficult: possible because there is a PDF version of the QuickTime specs, and harder because it doesn't contain numbered chapters and sections. I still prefer to say something like this:
For an explanation of the format read the section "Timecode Media", sub-section "Timecode Sample Description", of Apple's QuickTime File Format Specification (2001).
|
||
Description: `T_QUICKTIME/SINGLE` is used to identify Timecode tracks as stored in QuickTime. The `QuickTime Timecode Sample Data` is stored within the Block's data section. For an explanation of `QuickTime Timecode Sample Data` read [QuickTime File Format Specification](https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-57421). In the context of Matroska, `T_QUICKTIME/SINGLE` tracks MUST only relate to exactly one `Cluster` which MUST have a `Cluster Timecode` of zero and exactly one `SimpleBlock` or `BlockGroup Element`. The storage of the `QuickTime Timecode Sample Data` with the `SimpleBlock` or `BlockGroup Element` allows the `QuickTime Timecode` to be mapped to the `Matroska Timecode` at a single point. The `QuickTime Timecode` value MAY then be evaluated at any point in the `Matroska Timecode` by using the initialised `Timecode Sample Description`, the single `QuickTime Timecode Sample Data` value, and the `Matroska Timecode`. | ||
|
||
Initialisation: The `Private Data` contains the `Timecode Sample Description` which in QuickTime is stored within the 'tmcd' atom after the mandatory `data reference index` value. For an explanation of the `Timecode Sample Description` read [QuickTime File Format Specification](https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-69831). |
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.
Same issue with referencing web pages vs. a published standard (as a PDF).
This may require changes in Matroksa, and it may not be possible to do this in the same document. |
I think this idea is much lower priority (and perhaps unneeded) since there #348. Close? |
The "format" is different between QuickTime time code (there is a CodecPrivate part with "24Hours" etc flags, then an offset from 00:00:00) and SMPTE ST 12 (hours, minutes, seconds, frames), and conversion can be lossy e.g. if hours count is 30 (possible in QuickTime, not possible in SMPTE ST 12). Low priority: right. They are just 2 different formats with no bijection between them. |
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.
we need to tell the track type to use
@@ -23,6 +23,7 @@ Video | "V_" | |||
Audio | "A_" | |||
Subtitle | "S_" | |||
Button | "B_" | |||
Timecode | "T_" |
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.
There is currently no "timecode" track type. There is a "metadata" track type which seems to be fitting. So maybe the prefix should be "M_"
and the type called Metadata
?
We can also add a "timecode" track type. In the end it's more informational for the player what this is about, although it should be able to tell what kind of metadata we're talking about just by looking at the codec. But at the container level (don't know what's in codecs) it might be usefull to tell if we have timecodes or not.
|
||
### T_QUICKTIME/SINGLE | ||
|
||
Codec ID: T_QUICKTIME/SINGLE |
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.
We need to tell what track type to use "metadata", "subtitle", "timecode" ? Maybe this should be explained in the chapter above.
Moving this to Matroska v5 because:
|
intended as alternative to #102