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

restrict milliseconds field in VTT and SRT text caption time codes to 3 digits #1999

Open
wants to merge 2 commits into
base: release
Choose a base branch
from

Conversation

warren-bank
Copy link

@warren-bank warren-bank commented Dec 26, 2024

fix #1997

Copy link

google-cla bot commented Dec 26, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@warren-bank warren-bank changed the title [fix #1997] restrict milliseconds field in VTT and SRT text caption time codes to 3 digits restrict milliseconds field in VTT and SRT text caption time codes to 3 digits Dec 26, 2024
@warren-bank
Copy link
Author

For reference, the VTT spec says:

The timestamps can be specified in one of the following two formats:

  • mm:ss.ttt
  • hh:mm:ss.ttt

Where ttt represents milliseconds and must be between 000 and 999, inclusive.

@warren-bank
Copy link
Author

Also for reference, though there is no official "spec" for SRT, this page summarizes the common conventions:

Timecodes have the following format:

  • hours:minutes:seconds,milliseconds

Note that a comma is used instead of a period to separate the seconds and milliseconds.
This is because the SubRib format originated in France.
The first three components (hours, minutes, and seconds) each consist of two zero-padded digits,
and the last component (milliseconds) is three zero-padded digits.

(emphasis added)

@warren-bank warren-bank force-pushed the PR/text-captions/restrict-millis-to-3-digits branch from 593fdc4 to 8d2e84d Compare December 26, 2024 21:01
@warren-bank warren-bank force-pushed the PR/text-captions/restrict-millis-to-3-digits branch from 8d2e84d to 57ebbcd Compare December 26, 2024 21:20
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

Successfully merging this pull request may close these issues.

subtitles parser doesn't handle time codes that include more than 3 digits in the milliseconds field
2 participants