Closed ghost closed 7 months ago
I also think MPC-QT is by far the best existing option for an "official" mpv frontend. Aside from VLC I think MPC is probably the most widely recognized media player software out there.
I do understand where people are coming from in saying that mpv doesn't need a GUI, that it's usability is as good or better than what a GUI would provide, but that's missing the point that for the average end-user any application without a GUI is extremely unintuitive to use. The average end-user doesn't even have a conception of the separation between the underlying software and the GUI, every application they ever use has a GUI.
Why do you think we want to enable the "average end-user" to use mpv? It's better if they fuck off.
I'm considering adding some kind of OSD menu though, because at some point having too many key bindings becomes inconvenient. I only need to make a PoC, but I guess nothing is happening.
I use this script.
@bitsper2nd That script is pretty freakin amazing. Exactly what I wanted
For bomi fans, there's upcoming qt/mauikit player called cinema which uses mpv
Another attempt: https://github.com/tsl0922/ImPlay
Download: https://github.com/tsl0922/ImPlay/releases
It's cross-platform and highly compatible with mpv. added context menu and command palette support, compatible with almost all mpv cli options, scripts and config file. and it comes with a debug window, which is very useful for script developers.
Thanks for posting, I also released a new command palette project today, terminal based.
@tsl0922
I would rather use window embedding instead of limiting yourself to OpenGL, I think having DirectX and Vulkan support is important.
For a command palette, you can request script embedding and use M-x.lua, if the author allows it. I found this just recently and think it's awesome.
@stax76 indeed, window embedding is prefect, but you have to handle a lot of platform-specific things. I choosed opengl because it's simple to integrate with, maybe I will switch it to window embedding in the feature.
I'm using some lua widget scripts too, but it's hard to make complex gui with ass, that's why I started to make a gui from scratch.
BTW: It's possible to expose the imgui apis to lua (see the lua branch).
Overview that lists all GUIs found in the wiki and on GitHub:
@stax76 just tried window embedding (see the embed branch), it works very well on windows , but not on macOS(#10406), it seems wid
is broken on macOS now.
There is something macOS specific in the manual here.
Any plans for a Linux release or preview?
Recently, smplayer, mpv's embedding host, decided to crap out on me and start crashing mpv's subprocess on startup with no discernable reason. So I've gone in search of alternatives.
Another attempt: https://github.com/tsl0922/ImPlay added context menu and command palette support, compatible with almost all mpv cli options, scripts and config file.
Unfortunately, for me on rolling-release openSUSE Linux its completely inoperable. With my default custom profile it launches second window for its menu and on any other profile there is a single window but it's all-blue.
Overview that lists all GUIs found in the wiki and on GitHub: https://github.com/stax76/awesome-mpv
However, uosc+thumbfast scripts proved as mighty nice improvement over mpv's defaults due to non-invasive integration, detailed timeline, good representation of alternative tracks & chapters and option for thumbnail view.
Not all is well, however, as thumbnail view has badly delayed response (unlike perfection which is dead bomi fork that used second mpv instance with simplified rendering profile. And there is nothing akin to smplayer's excellent hotkey configuration.
Luckily, the most important feature of smplayer, playback resume, works fine now with plain mpv. Not sure if it always were hidden in options or if it's a newer addition. I'm patching it with https://github.com/mpv-player/mpv/pull/10838 and https://github.com/mpv-player/mpv/pull/6206 to make sure that it picks up proper directories and colour profile.
@stax76 @v-fox you can now try the pre-built binaries for win/linux/macos on the release page:
@tsl0922 Hi, the glfw3 fork is a bit problematic when packaging. Couldn't you include those methods in your app and link to the regular library? I like the rest.
@lgbaldoni what problem? please open an issue on ImPlay project. I forked glfw to add patches for:
There is an awesome command palette Lua/ASS library, can be found here:
https://github.com/Seme4eg/mpv-scripts/tree/master/script-modules
A new script based on it, some ideas are from mpv-search-page:
https://github.com/stax76/mpv-scripts#command_palette
I like doing small projects like this at the moment, so I don't have to face the difficult problem adding Linux support to mpv.net, so far I only studied the AvaloniaUI source code shortly, it's a start.
There are different approaches for a GUI, official or unofficial.
A GUI could be built directly into mpv using C.
Many have built a frontend, with an own main window implementation, which has the huge disadvantage of loosing all the rich cross-platform window functionality mpv already has.
It's probably possible to build a libmpv based app using mpv's video window implementation, I want to try adding optional support for this in mpv.net.
What's also possible is building a mpv GUI as a mpv extension, or set of extensions, so far this approach isn't popular, there is a Tcl/Tk based context menu, and one context menu that uses GTK3, Python and JSON RPC. I think the extension approach has great potential, but I think it would be much better doing it as C Plugin instead of JSON RPC, which so far is not supported on Windows, this would not only enable C, C++ and Rust, but also for instance dotnet on Windows using COM interop, which is easy to do.
Now there are many different UI frameworks and programming languages, everybody has a different background and preferences, even Electron or Tauri would work very well, if the memory can be fully reclaimed when the dialog closes. It's possible to use different UI frameworks for a single project, in mpv.net I use 2 different UI frameworks.
Requirements for a suitable UI framework used for a mpv GUI are:
Some popular choices are:
Web/Electron Web/Tauri Flutter AvaloniaUI QT/QML
But there are many others, and constantly new ones, like for instance slint.dev.
Programming language should be high performance too.
If somebody here knows open source apps with searchable settings dialog, it would be very interesting to know about, so far I know Visual Studio Code, Chrome and Firefox.
A GUI could be built directly into mpv using C.
@stax76 Good idea. With #12185 and the idea of #12482, I made a prototype of contextmenu plugin for Windows:
https://github.com/tsl0922/mpv-plugin
Put the compiled menu.dll
to mpv's scripts
dir and run mpv, you will get a native windows contextmenu:
Consider loading menu command list from config file and it should be pretty usable for anyone who wants such feature. Probably little bit more tricky to support nested list like audio tracks, but should be doable even in generic way.
(this was the only use-case why I added cplugin support on Windows, hoping someone will do the GUI enchantments)
EDIT: Also if it doesn't end-up overly complicated and would be customizable we could even consider upstreaming it to core mpv.
My experience with the context menu in mpv.net is the following:
In v7 which is now available as beta version release, I made a large change to how the context menu works, it's documented in the manual:
Before version v7 all bindings and the context menu definition was contained in the input.conf file, which mpv.net created in case it didn't exist. This had the disadvantage that mpv.net lost control over all default bindings and the context menu defaults. This was unfortunate, v7 introduces a new design fixing it.
In v7 no input.conf file is created, the default bindings and context menu is defined internally. input.conf only contains what is different from the internally defined defaults, so it's the same how mpv is used.
For backward compatibility the old input.conf format with the menu definition using
#menu:
is still supported. The new design also allows for a menu customization, in a sub section calledCustom
. In input.conf it can be defined like so:
Ctrl+a show-text Test #custom-menu: Test > Test
Consider loading menu command list from config file
@kasper93 It's supported now. The syntax is taken from mpv.net by @stax76, so you can just drop an input.conf from mpv.net to test it.
tsl0922: can you provide a build of your plugin ?
@kasper93 It's supported now. The syntax is taken from mpv.net by @stax76, so you can just drop an input.conf from mpv.net to test it.
Find it here:
tsl0922: can you provide a build of your plugin ?
You can download from the Actions Artifacts. This plugin is still in ealy development, once the basic functionality is implemented, I will publish a Release soon. (currently missing features: open dialog, nested list like audio tracks)
If you need dark mode code, I have this code here:
https://github.com/stax76/Everything.NET/blob/master/src/ShellDarkMode.cs
I have this code from the MSYS2 terminal code, it supports a dark mode Win32 context menu. I cannot find this code now.
I currently work on a libplacebo GUI, the necessary code is done, which means I can now define the GUI in INI format.
Support for nested lists like tracks/chapters/... are added for the contextmenu plugin now. The menu syntax is documented in the project README.
I've tagged a dev build for anynoe who want to try: https://github.com/tsl0922/mpv-plugin/releases/tag/dev
What are the mpv version requirements to be able to use the menu plugin ? Does it only work with mpv x64 v3 Shinchiro v0.37 ?
As mentionned in the readme, you now need to add a keybinding for the menu to show up, ex, input.conf: MBTN_RIGHT script-message-to menu show
Maybe better to rename it to mpv-menu-plugin
or if you want to do more mpv-gui-plugin
.
Does it only work with mpv x64 v3 Shinchiro v0.37 ?
the cplugins
support for windows was added in 0.37.0
.
shinchiro build is not a requirement, but the the cplugins
feature must be enabled when compile mpv.
I have updated the project README for mpv requirement.
Maybe better to rename it to mpv-menu-plugin
done
Also if it doesn't end-up overly complicated and would be customizable we could even consider upstreaming it to core mpv.
@kasper93 now the code is over 500 lines, most of them are handing property change and menu update. so if we are going to upstream this feature, I would recommend moving the menu update logic to a scriptable language:
then we can create a lua plugin that can load mpvnet or uosc style menu definitions from input.conf
, or just create any custom menu items the user wants with code.
BTW: we can extend the support for this menu definition property to any other platforms later too (my plugin is windows only).
You can now use the Debug tool from ImPlay on mpv as a cplugin:
Request for a simple modern seekbar mpv should provide an option for a simple clean hidable seekbar (nice looking, usable in a small window, some configuration options, no extra features) and neither osd-bar nor OSC can currently achieve this. I haven't seen it done in user scripts either. Some OSC replacement can provide a modern seekbar, but they tend to be bloated and broken at ex: 3000 lines of lua code.
https://github.com/mpv-player/mpv/issues/5500#issuecomment-1680804458 Many have built a frontend, with an own main window implementation, which has the huge disadvantage of loosing all the rich cross-platform window functionality mpv already has.
I agree, it seems too much work to build frontend for every platform, especially because mpv already works on many platforms, so it feels unnecessary. Most devs nowadays use Electron and Qt for cross-platform apps (that work on Windows, Linux and macOS) but both doesn't feel very nice and people would switch to another app once it's available. (With VS Code being the only major exception.)
So the extension approach seems better. So considering this, is anyone aware of some kind of Lua-widgets-for-mpv effort (or JavaScript)?
I've looked into existing Lua user scripts with a lot of GUI elements and found:
This doesn't look very reusable. If someone wants to re-create similar UI, they would need to just copy it and heavily modify all over the place.
This looks better, I had something like that in mind regarding "Lua widgets". But again, not sure how reusable those Lua modules are.
Does anybody know similar projects?
Also if it doesn't end-up overly complicated and would be customizable we could even consider upstreaming it to core mpv.
@kasper93 now the code is over 500 lines, most of them are handing property change and menu update. so if we are going to upstream this feature, I would recommend moving the menu update logic to a scriptable language:
- mpv: watch the menu definition from a property, create menu on the fly
- lua: a user may set the property to create/update menu definition
then we can create a lua plugin that can load mpvnet or uosc style menu definitions from
input.conf
, or just create any custom menu items the user wants with code.BTW: we can extend the support for this menu definition property to any other platforms later too (my plugin is windows only).
It is implemented as v2 version now, The core C code that render menu from mpv user property is about 150
lines (excluding the menu syntax parsing logic, can be move to lua later).
On windows (win32 native) c-plugins seems to be the right approach for GUI elements.
Open File Dialog + copy/paste strings to Clipboard have just been added to mpv-menu-plugin in latest actions builds: https://github.com/tsl0922/mpv-menu-plugin/commit/f396ed100e81e53ee3e550bd8258a5bfbd9826da
tsl0922: can you provide a build of your plugin ?
You can download from the Actions Artifacts. This plugin is still in ealy development, once the basic functionality is implemented, I will publish a Release soon. (currently missing features: open dialog, nested list like audio tracks)
With the 2.2.0 release, the open dialog and clipboard support was added now, and all the features provided by mpv-menu-plugin are Scriptable (You can modify menu with script, or even update menu state in input.conf
with lua expression).
You should give it a try, if you want better native gui experience for vanilla mpv on Windows.
[!TIP] Why do you add dialog / clipboard support again? There're scripts like mpv-open-file-dialog / mpv-clipboard already!
These scripts are both using PowerShell to implement features on Windows, There may be
1s
or above cold start delay on the first time. Another feature that is not supported by the PowerShellGet-Clipboard
is https://github.com/tsl0922/mpv-menu-plugin/issues/41.
https://github.com/mpv-player/mpv/issues/5500#issuecomment-1884111719
So considering this, is anyone aware of some kind of Lua-widgets-for-mpv effort (or JavaScript)?
@ahaoboy just implemented exactly that in mpv-easy. Amazing!
I just found this uosc UI (sorry if it was already mentioned before) It looks very good in the demo, especially menus in the center. I think something like this would be nice to have as official GUI, maybe disabled by default, but easly activated from the config (maybe shortcut?) or some button from the current GUI.
I just found this uosc UI (sorry if it was already mentioned before) It looks very good in the demo, especially menus in the center.
UOSC is indeed the most comprehensive functionality in Lua scripts. Inspired by it, I have implemented a toolkit mpv-easy using TS and React, which also supports right-click menus and playlist. Although the project is still in its early stages, I believe this approach can bring new ideas to MPV scripts.
While most mpv developers (including myself) have no interest in developing a GUI, it could be a good idea to make one of the existing GUIs "official". It would be part of the mpv-player github organization. It would receive special attention both by users and mpv core developers. The core would not need to pretend being a GUI as much as it needs now. Users prefer something more GUI-like could be redirected to it. If the core changes, the GUI could get some sort of preferential treatment to make sure it works well with it.
I don't know which existing project would be suited for that, or if anyone wants to try starting one. To make sense as an official GUI, I'd say there are the following conditions on the GUI project:
portable (Linux/Windows/OSX)A list of currently known GUI frontends is here: https://github.com/mpv-player/mpv/wiki/Applications-using-mpv#gui-frontends
Any comments on whether this is a good or bad idea, any project nominations, any comments by the GUI developers?