You shorten a shot and pull the next line of dialogue forward. The new subtitle starts before the old one clears. On a phone, the two cues can compete for the same space. This check tells you where to look before you watch the entire episode again.
It reads a conventional UTF-8 SRT file and reports overlaps. If your edit intentionally displays two speakers at once, use the output as a review list and keep the overlaps that match your delivery requirements.
Make a three-cue example
Save this as episode.srt. Cue 1 overlaps both later cues. A checker that compares each cue only with the immediately preceding cue would miss the overlap between cues 1 and 3.
1
00:00:01,000 --> 00:00:05,000
I thought the ferry left at noon.
2
00:00:02,000 --> 00:00:03,000
It did.
3
00:00:04,000 --> 00:00:06,000
That was yesterday's schedule.
Each cue has a number, an interval and its text. The blank lines separate cues. The example uses the comma before milliseconds shown in the Library of Congress format description. SubRip format reference
Run the check before making timing edits
Save this as check_srt.py beside the sample. The script uses the Python 3 standard library and prints one overlapping earlier cue per affected cue. It remembers the earlier cue that ends latest so it can catch an overlap even when a shorter cue has already ended.
import re
import sys
from pathlib import Path
def milliseconds(stamp):
hours, minutes, seconds, millis = map(int, re.split("[:,]", stamp))
return ((hours * 60 + minutes) * 60 + seconds) * 1000 + millis
def read_cues(text):
if not text.strip():
raise ValueError("The subtitle file is empty.")
stamp = r"[0-9]{2,}:[0-5][0-9]:[0-5][0-9],[0-9]{3}"
timing = re.compile(rf"({stamp})\s*-->\s*({stamp})")
cues = []
seen = set()
for block in re.split(r"\n[ \t]*\n+", text.strip()):
lines = block.splitlines()
if len(lines) < 3 or not lines[0].strip().isdecimal():
raise ValueError("Expected a cue number, timing and text.")
cue = int(lines[0].strip())
match = timing.fullmatch(lines[1].strip())
if not match or cue in seen:
raise ValueError(f"Invalid timing or duplicate number at cue {cue}.")
start, end = map(milliseconds, match.groups())
if end <= start:
raise ValueError(f"Cue {cue} must end after it starts.")
seen.add(cue)
cues.append((start, end, cue))
return sorted(cues)
if len(sys.argv) != 2:
raise SystemExit("Usage: python check_srt.py episode.srt")
try:
cues = read_cues(Path(sys.argv[1]).read_text(encoding="utf-8-sig"))
except (OSError, ValueError) as error:
raise SystemExit(str(error)) from error
latest_end = -1
latest_cue = None
found_overlap = False
for start, end, cue in cues:
if start < latest_end:
print(f"Cue {cue} overlaps cue {latest_cue} by {min(end, latest_end) - start} ms.")
found_overlap = True
if end > latest_end:
latest_end, latest_cue = end, cue
if not found_overlap:
print("No overlapping cues.")
raise SystemExit(1 if found_overlap else 0)
Run python check_srt.py episode.srt. It reports cue 2 overlapping cue 1 by 1000 ms and cue 3 overlapping cue 1 by 1000 ms. Cues that meet exactly at the boundary are allowed by this check.
Check the actual cut
Open the flagged times in your caption editor. Listen to the line before trimming it. An overlap left by a recut may call for new in and out points. If two characters really speak at once, check how your intended player displays the result before changing their timing.
If the captions are fighting for space because an uninterrupted wide shot is too busy, go back to the board for that beat. For a project planned in DramaPilot, use the storyboard panel to decide which action or speaker should be clear on the cut. Subtitle timing is handled in the editing workflow. DramaPilot Storyboard Writer
Top comments (0)