Skip to content

Conversation

@MAlba124
Copy link
Contributor

@MAlba124 MAlba124 commented Oct 27, 2024

This PR implements basic x11 window and display capture. The performance could be better, but it shouldn't be hard to change the image grabbing routines to utilize xshm where it's supported.

@MAlba124 MAlba124 marked this pull request as ready for review October 30, 2024 12:49
@hunnywar
Copy link

@Brendonovich @MAlba124
Any update
I can help in testing of this PR if required

@Brendonovich
Copy link
Contributor

Testing would be appreciated, im going to rent a Linux machine to test these myself too.

@MAlba124 MAlba124 closed this May 8, 2025
@MAlba124 MAlba124 deleted the x11-backend branch May 8, 2025 09:40
@mgsloan
Copy link

mgsloan commented Oct 2, 2025

FWIW Zed has been using this code for at least half a year now for x11 screenshare - https://github.com/zed-industries/scap

@MAlba124
Copy link
Contributor Author

MAlba124 commented Oct 2, 2025

I don't consider this to be of acceptable quality for any use case.

@mgsloan
Copy link

mgsloan commented Oct 2, 2025

@MAlba124 Good to know! Due to not using xshm? It's been fine for me and haven't heard any complaints. My machine is quite good though, so easy to not notice inefficiencies. Instead the main issue for linux screenshare is that we haven't gotten wayland support working via scap - zed-industries/zed#28754

@MAlba124
Copy link
Contributor Author

MAlba124 commented Oct 2, 2025

Not using xshm is one reason, another is that it's easy to get it to crash. Scap is also inherently unperformant, i.e. no frame pooling, no way of getting frames as GPU textures. As for wayland, I was able to use the current implementation on my system on sway, gnome, plasma so not sure why it's not working for yall. I know of some compositors that has a flawed implementation where the developers only test it with clients that negotiate DMA buffers, scap doesn't support that so it would break for us. I couldn't be bothered keeping things up to date so I switched to using native gstreamer elements for my projects.

Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 13, 2025
This replaces scap, which aims to be cross platform but was only
used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 13, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 13, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 13, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 13, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 13, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 17, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 17, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 17, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 17, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 17, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 17, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 17, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 17, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 18, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 18, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 18, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 18, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 18, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 18, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 18, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 18, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 18, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 18, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
Be-ing added a commit to Be-ing/zed that referenced this pull request Nov 18, 2025
This adds support for screen sharing on Wayland (fixes zed-industries#28754).

libwebrtc replaces scap, which aims to be cross platform but was
only used on Windows and X11. The X11 support relied on an out-of-tree
branch on which the original author closed their own pull request
(CapSoftware/scap#124). This also replaces
Zed's platform-specific code on macOS. Switching to a single
cross platform library simplifies the code by removing the need
for Zed to have its own traits for cross platform abstraction.
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

Successfully merging this pull request may close these issues.

4 participants