ttconv
ttconv copied to clipboard
STL reader can generate 4 digits milliseconds time
STL to VTT:
396
01:31:09.631 --> 01:31:11.1000
brauchen nur
etwas länger als erwartet.
STL to TTML:
<p region="r0" begin="01:31:09.631" end="01:31:11.1000" tts:fontSize="160%" tts:lineHeight="125%" tts:textAlign="center">
<span tts:color="#ffffff">brauchen nur</span>
<br />
<span tts:color="#ffffff">etwas länger als erwartet.</span>
</p>
It actually comes from ClockTime:
>>> from ttconv.time_code import ClockTime
>>> from fractions import Fraction
>>> f = Fraction(41039999,7500)
>>> c = ClockTime.from_seconds(f)
>>> c.get_milliseconds()
1000
Ouch the issue is from: https://github.com/sandflow/ttconv/blob/c0f6929ecfaa79bd5ed1c066e8b5484720c3de12/src/main/python/ttconv/time_code.py#L104
@nywhere See https://github.com/sandflow/ttconv/pull/433
@palemieux Yes, that fixes the issue. Thanks!