Re: Time expression Semantics question on Media Time Base

Hi,

You have it mostly right.

Comments in-line below.

>On 03/08/2024, 17:51, "Alexander Cerutti" <cerutti.alexander@gmail.com <mailto:cerutti.alexander@gmail.com>> wrote:
>
>
>External: Think before clicking
>
>
>Hello all,
>
>
>Appendix I Time Expression Semantics (https://w3c.github.io/ttml2/#time-expression-semantics <https://w3c.github.io/ttml2/#time-expression-semantics>) describes how time expressions should be evalutated and converted according to the selected Time Base.
>I was studying how a Media Time Base relates to the the offset-time expression, so I'm looking at the whole I.2 section and in particular to the I.2.2 section.
>
>
>By remembering that the offset-time expression is composed in the following format:
>
>
>> time-count fraction? metric
>
>
>and clock-time is composed as follows:
>
>
>> hours ":" minutes ":" seconds ( fraction | ":" frames ( "." sub-frames )? )?
>
>
>
>
>That section states what follows:
>
>
>
>
>"If a time expression uses a clock-time form or an offset-time form that doesn't use the ticks (t) metric, then:
>
>
>M = referenceBegin + 3600 * hours + 60 * minutes + seconds + ((frames + (subFrames / subFrameRate)) / effectiveFrameRate)
>
>
>where referenceBegin [...] corresponds to the active end of the immediately prior sibling timed element;
>
>
>the hours, minutes, seconds, frames, subFrames components are extracted from time expression if present, or zero if not present; furthermore, if the time expression takes the form of a clock-time expression, then the fraction component, if present, is added to the seconds component to form a real-valued seconds component, or, if the time expression takes the form of an offset-time expression, then the fraction component, if present, is added to the time-count component to form a real-valued time count component according to the specified offset metric;"
>
>
>
>
>So, as reported, when using a clock-time with a Media Time Base, we can use the formula above, by zeroing missing values and adding fraction component to the seconds component.
>However, it is also says that the same formula is valid for offset-time, which however doesn't have the same fields.
>
>
>Is it correct to assume that all the fields in the same formula should be zeroed according to the metric field?

Yes

>
>
>For example, if we have an offset-time of "10m", the formula would be:
>
>
>M = referenceBegin + (3600 * 0) + (60 * 10) + (0) + ((0 + (0 / subFrameRate)) / effectiveFrameRate)
>
>
>If so, other offset-time examples could be:
>
>
>- 2h => (3600 * 2) + (60 * 0) + 0...
>- 24f => (3600 * 0) + (60 * 0) + 0 + (24 + (0 / subFrameRate)) / effectiveFrameRate)
>
>
>
>
>
>
>Furthermore, about the fraction component of an offset-time, the section states that "is added to the time-count [...] component according to the specified offset metric".
>As I found no specification about how each offset metric (which are "h" | "m" | "s" | "ms" | "f", excluding "t" as it uses a different formula) should use the fraction component, I'd like to understand if it is correct to assume the following statements for each metric; some could contrast with others:
>
>
>- "2.5h" => means (3600 * 2) + (60 * 30) + (0)...
>
>
>- "2.5m" => means (3600 * 0) + (60 * 2) + 30...

This is right, though I would expect to write and compute it as:

- "2.5m" => means (3600 * 0) + (60 * 2.5) + 0...

since the fractional component applies directly to the metric unit specified. Obviously they are equivalent since a minute contains 60s etc.


>- "2.5m" => means (3600 * 0) + (60 * 2) + 5...

This is wrong. The fraction is a fraction of the specified unit metric, in this case "m" meaning "minutes".


>- "2.5s" => means (3600 * 0) + (60 * 0) + 2.5
>
>
>- "250.5ms" => means (3600 * 0) + (60 * 0) + 0.2505...

This is right.


>- "250.5ms" => means (3600 * 0) + (60 * 0) + 0.250 + (( 5 + (0 / subFrameRate)) / effectiveFrameRate)

This is wrong. There's only one metric, and it is "ms" not frames, so no part of this goes into the frames component.


>- "24.5f" => means (3600 * 0) + (60 * 0) + 0 + ((24 + (0.5 / subFrameRate)) / effectiveFrameRate)

Whatever a fraction of a frame means, it is not "subframe". I read this as being wrong, rather it should be:

- "24.5f" => means (3600 * 0) + (60 * 0) + 0 + ((24.5 + (0 / subFrameRate)) / effectiveFrameRate)



>
>
>My biggest doubts are on the milliseconds and frame metrics, but also others.
>
>
>Thank you,
>Alexander

Hope that helps,

kind regards,

Nigel

Received on Tuesday, 13 August 2024 10:25:26 UTC