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

Allow thumbnail script and some tweaks #45

Closed
Harze2k opened this issue Dec 12, 2020 · 6 comments
Closed

Allow thumbnail script and some tweaks #45

Harze2k opened this issue Dec 12, 2020 · 6 comments

Comments

@Harze2k
Copy link

Harze2k commented Dec 12, 2020

Hi,
love to UI, sleek and addictive to tinker with.
I see that you don't have a built in thumbnail script (and that's fine ofc!) but would it be possible to make it so that i.e https://github.com/marzzzello/mpv_thumbnail_script works in your UI? As it is now nothing shows but the thumbnail scripts works in the background and if i disable your UI the script has generated the thumbs and shows them as expected. Maybe an option in uosc.conf? Having a seekbar with thumbnail preview is really a must have for me at least.

Please add an option to not concatenate menu items (if possible). I have built a menu where i swap a lot of shaders around and i need an option to go back to default mpv settings in each sub menu. Have renamed copies of the identical shader files as of now to make it so that i get around this but and option to allow this would be golden.

Is there a way to run more then one command for one menu item? Since i have a lot of shaders for different uses, i would like to remove and append some of them when i use my #! Preset > Anime or #! Preset > Live Action. Ideally when i press my preset for Anime i would like to queue several glsl-shaders remove and a few glsl-shaders append to make it more dynamic.

Lastly, the dimming of the movie when i open up the menu, is there a way to disable that? If i swap filers, or change brightness its really hard to see the difference when the screen lights up again. It's a good looking feature but hopefully you can make it optional :)

That's all i can think of right now, awesome stuff man, am glad i stumbled across a link to your UI from r/mpv
//Martin

darsain added a commit that referenced this issue Dec 12, 2020
@darsain
Copy link
Contributor

darsain commented Dec 12, 2020

Thumbnails

There is already an issue for that #7, but to be honest I don't think I'll be working on it for uosc.

uosc right now has a codebase that evolved from a simple script that was rendering 2 rectangles, and that is not a good way to design a project. It needs a rewrite, and I don't like the idea of investing a lot of time working on big updates (like thumbnails would definitely be) for a project that needs a rewrite.

There won't be a rewrite either though :( the mpv UI rendering API extremely sucks (it's ASS tags, a subtitles engine, not meant for UI). It's very limited, and has issues like rendering at the same FPS as playing video, so low FPS videos are causing the UI to feel stuttery/lagging behind/slow, and I don't want to put a lot more time into building a UI on top of this.

If I invest a lot of time into mpv UI again, it'll probably be by creating a completely new frontend. mpv+uosc also has a high barrier of entry for an average user, so I'm pretty much spending a lot of development time for a userbase of a couple dozen people, which I also don't like. A more user friendly frontend would fix this. But this might be quite far away from now as I'm working on other projects atm.

This doesn't mean the uosc is dead. I'm still using it every day, and fixing bugs or adding small improvements is not a problem.

That being said, I didn't look into its code, but there shouldn't be a reason for the thumbnail script to not work with uosc. I suspect it stops being displayed because it detects mpv.conf osc=no setting which is required for uosc. It'd actually be orders of magnitude easier for the creator of the thumbnail script to implement support for uosc than for me to implement thumbnails. All it needs to do is add a uosc flag and use it's timeline box coordinates (easy since it spans the whole video width) for displaying thumbnails.

Option to not concatenate menu items

So if I'm following correctly here, you have a reset command that you add to multiple submenus? Wouldn't it make more sense to place it only once, somewhere higher up in the menu hierarchy?

But anyway, I changed the serialization so it only concatenates within the same menu group, it makes more sense that way anyway. This should fix your problem, right?

More than one command per menu item

It's just mpv script bindings, so you can use ; to separate commands. Example:

space        cycle pause; script-binding uosc/flash-pause-indicator

Menu dimming

Added curtain_opacity=0.5 option. Set to 0 to disable.


You can get the changes mentioned above from the dev branch: uosc.lua.

@po5
Copy link
Contributor

po5 commented Dec 12, 2020

In uosc's early days I remember hacking the gallery script to be active when hovering the timeline region of uosc.
It was pretty janky and I've probably lost the files by now but I agree this would be a much easier approach.

@Harze2k
Copy link
Author

Harze2k commented Dec 13, 2020

Ok this was amazingly fast response!
Regarding the thumbnail seek preview issue, yes i was aware that it was brought up before, just wanted to lift it up once more. The mpv.conf osc=no is required yes, but that is a setting iv always had if i remove your ui by moving the files the thumbnails pop up and works directly. So i was just hoping there was a way from your end to allow them to work with your UI rather then going to the thumbnail script creator and ask :) If its not then i'll do that, no worries!

Ill try that fix with multiple commands, seems like it should be working.

Thanx for the concatenate and menu opaque fix, that makes it a lot more user friendly!

Ty Sir for the response and quick fixes!

@po5 If you find em let us know!

@Harze2k
Copy link
Author

Harze2k commented Dec 13, 2020

Just a follow up regarding multiple commands, maybe i am doing it wrong but this doesn't work sadly:
# script-binding change-list glsl-shaders remove "~~/shaders/Anime4K_Denoise_Heavy_CNN_L_040.glsl" ; script-binding change-list glsl-shaders remove "~~/shaders/FSRCNNX_x2_8-0-4-1.glsl" #! Test > Remove multiple Shaders Test
Am i using wrong syntax or? I get:
[input] Command script-binding has trailing unused arguments: ' glsl-shaders remove "~~/shaders/FSRCNNX_x2_8-0-4-1.glsl"'.
[input] Command was defined at uosc.
I have tested several different ways and all gets the same "error"

@marzzzello
Copy link

marzzzello commented Dec 25, 2020

That being said, I didn't look into its code, but there shouldn't be a reason for the thumbnail script to not work with uosc. I suspect it stops being displayed because it detects mpv.conf osc=no setting which is required for uosc. It'd actually be orders of magnitude easier for the creator of the thumbnail script to implement support for uosc than for me to implement thumbnails. All it needs to do is add a uosc flag and use it's timeline box coordinates (easy since it spans the whole video width) for displaying thumbnails.

I don't think it's easy to implement in the thumbnail script because the thumbnail script comes with its own osc (which is mpv's original osc patched to display thumbnails)
You can see what's changed from the original osd by looking at the diff from these files:
https://raw.githubusercontent.com/mpv-player/mpv/97816bbef0f97cfda7abdbe560707481d5f68ccd/player/lua/osc.lua
https://github.com/marzzzello/mpv_thumbnail_script/releases/download/0.4.3/mpv_thumbnail_script_client_osc.lua

ref: marzzzello/mpv_thumbnail_script#1

@tomasklaen
Copy link
Owner

Closing as dupe of #7.

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

No branches or pull requests

5 participants