IanRawz
IanRawz

Reputation: 19

How to convert TTML (Timed Text Markup Language) tick to seconds

Does anyone know how I can convert a TTML-tick to a second? For example, how do I convert "1281697500" to ~2min7sec?

Upvotes: 0

Views: 353

Answers (1)

Nigel Megitt
Nigel Megitt

Reputation: 158

There should be a ttp:tickRate parameter on the root tt element, which defines the number of ticks per second. It's 1 if not specified. So if you have a TTML time expression with a tick metric like "1281697500t" then remove the t from the end and divide the number by the value of ttp:tickRate to get the value in seconds.

Note that use of ticks is only intended when working in a media timebase.

Link to ttp:tickRate: https://www.w3.org/TR/ttml1/#parameter-attribute-tickRate

Link to TTML Time Expression syntax: https://www.w3.org/TR/ttml1/#timing-value-timeExpression

Upvotes: 2

Related Questions