maoiscat / mpv-osc-framework

a mpv osc framework to help build your custom osc
51 stars 2 forks source link

The way the logo is drawn conflicts with "--osd-back-color" #7

Closed jiangzhenjerry closed 11 months ago

jiangzhenjerry commented 11 months ago

I wanted to add some background colors to OSD so that the texts are easier to see under white/light videos. mpv does have a setting --osd-back-color to do so. However, since your expansion.lua draws the mpv logo using OSD too (3 circles + 1 triangle), there then will be 3+1=4 overlapping OSD background boxes. Is there a way to fix it, for example, by ignoring --osd-back-color when you draw the logo?

Note: I discovered this issue in mpv-osc-modern but figured I should probably report it here, hoping you may be more active here.

Steps to reproduce:

  1. Apply expansion.lua, main.lua, oscf.lua in this repo;
  2. Set a random color for OSD background, for example: mpv --osd-back-color=1/0/0/0.5
  3. You should be able to see the following:
sshot-1
maoiscat commented 11 months ago

supposing you are using oscf ver 1.4

in oscf.lua line 191, there should be

alpha = {0, 0, 0, 0},

now change it to

alpha = {0, 0, 0, 255},

please try if it works

jiangzhenjerry commented 11 months ago

now change it to

alpha = {0, 0, 0, 255},

please try if it works

Nope, it doesn't work...

maoiscat commented 11 months ago

strang that it works for me

by the way, mpv-osc-modern is not built on oscf, so which osc are you using actually?

---- Replied Message ---- | From | @.> | | Date | 11/26/2023 19:47 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [maoiscat/mpv-osc-framework] The way the logo is drawn conflicts with "--osd-back-color" (Issue #7) |

now change it to

alpha = {0, 0, 0, 255},

please try if it works

Nope, it doesn't work...

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

jiangzhenjerry commented 11 months ago

Sorry for the confusion. I tested it on oscf, not mpv-osc-modern. I do prefer to use mpv-osc-modern on a daily basis, so if you can fix it there too, that would be wonderful for me.

For the purpose of testing, I used a vanilla mpv (that is, only mpv.exe and necessary files from oscf, but nothing else). The folder structure for testing looks like this:

/
├── mpv.exe
└── portable_config
    └── scripts
        └── demo
            ├── expansion.lua
            ├── main.lua
            └── oscf.lua

I applied the suggested change of alpha but no effect so far.

maoiscat commented 11 months ago

good work.

it seems that by default the back color style of the osc is disabled, and this osd-back-color option enables it.

I have uploaded new codes to fix it, and you can download and try now.

anyway, mpv-osc-modern is based on the built-in osc.lua of mpv, which is not well formed (in my opinion), and I have decided not to maintain it any more.

or you can update the logo codes by yourself. just copy and paste the "ass:append" lines

jiangzhenjerry commented 11 months ago

Thank you so much! I was able to fix modern.lua based on your instructions.

modern.lua provides some functionalities that I cannot live without that unfortunately main.lua doesn't have yet. I'll have to stick with modern.lua until the day I'm able to write my own lua scripts.

Your timely fix is appreciated. Closing the issue now...