Does anyone know how I can convert a TTML-tick to a second? For example, how do I convert "1281697500" to ~2min7sec?
Asked
Active
Viewed 289 times
0
-
2min7sec are 127 seconds. Seems the value represents 128.1697500 seconds – Sir Rufo Jun 08 '17 at 22:26
-
It looks like it might be arbitrary based on the parameters defined in the TTML. Have a look at https://www.w3.org/TR/ttaf1-dfxp/#parameter-attribute-tickRate – Blorgbeard Jun 08 '17 at 22:29
-
TimeSpan.FromTicks( int64.Parse( ttmlValue ) ); – Sir Rufo Jun 08 '17 at 22:30
1 Answers
2
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

Nigel Megitt
- 158
- 5