Add Extract Embedded Subtitles plugin#734
Merged
DogmaDragon merged 2 commits intoJun 28, 2026
Merged
Conversation
Extracts embedded text subtitle tracks from video files into external .srt sidecar files that Stash recognises as captions (stashapp/stash#3875). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Extract Embedded Subtitles
A new external plugin that extracts embedded text subtitle tracks from video files into external
.srtsidecar files, named so Stash's existing caption matcher attaches them automatically.Addresses the long-standing request in stashapp/stash#3875. video.js can't render embedded tracks directly, so the practical path is generating sidecar
.srtfiles - this automates that.What it does
ffprobeenumerates each scene file's subtitle streams.ffmpeg -map 0:<idx> -c:s srtto<video>.<lang>.srt, matchingGetCaptionPathinpkg/file/video/caption.go(ISO-639 language segment, or no segment when the language is unknown).metadata_scan) so captions appear without a full library rescan.Limitations (documented in the README)
defaulttrack wins ties.Testing
validator/plugin.schema.json(Draft-07) - passes.name.eng.srt,name.spa.srt,name.srtwith text and timing intact; re-run is idempotent (skips existing).caption.go.metadata_scan.Disclosure
Per the repo's LLM-assisted contributions policy: this was LLM-assisted, human-reviewed, and tested (details above). The code is original - it shells out to
ffmpeg/ffprobeand usesstashapp-toolslike other plugins here - and I take responsibility for it.Relates to: stashapp/stash#3875