Resource list for subtitle-related things

...as well as an introduction to mpv.

  • https://jimaku.cc/anilist/:username - Filtered view of the site's subtitles based off of an AniList user's watching and planning shows. Replace :username with any username.
  • Jimaku Toolbar Button - Firefox extension that adds a toolbar button leading to the associated jimaku.cc page on AniList anime pages, AniList user pages, and TMDB pages.

Video players

Asbplayer

Asbplayer is a browser-based media player and browser extension that allows dragging subtitles onto streaming video. More details on setup, retiming, and sentence mining can be found on the github page.

Memento

Memento is a mpv-based video player. It has support for Yomitan dictionaries, so you can look up words on top of the video itself. Configuring the underlying mpv is carried out in a similar way (using mpv.conf, input.conf, etc.).

Jidoujisho

Jidoujisho is a language learning suite for Android, which includes a video player. It allows you to do look ups on top of the video itself.

mpv

mpv is a versatile media player and offers a high level of customization. There are multiple guides out there covering setup and config, such as thewiki.moe, iamscum, and kokomins. Every setting can be found in the manual.

Config (mpv.conf) - An example of some subtitle-related options. Font mentioned can be found here.

sub-auto=fuzzy                                  # external subs don't have to match the file name exactly to autoload
sub-file-paths=ass;srt;sub;subs;subtitles       # search for external subs in the listed subdirectories

# the following options apply to unstyled subtitles (.srt but not .ass)
sub-font="ヒラギノ丸ゴ ProN W4"
sub-font-size=50
#sub-bold=no
sub-color="#FFFFFF"
sub-border-color="#901313" # red
sub-border-size=2.2
sub-margin-y=60                    # Top and bottom screen margin for the subs in scaled pixels
#sub-pos=95                        # <0-150> Vertical position in % of the screen height, increasing it moves the subtitles down. 100 is the original position. Applies to .ass and .srt. 

sub-ass-override=no                # toggle between scale, force, and no with u; scale applies --sub-scale and all --sub-ass-* style override options, force applies all --sub-* options
#Thoughts on using sub-ass-style-overrides: hard to set it in a way that works for everything. Using keybinds to cycle sub-ass-override and change sub-scale and vertical sub position are probably the way to go.

# options for users of dual language subtitles (display another subtitle track at the top)
secondary-sub-pos=10
#secondary-sid=auto
#secondary-sub-visibility=no

slang=ja,jpn,jp,enm,en,eng      # automatically select subtitles in decreasing priority
alang=ja,jpn,jp,enm,en,eng      # automatically select audio tracks in decreasing priority

Keybinds (input.conf) - These are some keybinds that may be useful.

### Retiming
Ctrl+Shift+LEFT sub-step -1            # change subtitle timing such that the previous subtitle is displayed
Ctrl+Shift+RIGHT sub-step 1            # change subtitle timing such that the next subtitle is displayed
z add sub-delay -0.1                   # shift subtitles 100 ms earlier
x add sub-delay +0.1                   # delay subtitles by 100 ms
Ctrl+LEFT   no-osd sub-seek -1         # seek to the previous subtitle
Ctrl+RIGHT  no-osd sub-seek  1         # seek to the next subtitle

### Dual language subtitles
Alt+v cycle secondary-sub-visibility   # hide or show the secondary subtitles

### Non-default keybinds
Ctrl+UP no-osd sub-seek 0              # replay the current subtitle
- add sub-scale -.1                    # make subs smaller (requires sub-ass-override=scale or higher for .ass)
= add sub-scale .1                     # make subs larger (requires sub-ass-override=scale or higher for .ass)
u cycle-values sub-ass-override scale force no # toggle overriding SSA/ASS subtitle styles with the normal styles
C set sub-delay 0

  • Default keybinds can be found here. A keybinding map can be found in the doc folder of the git version.

Scripts (scripts folder) - mpv can load Lua/Javascript scripts. Some related ones are listed here:

Retiming Subtitles

Subtitles generally desync at the beginning (opening logos), after OP ( sponsor cards), and in the middle (CM break between part A and B).

Manual retiming can be done relatively quickly with video player keybinds. mpv-retiming-scripts attaches additional features for retiming:

  • snap-to-secondary-sub - Adds keybinds for making the start time of the subs and secondary subs match.
  • save-sub-delay-to-file - Interface for modifying external subtitles that are loaded onto mpv. Built as a quicker alternative to the standard way of permanently retiming a subtitle file, which is through a subtitle editor.

Auto-retimers can produce a result that is perfect, "good enough", or completely unsalvageable. Timing can be thrown off by song positioning and lines present in one file but not the other (e.g. transcribed sounds, BD only scenes, etc.). Most auto-retiming related tools interface with either ffsubsync or alass.

  • Automatic Subtitle Retimer - This requires video/sub files to be in the same parent folder as the retimer folder and has two functions: retiming+rename and rename-only. It will run your external subtitles and the internal subtitles of the .mkv files through alass for retiming. For this to work properly, the script requires you to input which styles in the internal subtitles that you want to time against. Usually, you want to select the styles with the dialogue and not signs/lyrics.

Subtitle Editors

Aegisub and Subtitle Edit are subtitle editors, which are multipurpose and can handle things like file conversion, manual timing, removing styles, etc.

Renaming

Other

  • Caption2Ass_PCR - Since mpv usually does not properly render subtitles in .ts files, you can extract the subs first to use them.
  • Useful regex replaces - You can do batch regex replaces with a text editor, like Sublime Text's Find->Find in Files.... Note that regex filtering is supported by both asbplayer and mpv (doesn't work on windows(?)).
    • \\fsc[xy][15]00? - remove scaling tags found in TV-sourced .ass files
    • \n^.*(cn|ch|zh|sc|tc|sign|staff|credit|note|screen|title|comment|ruby|furi|scr|cmt|info|next episode|stf|注释).*$ - remove unwanted styles usually present in dual language subtitle files from Chinese fansub groups
      • alternatively, \n^.*(<style name 1>|<style 2>).*$
    • Style: (<style name>),.* - replace with preferred style, such as:
    • Style: $1,A-OTF Maru Folk Pro B,42,&H00FFFFFF,&H000000FF,&H00000000,&H7F000000,-1,0,0,0,100,100,0,0,1,2,2,1,0,0,0,1
    • \([^()]*\) - remove furigana
    • asbplayer github page - Regexes for removing text enclosed by parenthesis indicating speakers, removing transcribed sound effects, etc.
Edit
Pub: 20 Oct 2024 21:22 UTC
Edit: 31 Oct 2024 06:17 UTC
Views: 131