Coder Social home page Coder Social logo

Comments (6)

TingTingin avatar TingTingin commented on May 30, 2024 1

Thanks for the response

I don't know if this is helpful but I found this

https://github.com/SenneH/mpv2anki/blob/master/mpv2anki.lua

its a mpv script with the ability to export the secondary subs to Anki I tried going through it to see how it was done but I dont know enough about scripts to know what to look for maybe it could be helpful?

from memento.

TingTingin avatar TingTingin commented on May 30, 2024 1

seems like you can access secondary sub-text now in mpv

mpv-player/mpv#8822

from memento.

ripose-jp avatar ripose-jp commented on May 30, 2024

This is something I've wanted to have for awhile, but it's a really difficult issue to tackle.

The way Memento handles grabbing subtitle text is it observes the sub-text property from mpv. The problem is that mpv doesn't provide any property to grab text from the second subtitle.

The easiest solution would be to make a pull request that adds a property like sub-text-secondary to mpv and then when that finally makes it downstream to a release, add the feature to Memento.

The other option is to go outside of mpv which is a whole can of worms I'd like to avoid after my experience trying to implement the subtitle transcript feature. In short, the reason it populates as subtitles show up rather than all at once is due to limitations with what information mpv gives about subtitles.

from memento.

ripose-jp avatar ripose-jp commented on May 30, 2024

I looked through the code and tested the plugin. There is no magic to how they do it.

To add the second subtitle, rather than using the second subtitle track, they have the user manually switch the primary subtitle track to the secondary subtitle track and then add it to the card.

I had dreamed up a similar solution yesterday that I likely won't implement that involves switching the primary subtitle track to the secondary subtitle track for a split second when generating the card and then setting it back. The only issue is that it creates graphical jank that you can't hide from the user since mpv flashes the secondary subtitle on screen for a split second. This is already a problem with the {screenshot} marker, but I consider the benefits to outweigh the negatives in that case since it won't interfere with anything else.

I'm not against contributing to mpv to solve this issue though. It's more a matter of are they willing to accept a pull request for something like this.

from memento.

ripose-jp avatar ripose-jp commented on May 30, 2024

Looks good.

When it finally makes it into mpv releases, I'll be sure to add this feature.

from memento.

ripose-jp avatar ripose-jp commented on May 30, 2024

It's been added on the dev branch. The catch is that unless the mpv version supports the secondary-sub-text property, none of the features that rely on it will be visible.

I'll probably create two Windows downloads for the next release, one bundled with an unstable build of mpv (assuming I can get it to build on Windows) and one with version 0.33.1-r1.
image

from memento.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.