GithubHelp home page GithubHelp logo

Comments (4)

mansuen avatar mansuen commented on July 27, 2024 1

This can be achieved by going to Settings > Open Config Folder, and then creating (I think it's not there by default) a text file "input.conf" and pasting this:

ENTER sub-seek 0

Then the Enter key will replay the current subtitle segment. Correct me if I'm wrong.

from memento.

ripose-jp avatar ripose-jp commented on July 27, 2024

Like mansuen said, you should just add a bind in your mpv.conf. There's no reason to add a button unless you're using something like a Steam Deck.

from memento.

bakustarver avatar bakustarver commented on July 27, 2024

The code that mansuen posted actually activates this button:

new
It rewinds to the beginning of the current subtitle.
You can also use the "" key in Memento to rewind to the beginning of the current subtitle segment.

I'm writing about something else, about looping the beginning of the current subtitle segment with the end of the current subtitle segment

Subtitles in srt format, for example:
1
00:00:18,760 --> 00:00:22,100
🡡                            🡡
the beginning --> the end
目が覚めた場所には

2
00:00:22,100 --> 00:00:25,600
🡡                            🡡
the beginning --> the end
白い壁 保健室

make a loop with subtitle fragment 1:
make the video player load video only from 18.760 sec to 22.100 sec.

The same with 2
load the video in the segment from 22.100 to 25.600 seconds

MPV already has a function to loop two AB points by pressing the L key three times (works in Memento as well).

In general, simplify looping a video, with a single click on the current subtitle segment, by using a button, or hotkey

from memento.

ripose-jp avatar ripose-jp commented on July 27, 2024

The code that mansuen posted actually activates this button:

That button executes sub-seek -1.

It rewinds to the beginning of the current subtitle.

It goes to the last subtitle.

You can also use the "←" key in Memento to rewind to the beginning of the current subtitle segment.

It goes 10 seconds backwards in the video.

Corrections aside, I don't see the value in implementing the feature internally in Memento since the same functionality can be achieved through some button presses or through a Lua script if you want to get specific. Implementing features like this in C++ is just unneeded baggage in my opinion. The type of features that should be implemented in Memento are ones that either can't easily be scripted into mpv or can be done significantly better in C++.

Since exactly what you want doesn't already exist from what I can find, I recommend you learn Lua and mpv's API. Lua is a simple language. mpv's API has a learning curve due to its documentation, but essentially all you'll be doing is binding a hotkey that gets the sub-start and sub-end properties and sets an A-B loop. It shouldn't be more than a few lines of code.

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.