DEV Community

shansjl
shansjl

Posted on

Cut once, subtitles follow: a ripple delete that includes the caption track

A feature request on a popular open-source cutter this month put a common subtitle problem in one sentence:

"I need to choose the cut points once and get both the edited video and synchronized subtitles. Repeating the edit in a subtitle editor adds time and makes it easy to introduce a sync offset."
(public request: mifi/lossless-cut #3209)

That tool has good reasons to be built the way it is. Stream-copy cutting is its whole point, and this post isn't a knock on it. But the request describes a real gap: the video and the .srt are usually edited as two separate things, and every cut has to be made twice.

I build CutVoke, an open-source (MIT) local video editor that Claude Code / Codex can also drive over MCP. Here is how it treats captions as part of the timeline, so one cut moves everything. I'll also cover where it is not the right tool.

1. Delete a time range, not a clip

Deleting a clip and closing the gap on one track is easy. The trouble is everything else sitting on that stretch of time: other tracks, captions, markers.

CutVoke has a sequence-level command for this:

sequence.deleteRange { start, end }
Enter fullscreen mode Exit fullscreen mode

It deletes [start, end) across the whole sequence. It trims and closes up video, audio, captions, markers, automation and multicam cut points in one atomic command. If any affected track is locked, the entire command is refused instead of half-applied. One undo restores everything.

Captions that straddle the range are trimmed. Captions after it shift left by exactly the deleted duration, so there's no second pass in a subtitle editor and no offset creeping in.

(There's also clip.rippleDelete with scope: "sequence", which removes a clip and ripples tracks, captions and markers together.)

2. Or cut by text

When the captions came from speech recognition, the transcript itself is a good place to cut:

  1. Search the transcript and locate a sentence on the timeline.
  2. Audition it (playback stops at the end of the range).
  3. Select sentences, or individual words where word timings exist.
  4. Click "Preview deletion impact". This only calculates which clips and captions would be affected. It doesn't change the project or add an undo entry.
  5. Confirm, and the matching voice, picture and captions are removed together.

However many sentences or words you picked, that confirmation is a single transcript.delete command with one undo. Overlapping ranges are only processed once.

An agent can call the same command over MCP, e.g. "delete caption lines 12 and 14". It goes through the same revision checks as the UI, so a human can review the result on the normal timeline.

3. Then export

  • SRT: export the project's captions after the cut. Multi-line captions survive an SRT round trip. I tested parse_srt → export_srt locally, and "line one / line two" came back as two lines.
  • WebVTT: caption.exportVtt, also available to agents.
  • Burned in: the MP4 export can burn the captions into the picture.

If you don't have captions yet, CutVoke can make a local draft with faster-whisper (auto / zh / en / ja / ko). Nothing is uploaded, and the draft only lands in the project after you review it.

Where this is not the right tool

  • It re-encodes. Export goes through libx264 (or NVENC when available). If you need lossless stream-copy cuts, keep using a stream-copy cutter. CutVoke solves the "cut once, captions follow" half, not the lossless half.
  • It doesn't pick highlights for you, and it's desktop-only (Windows / macOS / Linux, currently a prerelease).
  • I haven't measured how it performs on multi-hour recordings.

Takeaway (even if you never use CutVoke)

If your tool lets people edit video and text tracks together, make time-range deletion a single command that knows about every track type. Add a dry-run that previews the impact, and make the whole thing one undo. Most subtitle drift doesn't come from bad timestamps. It comes from making the same edit twice.

Repo and docs: https://github.com/frankShan001/CutVoke (transcript editing is in docs/user/ADVANCED_TIMELINE.md).

Top comments (0)