Skip to content

Fix oversized SRT/VTT caption cues on export - #98

Merged
wassgha merged 3 commits into
mainfrom
cursor/fix-srt-long-cues-69f8
Sep 14, 2026
Merged

wassgha merged 3 commits into
mainfrom
cursor/fix-srt-long-cues-69f8

Conversation

@wassgha

@wassgha wassgha commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Problem

SRT/VTT export only split cues on speaker changes or pauses longer than 0.75s. Continuous speech turned into single 20–60s cues with huge multiline blocks that overflow the video frame.

Fix

In wordsToCues (lib/serializeTranscript.ts):

  • Split on sentence-ending punctuation
  • Cap cue duration at 5s and wrap dialogue for short on-screen blocks
  • Keep short lowercase sentence-final tokens with the preceding cue

Export modal

SRT/VTT now show a single Short cues (≤5s) toggle (on by default). Off restores legacy speaker/gap-only splitting.

Export dialog with Short cues toggle on SRT

Evidence

Continuous speech with the toggle:

  • ON: 5 cues, longest 4.85s
  • OFF: 1 cue spanning the full run

srt-short-cues-toggle-demo.txt

Tests

  • npx tsx tests/serialize-transcript-test.ts
  • npx tsx tests/i18n-test.ts
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 14, 2026 21:58
Caption cues previously only split on speaker changes or 0.75s pauses, so
continuous speech became 20–60s multiline blocks. Split on sentence endings
and hard-cap cue duration/characters, and wrap cue text for display.

Co-authored-by: Wassim Gharbi <wassgha@gmail.com>
Allow a short lowercase sentence-ending token to finish the current
caption instead of becoming a one-word orphan after a line-length split.

Co-authored-by: Wassim Gharbi <wassgha@gmail.com>
@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
app.rescript Ready Ready Preview Sep 14, 2026 10:06pm UTC

Expose short cue splitting as a single SRT/VTT option in the export
dialog (on by default), and lower the max cue duration from 7s to 5s.

Co-authored-by: Wassim Gharbi <wassgha@gmail.com>
@wassgha
wassgha marked this pull request as ready for review September 14, 2026 22:11
@wassgha
wassgha merged commit 0f8478e into main Sep 14, 2026
3 checks passed
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.

2 participants