Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chapter-make-read.lua accepts chapter filenames with 2 or 3 letter language codes #16

Open
porg opened this issue Jul 7, 2023 · 2 comments

Comments

@porg
Copy link
Contributor

porg commented Jul 7, 2023

Imagine this file structure

video.mp4           # Video file
video.chp           # Chapter file, language neutral
video.mp4.chp       # Chapter file, language neutral, video suffix included
video.chi.chp       # Chinese chapter file, 3-letter code (ISO 639‑3), 
video.en.chp        # English chapter file, 2-letter code (ISO 639‑1)
video.spa.chp       # Spanish chapter file, 3-letter code (ISO 639‑3)
video FR.chp        # French chapter file, 2-letter code (ISO 639‑1) at the end of the file name without a dot

Detection

Utilization

  • If there is only one chapter file, then use it right away, no questions asked.
  • If there are chapter files available in different languages then
    • in v1 the script chooses according to the mpv Track Selection preferences:
      • Already offers --alang (audio) , --vlang (video), --slang (subtitles), so you could introduce --clang (chapters)
      • If no --clang is present it uses --slang: If you can read the subtitles in that language, you can also read the chapters in that language.
      • For some obscure reasons you may want the original language chapter names (e.g. for reference) but nevertheless watch in your preferred subtitle language.
    • in v2 the script may allows to switch languages interactively (like subtitles already can)
    • in v3 the script may allows to switch language interactively in tandem with the subtitle files if you have exactly the same set of chapter languages and subtitles languages in total (from the video file stream and/or loaded from sidecar files)
@dyphire
Copy link
Owner

dyphire commented Jul 9, 2023

I roughly understand your idea, but since I personally do not have such a need and cannot think of a simple way to implement it at the moment, I am afraid I do not have the motivation to implement this feature.

If anyone is willing to implement it, welcome to open PR for this.

@porg
Copy link
Contributor Author

porg commented Jul 10, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants