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

record window with mouse click #1145

Closed
oskude opened this issue Apr 14, 2021 · 9 comments
Closed

record window with mouse click #1145

oskude opened this issue Apr 14, 2021 · 9 comments

Comments

@oskude
Copy link

oskude commented Apr 14, 2021

how do we record a video of a wayland/wayfire window with a single (not mouse moving) click?

fwiw, on x11/anything i use xwininfo to get a windows pos/size (under the click) and feed it to ffmpeg

@ammen99
Copy link
Member

ammen99 commented Apr 14, 2021

This is not possible at the moment. Even recording individual windows is not possible.

@ammen99
Copy link
Member

ammen99 commented Apr 14, 2021

By not possible I mean nobody has implemented anything similar, not that you cannot make a plugin to do exactly this.

@oskude
Copy link
Author

oskude commented Apr 14, 2021

not that you cannot make a plugin to do exactly this

hmm, very tempting :D

i just tried wf-recorder -g "$(slurp)" and it seems to do most of the job, just need a way to select a window (with a single non-moving mouse click).

for me, the grand guestion is how/where would the best (for all) place be to implement this?

  • should slurp be able to get window pos/size with click?
  • should wf-recorder be able to get window pos/size with click?

(on my web adventures i found emersion/slurp#16 (comment) and cause neither of those apps do it, i guess there is no wayland protocol (yet)?)

but in any case, i definetly think that every wayland compositor should not have to implement their own video recording...

and for a quick i-want-it-now solution, a way to get a wayfire window pos/size with a click, and feed it to wf-recorder, should be possible/simple with a wayfire plugin?

ps. todo: how/can obs select wayland (wayfire) window as source?

@ammen99
Copy link
Member

ammen99 commented Apr 14, 2021

@oskude In case the window is always at the top of the window stack (e.g always-on-top or simply always focused), yes, you could try selecting the geometry of the window. Currently, the dbus plugin here might have this information. However, I am not the author and neither am I using it so @damianatorrpm @soreau might know a bit more. I only know that wf-prop is a tool to click on a view to get its properties, should be close to what you need :)

EDIT: the plugin is actually a subproject of the linked repo, in case you can't find it otherwise ...

@soreau
Copy link
Member

soreau commented Apr 14, 2021

By not possible I mean nobody has implemented anything similar, not that you cannot make a plugin to do exactly this.

Right, this should be relatively easy to do in a wayfire plugin where you have access to the surface textures. You should be able to render it even if it is occluded by other surfaces.

@ammen99 how would minimized surfaces work, if you use the texture, is it a still image or does the client render normally or is it not to be rendered?

@ammen99
Copy link
Member

ammen99 commented Apr 14, 2021

By not possible I mean nobody has implemented anything similar, not that you cannot make a plugin to do exactly this.

Right, this should be relatively easy to do in a wayfire plugin where you have access to the surface textures. You should be able to render it even if it is occluded by other surfaces.

@ammen99 how would minimized surfaces work, if you use the texture, is it a still image or does the client render normally or is it not to be rendered?

The compositor has the textures for minimized surfaces too (and this should make zero difference for plugins). But, if their use-case is that the captured window is always on top, going the wf-recorder + dbus route would be much much simpler to implement right now.

EDIT: misunderstood the question, it would normally be a still image but a plugin can just send additional frame events to the client so that it is dynamically updated.

@ammen99
Copy link
Member

ammen99 commented Apr 14, 2021

for me, the grand guestion is how/where would the best (for all) place be to implement this?

Now, this is the real question :) I would say that the best place is xdg-desktop-portal. It is the only truly cross-compositor option for capturing the screen/window contents (wf-recorder uses the wlr-screencopy protocol). The xdg-desktop-portal-wlr implementation is what needs to be extended with the option of recording individual surfaces. See emersion/xdg-desktop-portal-wlr#107

@soreau
Copy link
Member

soreau commented Apr 15, 2021

Here is a plugin to do what I had in mind.

EDIT: 'View Shot' plugin has been merged.

@ammen99
Copy link
Member

ammen99 commented Mar 8, 2024

Closing since this is a general issue with the Wayland ecosystem (see for example emersion/xdg-desktop-portal-wlr#107)

@ammen99 ammen99 closed this as completed Mar 8, 2024
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

3 participants