Skip to content

Conversation

@Minei3oat
Copy link

This PR adds the support for cutting SubRip subtitles (*.srt) to ttcut.

How it works:

The subtitles are loaded completely (timing and text) in the corresponding header list. This is possible as the files aren't large (around 100 KB for a movie).
The input file can have \r\n or \n line breaks. The output file will always have \r\n.

- One letter from the end was dropped for each umlaut in the subtitle
- One milisecond was added per cut
- searchTimeIndex always gave index of next subtitle, even if time is before end of the current subtitle
MINIXJR added a commit to MINIXJR/TTCut-ng that referenced this pull request Jan 31, 2026
Based on the work by Minei3oat (PR baltendorf#1).

Features:
- Auto-load SRT files matching video filename
- Display subtitles in video preview frame
- Pass subtitles to mpv via --sub-file parameter
- Cut subtitle streams along with video/audio
- Generate subtitle previews for cut preview dialog

New files:
- avstream/ttsrtsubtitlestream.cpp/h - SRT parser
- avstream/ttsubtitleheaderlist.cpp/h - Subtitle header management
- data/ttsubtitlelist.cpp/h - Subtitle data list
- data/ttopensubtitletask.cpp/h - Async subtitle loading
- data/ttcutsubtitletask.cpp/h - Subtitle cutting task
- gui/ttsubtitletreeview.cpp/h - UI widget for subtitle list

Co-Authored-By: Minei3oat
Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

1 participant