-
Notifications
You must be signed in to change notification settings - Fork 44
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
BlockAddIDValue 4 is not recommended #745
base: master
Are you sure you want to change the base?
Conversation
67f150a
to
0fd2483
Compare
Any value of 2 or higher just means that Looking at the WebM spec, they don't support the element either. It might be better to have a generic rule that says the |
But that's already the case. |
You're right, that's written in a different section:
Technically in modern Matroska the most important field is So you're (both) right about not using the value 4 for anything else than ITU-T T.35 payload. However I see 2 caveats
So I would prefer to mention that WebM does things differently, especially the missing elements, as the date of writing. But not block the value 4 in Matroska. |
BTW, it would be interresting (actually important) to know whether mkvmerge ever wrote Matroska files with ITU T.35 data without the corresponding cc @mbunkus |
In that case, why do we mandate "BlockAddIDValue MUST be 4." for ITU T T.35? I think that this PR is for making explicit that
True, we could add later other unrecommended values if WebM future extension does not use |
If there's a reason it should be in #390 |
My understanding is that
with current version it is something in the middle, like if we don't want to really decide :-p. |
No. MKVToolNix only received support for those elements in August 2020 while adding support for Dolby Vision. |
IMO the BlockAddIDValue MUST be 4 (and BlockAddIDValue MUST be 1) text should mention it's because of WebM compatibility. Then repeating both constraints in the section you're modifying would be useful too. BTW the value 1 mentions it's for opaque data (whatever that means) and the WebM spec says it's reserved (mysterious). But in fact that value is for the alpha layer for VP8 and VP9. It's even a VP8/VP9 bitstream (that libavcodec can't handle, only libvpx can). We should probably clarify that as well. When combined with these codecs (and possibly AV1) the |
Please don't do that. It will make writing demuxing implementations that only care about HDR10+ much harder (Actually having to create a mapping array to know what |
I didn't check your FFmpeg patch about that, but if you don't handle a mapping array, you need at least to flag if BlockAddID 4 is ITU T T.35 or not, as currently BlockAddID 4 does not necessary mean that it is ITU T T.35, so at least you need to have a flag, so not a big difference between a flag and a mapping array. a demuxer SHOULD NOT consider BlockAddID 4 as ITU T T.35, only if BlockAddIDType is 4. |
(and at long term FFmpeg will need this mapping array, for e.g. timecodes) |
I'm doing as much, yes. A simple flag that ensures any
Yes, when the time comes, an array will have to be implemented. |
0fd2483
to
d9bb4ee
Compare
I added a mention in
It seems clear enough to me, so not sure about what to add there. |
In one part of the text the requirement is a SHOULD and the other it's a MUST (we already established |
It is not incompatible as a format X could use But it shows that we are a bit in the middle, we want to keep some compatibility with WebM and at the same time we don't really care, and we don't choose between SHOULD and MUST. For coherency, I would put SHOULD everywhere, but @jamrial has another opinion. in my opinion we should not have reserved value without Matroska related meaning, and the mapping array would have to be done for any other format, in practice if on T.35 is handled it is mostly replacing a bool ("is BlockAddIDValue of 4 is for T.35") by a int ("BlockAddIDValue for T.35 is Y") so we should change that now, before an implementation is wide spread. |
A remuxer is in fact encouraged to pretty much always change the
We are already constraining So in short, the combination of |
@@ -88,6 +88,10 @@ The values of `BlockAddID` that are 2 of greater have no semantic meaning, but s | |||
associate the `BlockMore Element` with a `BlockAdditionMapping` of the associated Track. | |||
See (#block-additional-mapping) on Block Additional Mappings for more information. | |||
|
|||
The value of 4 for `BlockAddID` (so also `BlockAddIDValue`) **SHOULD NOT** be used when `BlockAddIDType` is not 4, |
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.
Maybe instead of
The value of 4 for
BlockAddID
(so alsoBlockAddIDValue
) SHOULD NOT be used whenBlockAddIDType
is not 4
you could simply say
It is recommended to not use the value of 4 for
BlockAddID
(and by extensionBlockAddIDValue
) whenBlockAddIDType
is not 4
To avoid using the SHOULD NOT keyword.
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.
OK with that, although it should be **RECOMMENDED**
as it's a normative term in the case.
@@ -977,7 +981,8 @@ Block type identifier: 4 | |||
Block type name: ITU T.35 metadata | |||
|
|||
Description: the `BlockAdditional` data is interpreted as ITU T.35 metadata, as defined by ITU-T T.35 | |||
terminal codes. `BlockAddIDValue` **MUST** be 4. | |||
terminal codes. `BlockAddIDValue` **MUST** be 4 as some WebM-oriented demuxers may ignore `BlockAddIDType` |
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.
I don't know if this addition is a good idea. BlockAddIDValue
MUST be 4, period. The reason why does not need to be included. It wasn't for BlockAddIDType
1.
This is even more to when remuxing from Matroska to WebM (the other way around can be totally transparent). WebM has a lot of missing elements, only supports a few codec, also has constraints on the interleaving (it is recommended that an audio block starts each Cluster). Such a muxer needs to make sure all the WebM constraints. What we're defining here is an easier way to make that translation. But in the end, since this is just a recommendation on the Matroska side, the not recommended case needs to be handled. So whether it's a SHOULD or RECOMMENDED doesn't make much difference. If it becomes a MUST then it can be assumed the source Matroska file would be bogus/invalid. This would become retroactive on all Matroska files having T.35 content. It's probably OK as mkvmerge was already doing it properly. But as said before, I'm not very keen on imposing WebM rules (at least bogus ones) in Matroska. |
Ok, thinking a bit more about this, i realize now that forcing BlockAddIDType 4 to always have BlockAddIDValue 4 means we're forcing a given Track to only have a single kind of ITU-T T.35 BlockAdditions, more likely than not HDR10+ payloads since that's currently what seems to have real world use (Does it, though? Does Google serve this on Youtube? Or just the one sample as a PoC?), but not necessarily. |
I don't follow:
In other words, maybe the type description for type 4 is too broad; maybe it should be much more narrow & concrete. |
Yeah, you're right. I can add two BlockMore just fine to a Block both using the enforced id 4 and with different kind of payloads. Nevermind then. |
It should be broad, because it could be considered as opaque data by a remuxer. All a remuxer needs to know is that it is ITU-T T35. My understanding is that in that case it is a generic method for all block types, we add more BTW, HDR10+ metadata parsing has been added in MediaInfo, and it is ready to support more ITU-T T35 content (what we found there up to now, in e.g. HEVC, is not only captions, but also other HDR formats like SL-HDR and HDR Vivid, and active format description). |
As
BlockAddIDValue
of 4 may be interpreted as ITU T.35 without checkingBlockAddIDType
(reason we mandateBlockAddIDValue
whenBlockAddIDType
is 4, right?), I suggest to recommend to avoidBlockAddIDValue
of 4 when it is not ITU T.35.Idea is from a comment at https://ffmpeg.org/pipermail/ffmpeg-devel/2023-March/307718.html