ThaUnknown / miru

Bittorrent streaming software for cats. Stream anime torrents, real-time with no waiting for downloads.
https://miru.watch
GNU General Public License v3.0
2.18k stars 125 forks source link

[Feature Request]: Dual language subtitles #402

Closed chaorace closed 6 months ago

chaorace commented 6 months ago

Preflight checklist

Problem Description

Currently, Miru's player is only capable of rendering one subtitle track at a time. I'd like it if Miru were enhanced to allow for displaying two subtitle tracks on the same video simultaneously.

Why? Watching videos with dual subtitle tracks is a fun way to study Japanese (or any language!) and is a stock feature available in many common video players such as VLC and MPV.

Proposed Solution

Requirements

  1. Expose a new option called "Secondary Subtitle Language" in the Player > Language Settings panel (default: "None", for no secondary track)
  2. Whenever "Secondary Subtitle Language" isn't set to the default "None", a second radio button group should be available in the player's subtitle chooser dialog (for switching or even hiding the second track during playback)
  3. Whenever a video is playing with a secondary subtitle track selected, both the main track and the secondary track should be visible at the same time (preferably fully legible!)

Proposed Implementation

After reviewing the relevant Miru code, it is my opinion that the best solution would be to preprocess the two input tracks into a single merged track which the player can then handle normally. Since the player uses ASS and Miru's subtitle module automatically converts other formats into ASS, we can introduce a merge step in-between which takes two ASS inputs and produces one ASS output.

Due to the complexity of ASS and Miru's overarching "it just works" design, I feel that we should avoid the obvious offset-based merge strategy because that would inevitably lead to the introduction of clunky and inscrutable options (i.e.: Secondary Subtitle Offset Amount (X)). A much more ideal solution would be some kind of configuration-free "smart merge".

Luckily for us, such a "smart merge" already exists in the form of the mergeSubtitles function provided by subtitle-tools. Theoretically, it should be possible to simply import the dependency and wire it up to a brief and largely self-contained code pathway.

Extra (Future?) Considerations

ThaUnknown commented 6 months ago

if you want to learn japanese, then I recommend you use duolingo or smth, Miru is for watching anime, not learning japanese, not that it matters as 95% of releases don't have japanese subtitles, also I'm fairly sure MPV doesn't support concurrent subtitle tracks

this is too much effort, too many potential issues, for something 1 or 2 people max will use

chaorace commented 6 months ago

if you want to learn japanese, then I recommend you use duolingo or smth, Miru is for watching anime, not learning japanese

This comes off as super rude. Just say no next time, bye.