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

[Question] How to show MPV's builtin STATS programingly #9776

Closed
CarterLi opened this issue Jan 27, 2022 · 5 comments
Closed

[Question] How to show MPV's builtin STATS programingly #9776

CarterLi opened this issue Jan 27, 2022 · 5 comments

Comments

@CarterLi
Copy link

CarterLi commented Jan 27, 2022

IINA uses libmpv as its backend and we want to toggle showing mpv statistics. I can't find any options / commands to do it except --load-stats-overlay which doesn't seem to be useful

@CarterLi
Copy link
Author

Ref: CarterLi/iina#29

Can I send keyboard events to libmpv?

@avih
Copy link
Member

avih commented Jan 27, 2022

Can I send keyboard events to libmpv?

iiana can, I don't know whether it allows users to send them to mpv.

As for stats.lua, it can also be activated using script-message. See the "Different key bindings" section at the stats docs, though again, I don't know if iiana has a way to allow users to send script-messages to mpv.

@avih avih closed this as completed Jan 27, 2022
@CarterLi
Copy link
Author

CarterLi commented Jan 27, 2022

I'm one of a developer of IINA and I'm searching for method to communicate with libmpv using various options / commands. Sorry for confusion.

Can I send keyboard events to libmpv?

iiana can, I don't know whether it allows users to send them to mpv.

I mean if I can forward keyboard events to libmpv somehow.

As for stats.lua, it can also be activated using script-message. See the "Different key bindings" section at the stats docs, though again, I don't know if iiana has a way to allow users to send script-messages to mpv.

IINA don't uses MPV's native window but IINA creates its own, so MPV won't receive users' keyboard events directly. We have to forward these keyboard events to libmpv using libmpv's API somehow. I want to know if there are APIs for that.

As for script-message, I still don't know how to use it. Any examples?

@avih
Copy link
Member

avih commented Jan 27, 2022

The simplest way for both would probably be with to send a keypress KEY and/or script-message MESSAGE ARG... commands to mpv.

There are other ways. client.h is documented quite well, and so are the available mpv commands (at the mpv docs).

@avih
Copy link
Member

avih commented Jan 27, 2022

As for stats.lua, it can also be activated using script-message. See the "Different key bindings" section at the stats docs

Sorry, script-binding, not script-message. E.g. script-binding stats/display-stats-toggle (as seen at that docs section.

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

No branches or pull requests

2 participants