Fix oversized SRT/VTT caption cues on export - #98
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
marked this pull request as ready for review
September 14, 2026 22:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):Export modal
SRT/VTT now show a single Short cues (≤5s) toggle (on by default). Off restores legacy speaker/gap-only splitting.
Evidence
Continuous speech with the toggle:
srt-short-cues-toggle-demo.txt
Tests
npx tsx tests/serialize-transcript-test.tsnpx tsx tests/i18n-test.ts