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

Automatically add the correct image and audio even if the subtitles have advanced past while playing #118

Open
kanjieater opened this issue Jan 12, 2024 · 3 comments

Comments

@kanjieater
Copy link

  • The add-on crashes?
  • The add-on stopped working?
  • Have a feature request?

Please ask on https://tatsumoto.neocities.org/blog/join-our-community.html instead. It is easier for our members to provide support over in the chats. Thank you!

Don't forget to provide the following information:

Environment

  1. OS name [e.g. Parabola, Debian]
    Windows

  2. OS version
    11

  3. mpv version
    mpv 0.35.0-221-ga40958cd Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects
    built on Sun Feb 12 12:30:03 2023
    libplacebo version: v5.229.1-157-g8552809
    FFmpeg version: N-109844-g2b4273072
    FFmpeg library versions:
    libavutil 58.0.100
    libavcodec 60.1.100
    libavformat 60.2.100
    libswscale 7.0.100
    libavfilter 9.0.100
    libswresample 4.9.100

  4. Logs

  5. Screenshots, if applicable

Describe the bug
Sorry, probably not a bug, but I'm unable to join the server currently. Is there any way to allow for automatically matching the sentence field of the last created card to the subtitles to automatically extract the corresponding audio? Currently if add a card as the show is still running, you hit ctrl+m, it will add potentially the wrong audio since the show is still going and the subs have advanced. I'd like to be able to add cards w/ audio, without having to stop the show if possible. Sorry if this has been answered; this is how anacreon's script worked, that I'm trying to look for alternatives to.

To Reproduce
Steps to reproduce the behavior:

  1. Add a card w/ yomichan
  2. Use add audio hotkey
  3. if the subs have advanced you get the audio of the current sub, not the sub that matches the sentence line that you added in anki

Expected behavior
The audio & image of the card, should match the audio & sub of that part of the show, not the time when the "add media to last card" hotkey was pressed.

@kanjieater
Copy link
Author

Correction, the anacreon script works the same way this does, apologies for the misinformation. Is there anyway to accomplish still what I'm describing?

@tatsumoto-ren
Copy link
Member

but I'm unable to join the server currently.

Weird. Try this link https://matrix.to/#/#join:midov.pl. It should work on any client.

it will add potentially the wrong audio since the show is still going and the subs have advanced.

Yes. Normally you would pause beforehand.

Is there anyway to accomplish still what I'm describing?

Ctrl+N will create a new card with the currently shown sentence and the corresponding audio. You can fill the definition later with AJT Japanese or something else. Or you can join the card with another card that contains a definition with AJT MergeNotes.

When updating cards that have been previously created, mpvacious will look at the timings set in mpv. If no timings are set, it will assume the current subtitle line. So what you're suggesting can only be accomplished if mpvacious is modified in some way. For example, if you make it remember all the subtitle lines up to the current timestamp, and then make it so it chooses the right one. However, there are corner cases where this algorithm will yield wrong results, such as when there is a line that appears more than once in the subtitle file.

@kanjieater
Copy link
Author

Thank you, yes. Good to know it doesn't exist quite yet.

You're right. Yes, I think it would be nice for the audio line to match automatically even if it wasn't the exact same line, for the edge case when subs are repeated. I think this could probably be done with ffmpeg in the background to keep from disturbing the mpv session in progress.

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