Inspiration taken (including the name, sorry) from github.com/kaervin/subserv-mpv-plugin
mpv-subserv is a plugin for the mpv video player that sends all subtitles to your browser, so you can copy-paste or use a mouseover dictionary on them.
The plugin is dormant by default and controlled through the following environment variables:
1to enable the plugin.
MPV_SUBSERV_LANGwill be put in the HTML bodys
langattribute. Important for CJK languages.
MPV_SUBSERV_FILTERpath to the filter file to use (see Filter files).
MPV_SUBSERV_SUBFILEfull path the subtitle file (required, see Design considerations).
MPV_SUBSERV_BROWSERyour browser command, falls back to
Sometimes, subtitle files contain unwanted noise that you do not want in your subtitle list. By specifiying a filter file, you can filter those out.
A filter file is composed of line seperated regular expressions. If one of them matches against a line, it will not be displayed on the web UI. Refer to the Go Documentation for information about the syntax.
mpv-subserv has to do it's own subtitle parsing, as mpv's interface for getting subtitle data is quite poor. Mpv does not expose how long subtitles are being displayed, which will be needed for future functionality (see TODO). Also, mpv's sub-text property is not reliable when retiming subtitles on the fly using sub-delay.