ttconv icon indicating copy to clipboard operation
ttconv copied to clipboard

STL reader can generate 4 digits milliseconds time

Open nywhere opened this issue 1 year ago • 1 comments

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>

issue.stl.zip

nywhere avatar Oct 18 '24 13:10 nywhere

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

nywhere avatar Oct 18 '24 14:10 nywhere

Ouch the issue is from: https://github.com/sandflow/ttconv/blob/c0f6929ecfaa79bd5ed1c066e8b5484720c3de12/src/main/python/ttconv/time_code.py#L104

palemieux avatar Oct 30 '24 16:10 palemieux

@nywhere See https://github.com/sandflow/ttconv/pull/433

palemieux avatar Oct 30 '24 17:10 palemieux

@palemieux Yes, that fixes the issue. Thanks!

nywhere avatar Oct 31 '24 08:10 nywhere