Command for Stitching Text in Subtitles

Default behavior of the command would be start time from earliest selected subtitle to end time of latest selected title subtitle, and text of subtitles are combined into one subtitle, separated by spaces. Useful for merging broken auto-generated subtitles or correcting subtitles that are too small.

A pop-up window will determine the logic of subtitle stitching using regex (likely used to correct spacing/punctuation) and certain parameters.

Start Time a selection between [earliest subtitle (#1)] (earliest subtitle will always be subtitle #1), [subtitle #?] (any other subtitle, ascending), [playhead], [custom]. (start/end will obviously be grayed out when not applicable)

End Time a selection between [latest subtitle (#2)], [subtitle #?] (any other subtitle, descending), [playhead], [custom]

Find The default value will be “(.*?)\R(.*?)” which replaces any new lines; The different subtitles will be treated as new lines. When this value is deleted, for example, the merged lines will be treated like new lines.

"If you don’t, I’m gonna leave links in

the description" with F:(.*?)\R(.*?) becomes

“If you don’t, I’m gonna leave links inthe description.”

Replace With the default value will be “\x20” which is a clearer way to write the space key (" ").

"If you don’t, I’m gonna leave links in

the description." w/ F:(.*?)\R(.*?) RW:\x20 becomes

“If you don’t, I’m gonna leave links in the description.”

The pop-up window will have to be scrolling in case a stitch with with a lot of subtitles is needed.

Show this window when using hotkey When you use the hotkey for this command (Shift + TBD I guess), this notification window will pop up. The way to access this window otherwise would be using the button.

Preview Shows a preview after the regex, which you can edit, if desired (maybe tweaking the new lines). Changing the regex will reset this box.

I guess you can also make this work with single subtitle selections so regex can also be used for that.

Result:

I like the idea of having a command to merge subtitles. But the dialog looks really complicated. I don’t think we should expose regex and control characters to our users. And manipulating the start/end times looks more complicated than just using the regular UI to adjust it after they are combined. But I suppose you are hoping that you can do a one-time configuration and then only use the shortcut key for most operations.

I think a simpler UI would pop open a dialog with a text box. The text box would be pre-populated with a “best guess” string that already merged the selected subtitles based one some heuristics (look for newline, punctuation, maximum length, etc). The OK button would be preselected so the user can just hit Enter if they like the proposed text. Or, then can edit the text before selecting “OK”.

The disadvantage of this simpler approach is that you probably can’t pre-configure some choices (like start and end time selection).

Yeah! That’s completely understandable. I agree from a design standpoint that’d be preferable. I wouldn’t mind simplifying the functionality a little. The caveat being tweaking other commands to meet needs. It could easily reserved to ‘configuration’ but regex can probably done externally anyway.

The start/end time setting would easily be redundant if there was a toggle to automatically select the subtitle(/clip/transition?) closest to your playhead (if I’m missing this functionality let me know) and if ‘end time cannot be before start time’ move the previous subtitle end time instead (and vise versa) would be good enough.

Whatever the approach would be, the idea is to make managing subtitles able to be done keyboard-only for the most part; I’m not especially concerned about a ‘one button’ solution for everything.

For that reason, a way to select multiple subtitles keyboard-only would be great too but I know it works a little differently than the clip timeline.

I revised the settings window here:

Preview text Press tab 2 times to change it to whatever you want, will be adjusted based on configuration. Pressing enter on the text will also count as hitting “OK.”

Fix spacing Adds spaces between subtitles, and deletes spaces surrounding them. (If the preview subtitles start/ends with a space, delete them.)

Character limit per line The hard limit on characters per line.

Prefer characters per line The soft limit on characters per line (lines will try to deviate from this number as least as possible.)

Try to follow line-breaking guidelines The algorithm for this would be a bit complex because you have to account for a lot of parts of speech, but I guess the minimal algorithm would be

  • 2 lines max no matter what
  • Articles, conjunctions, and commas (+ whatever else is cared to account for) rounds to a new line
  • Warn the user if the subtitle exceeds 21 chars/sec

(I referred to here. Subtitling Tips)

Convert to single sentence Uncapitalize beginning of all subtitles except first, preserve latest punctuation and move to end.

Maybe counters for the characters per line on both this menu and the “Current” subtitle would be good? But I don’t know, this is probably enough.