Your product demo captions look fine as plain text, yet two lines appear at once when you play the video. Another caption vanishes entirely. Before uploading the SRT, you can run a local structural check to find numbering and timing problems, then review the flagged moments against the actual footage. This is especially useful when captions come from several editors or an automated export.
The Library of Congress description of SubRip sets out the common pattern: a sequential number, start and end time joined by -->, caption text and a blank line. Timestamps use hours:minutes:seconds,milliseconds. YouTube supports basic SRT files as plain UTF-8 text and does not recognize SRT styling. A structural check is useful, but it cannot tell whether the words match the recording or fit well on a phone screen.
Run a local preflight check
This Python script checks for consecutive numbers starting at 1, complete blocks, valid timestamp syntax, an end after each start, and overlaps between adjacent captions. It reports overlaps for review. Some productions deliberately show two captions at once, so an overlap is a signal to inspect, not permission to rewrite the timing automatically.

Save the following as validate_srt.py and run python3 validate_srt.py captions.srt. It uses only Python's standard library, so your caption file stays on your machine.
import re
import sys
from pathlib import Path
STAMP = re.compile(r"^(\d{2}):(\d{2}):(\d{2}),(\d{3})$")
ARROW = re.compile(r"^(.+?)\s+-->\s+(.+?)$")
def ms(value):
match = STAMP.fullmatch(value)
if not match:
raise ValueError(f"invalid timestamp: {value}")
h, m, s, milli = map(int, match.groups())
if m > 59 or s > 59:
raise ValueError(f"invalid minutes/seconds: {value}")
return ((h * 60 + m) * 60 + s) * 1000 + milli
def check(path):
blocks = re.split(r"\n\s*\n", path.read_text(encoding="utf-8-sig").strip())
issues = []
previous_end = None
for expected, block in enumerate(blocks, 1):
lines = block.splitlines()
if len(lines) < 3 or not lines[0].isdigit():
issues.append(f"block {expected}: missing number, time or text")
continue
if int(lines[0]) != expected:
issues.append(f"block {expected}: number {lines[0]} is out of sequence")
match = ARROW.fullmatch(lines[1].strip())
if not match:
issues.append(f"block {expected}: invalid time line")
continue
try:
start, end = map(ms, match.groups())
except ValueError as exc:
issues.append(f"block {expected}: {exc}")
continue
if end <= start:
issues.append(f"block {expected}: end must follow start")
if previous_end is not None and start < previous_end:
issues.append(f"block {expected}: overlaps previous block")
if not "".join(lines[2:]).strip():
issues.append(f"block {expected}: empty caption")
previous_end = end
return issues
if __name__ == "__main__":
if len(sys.argv) != 2:
sys.exit("Usage: python3 validate_srt.py captions.srt")
issues = check(Path(sys.argv[1]))
print("\n".join(issues) if issues else "Basic structure and timing: OK")
sys.exit(bool(issues))
A clean file prints Basic structure and timing: OK and exits with status 0. A flagged file prints block-level findings and exits with status 1. That exit status also makes the script usable as a small check in a local build process. For example, an SRT that jumps from cue 1 to cue 3, then starts the second cue at 00:00:01,000 and ends it at 00:00:00,900, triggers three findings: numbering, reversed timing and overlap.
What to do after it reports a problem
- Fix numbering and malformed timecodes first. Run the check again after every timing edit; a correction can affect the next cue.
- Watch the footage at each reported overlap. Decide whether the simultaneous display is intentional, or which start or end time actually matches the spoken line.
- Spot-check the opening, middle and ending on a phone. Verify names, amounts and quotations by listening. A technically valid SRT can still be hard to read or wrong.
- Check the destination's upload requirements. For YouTube, the supported basic SRT format is plain UTF-8. If you need caption position or styling, choose a format and platform that explicitly support it.
What we tested: a two-cue valid SRT returned no findings. A deliberately broken two-cue fixture with a numbering jump and reversed time returned the three findings above. We did not test every historical SubRip variant, non-UTF-8 file or real video project. This script is a local preflight check, not a universal conformance certificate.
If captions are part of your weekly publishing workflow, place this check immediately after export. It narrows the moments you need to inspect by hand while preserving the editor's judgement about speech, readability and intent.
Sources: Library of Congress SubRip format description; YouTube supported subtitle files.
