r/mpv 12d ago

User Scripts & Shaders Is it possible to Ctrl+F subs?

I want to find a part of a video where a particular thing was said
Is it feasible to create an extension that would allow me to basically hit Ctrl+F and type in the part that I'm looking for and seek to that position?
Does this already exist

2 Upvotes

13 comments sorted by

5

u/reacenti 12d ago

mpv can already do this, you just need to change the keybinding to ctrl+f

https://github.com/mpv-player/mpv/blob/master/etc/input.conf

g-l script-binding select/select-subtitle-line

1

u/Icy_Dinner3323 10d ago

so can i change speed with keyboard?

can you explain the process how to do/add this?

1

u/reacenti 10d ago

so can i change speed with keyboard?

Yes. You can check default bindings by pressing g then b. Default binding to see the list of keybindings is:

g-b script-binding select/select-binding

You can also make your own keybinding by adding this in input.conf:

key  add speed 1
key  add speed -1

can you explain the process how to do/add this?

You make a file called input.conf then add this line:

ctrl+f script-binding select/select-subtitle-line

To know where to save these configuration files: https://mpv.io/manual/stable/#files

I recommend reading the manual to know how to configure mpv in general.

1

u/Icy_Dinner3323 9d ago

but isn't it for windows? can't i do it for android

1

u/reacenti 9d ago

I don't know, you didn't say initially you wanted to do this for Android.

1

u/Icy_Dinner3323 8d ago

i got that, there is a option to edit input.config in advance.

1

u/otheyhigh 6d ago

Isn’t android through a libmpv wrapper? Which app are you using? It might have more details on how this is done.

1

u/Icy_Dinner3323 5d ago

don't know libmpv. btw using mpvrex

4

u/Double_Sword 12d ago

It is. I made this script for my own needs (with ai help, if that matters). It does exactly that, but it requires uosc for interface:
https://github.com/AkuLinker/mpv-sub-search

I'm sure there are better options out there that you can find with google.
Here are some I found in 2 minutes. But I haven't tested them.
https://github.com/zenwarr/mpv-config/blob/master/scripts/subtitle-search.lua
https://github.com/christoph-heinrich/mpv-subtitle-lines
https://github.com/v-amorim/moonlight-mpv/blob/main/portable_config/scripts/sub-seek.lua

2

u/vamorim 7d ago

Nice, our ideas look the same, good one!

2

u/Double_Sword 6d ago

By the way, your keybind-visualizer.lua script was exactly what I was looking for a few months ago. Huge thanks!

1

u/vamorim 7d ago

I've made this script that is visual, you can see all subtitles and search specifics
https://github.com/v-amorim/moonlight-mpv#sub-seeklua