Hi, I found an EBU-TT-D file where some timestamps are without milliseconds. I made this small change to accommodate this:
def fraction_timestamp_to_ms(self, timestamp):
"""Convert hh:mm:ss.fraction to milliseconds
"""
if '.' in timestamp:
hh, mm, ss, fraction = re.split(r'[:.]', timestamp)
else:
hh, mm, ss = re.split(r'[:]', timestamp)
fraction = '0'
hh, mm, ss = [int(i) for i in (hh, mm, ss)]
# Resolution beyond ms is useless for our purposes
ms = int(fraction[:3])
return self._scaler(self._hhmmss_to_ms(hh, mm, ss) + ms)
Hi, I found an EBU-TT-D file where some timestamps are without milliseconds. I made this small change to accommodate this: