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
Feature request: transparent background (not just black) #6590
Comments
Exists and is called Looks like |
apparently that does not work/implemented in linux, |
It's possible, but Mesa broke it. The mpv manpage even mentions the Mesa bug number. |
I noticed that the referenced EGL Mesa bug (67676) is now resolved. Any update on this implementation? It still does not work on my machine. |
It seems that the merge request that closed the bug was reverted and now https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2376 has to be merged. |
I can try to look at it once all affected components have made it to something I can use and install. Is there any distro which has these changes yet? (Obviously I won't go too much out of my way for this.) |
Also I think Mesa forgot to write the EGL_MESA_config_select_group specification. |
OK, after looking some, the things mentioned above were reverted in Mesa. So this still can't be fixed. Blame Mesa. |
Transparent windows on X11/EGL/native Mesa GL didn't work for various reasons. From what I remember, the current code did work with nvidia at least. Mesa has made attempts to fix this, but they never really made it in. But it turns out you can make EGL/Mesa list the EGLConfigs that use X11 RGBA visuals, and context_x11egl.c contains code that explicitly selects them if alpha is requested (see pick_xrgba_config()). The reason EGL/Mesa did not list them (and thus breaking transparency) is because we requested a EGL_ALPHA_SIZE != 0 if alpha is requested. But the transparent EGLConfigs use EGL_ALPHA_SIZE == 0. That's because EGL doesn't actually support the concept of transparent windows; the alpha size parameter is something else (memory rendering without FBOs or something, I don't care enough to look up the real reasons). This still won't work on Wayland. Every EGL backend needs platform specific code. (Good job, EGL, such an awesome platform independent standard.) Fixes: #6590
It turns out that you can circumvent the mess with another (existing mess) - it's fixed now on X11. |
Sweet, I guess I'll download the |
Any chance of making the alpha component affect |
--alpha=yes doesn't affect only transparent videos and images, but also the background. I spent time trying researching how to implement transparent backgrounds and had no idea that they already worked at least on Wayland. Background transparency will work on X11 when https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2376 is merged. It doesn't work on Windows. No idea about macOS. Either way, this paragraph already says that it only works on certain environments twice. References mpv-player#6590
--alpha=yes doesn't affect only transparent videos and images, but also the background. I spent time researching how to implement transparent backgrounds and had no idea that they already worked at least on Wayland. Background transparency will work on X11 when https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2376 is merged. It doesn't work on Windows. No idea about macOS. Either way, this paragraph already says that it only works on certain environments twice. References mpv-player#6590
--alpha=yes doesn't affect only transparent videos and images, but also the background. I spent time researching how to implement transparent backgrounds and had no idea that they already worked at least on Wayland. Background transparency will work on X11 when https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2376 is merged. It doesn't work on Windows. No idea about macOS. Either way, this paragraph already says that it only works on certain environments twice. References #6590
Transparent windows on X11/EGL/native Mesa GL didn't work for various reasons. From what I remember, the current code did work with nvidia at least. Mesa has made attempts to fix this, but they never really made it in. But it turns out you can make EGL/Mesa list the EGLConfigs that use X11 RGBA visuals, and context_x11egl.c contains code that explicitly selects them if alpha is requested (see pick_xrgba_config()). The reason EGL/Mesa did not list them (and thus breaking transparency) is because we requested a EGL_ALPHA_SIZE != 0 if alpha is requested. But the transparent EGLConfigs use EGL_ALPHA_SIZE == 0. That's because EGL doesn't actually support the concept of transparent windows; the alpha size parameter is something else (memory rendering without FBOs or something, I don't care enough to look up the real reasons). This still won't work on Wayland. Every EGL backend needs platform specific code. (Good job, EGL, such an awesome platform independent standard.) Fixes: mpv-player#6590
--alpha=yes doesn't affect only transparent videos and images, but also the background. I spent time researching how to implement transparent backgrounds and had no idea that they already worked at least on Wayland. Background transparency will work on X11 when https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2376 is merged. It doesn't work on Windows. No idea about macOS. Either way, this paragraph already says that it only works on certain environments twice. References mpv-player#6590
I'm still having issues with this on Linux with X11, playing an RGBA video with |
That's because it's still broken in Mesa. The commit that originally closed this issue may have possibly worked at the time as some weird hack, but it definitely doesn't work right now. |
There is the option to add an opacity value before the 6-digit hex number. Here is a list with all the values:
(I have found about it here.) |
that's cool @cipricus , but I think this bug is about trying to achieve full transparency of the video itself, not the subtitles. e.g. opening a .png image of a circle and the corners of the image are showing whatever is behind the window, instead of a checkerboard pattern. |
Sorry, I must have misunderstood. Too eager to share ! |
@iiiGerardoiii even though @cipricus misunderstood, a valid point was made.. Hex accepts opacity and that means it should work fine. And it does!
Also the opacity is the last two, not the first |
thanks @wick3dr0se, confirmed here |
wtf @cipricus was right all along I stand corrected. |
example situations:
.SRT
.VTT
.ASS
(allow to use window as overlay) withopaque subtitles
or any video with opacity/alpha channel (YV12+A)
(also nice if possible to make most of the window (non-OSD-GUI) click-through
The text was updated successfully, but these errors were encountered: