bk138 / gromit-mpx

Gromit-MPX is an on-screen annotation tool that works with any Unix desktop environment under X11 as well as Wayland.
GNU General Public License v2.0
989 stars 83 forks source link

gromit-mpx not selectable as XCOMPOSITE source in OBS Studio #117

Open Llammissar opened 3 years ago

Llammissar commented 3 years ago

Is your feature request related to a problem? Please describe. I want to try using gromit to do telestration for my streams, but OBS studio's Xcomposite capture plugin doesn't detect the annotation window. Since our Twitter discussion, I did some digging into the OBS source, and I'm still not sure whose bug it really ought to be (hence filing it as an FR), but here's what I have for now:

This appears to be the function OBS uses to find all the windows it can capture: https://github.com/obsproject/obs-studio/blob/master/plugins/linux-capture/xcompcap-helper.cpp#L96

The important X11 details seem to be that it depends on Extended Window Manager Hints and that the window is in the _NET_CLIENT_LIST. I won't pretend to understand the GTK/GDK end of things, but given the scope of that list, my immediate question is if gromit doesn't get parented to the display's root window?

Describe the solution you'd like At the least, I'd like for OBS to be able to detect and capture the gromit window so I can crop/align it onto my stream preview and composite them together.

Spitballing, a potentially-even-better solution (from my perspective, that is) would be if I could use "windowed gromit" so it only works in a particular window or region. Maybe even go the TransparentPaint route and put it in a WM-managed window that can be resized on the fly... that's probably way more work than is worth for a niche feature, admittedly

Describe alternatives you've considered Currently, I get this functionality from dewdle, but it's an ugly hack involving nodejs, a browser, painstaking window alignment, and forcing my WM to render the window translucent so I can sort of see what I'm doing. The "nice" solution would put me out about $1000 USD for the NDI software, encoder, and windows machine to run it. Windows users can reach for TransparentPaint, but it's three years unmaintained and also WPF so I couldn't get it running in Wine. I am still considering attempting to write a native telestrator plugin for OBS.

bk138 commented 3 years ago

Hi @Wyatts, thanks for reporting here. Can you provide me with a step-by-step description of a simple setup so I can repro?

Is it simply: installing OBS and trying to capture Gromit-MPX annotations? IIRC from twitter it's a bit more complicated...

Just tried OBS:

bk138 commented 3 years ago

75 might be related...

Llammissar commented 3 years ago

Yeah, that's almost my repro. The distinction is when I add an Xcomposite source, I don't even see gromit in the dropdown; it sounds like you do?

bk138 commented 3 years ago

Yeah, that's almost my repro. The distinction is when I add an Xcomposite source, I don't even see gromit in the dropdown; it sounds like you do?

Me neither, and that's very likely due to https://github.com/bk138/gromit-mpx/blob/master/src/main.c#L1222

yassir-a-p commented 3 years ago

Hi, I just discovered Gromit MPX, it's really great. Though, I also searched for annotation tool because I want to use it in OBS to be used as separate source, not in whole-screen capture. Hope this issue can be solved soon.

flaviobarros commented 3 years ago

Any news?

veroarriola commented 2 years ago

Hi. I just had the same issue.

Pistos commented 11 months ago

+1; please implement, if possible.

nasafix-nasser commented 6 months ago

Hi, I just have the same issue! Any news :(