Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_time_code function error #6

Open
kelleymertig opened this issue Jan 8, 2020 · 0 comments
Open

get_time_code function error #6

kelleymertig opened this issue Jan 8, 2020 · 0 comments

Comments

@kelleymertig
Copy link

The get_time_code function sometimes delivers the microseconds incorrectly causing the following caption to appear before the previous caption is removed.

I corrected the issue by overriding the function with the code below:

Format and return a string that contains the converted number of seconds into WebVTT format

def get_time_code( aws_timecode ):
timedelta = datetime.timedelta(seconds=float(aws_timecode))

hours = (timedelta.seconds // 3600) % 24
minutes = (timedelta.seconds // 60) % 60
seconds = timedelta.seconds % 60
microseconds = timedelta.microseconds / 1000
return str( "%02d:%02d:%02d.%03d" % (hours, minutes, seconds, microseconds ))	   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant