GithubHelp home page GithubHelp logo

screen-share-sway's Introduction

Update 2023-04-29

The setup described in this guide was intended as a workaround. Since then more and more software started supporting Wayland. Screen sharing in sway works (for me) now with the following packages out-of-the-box:

  • pipewire
  • wireplumber
  • xdg-desktop-portal
  • xdg-desktop-portal-wlr

Firefox and Chromium-based browser can use xdg-desktop-portal for screen-sharing. Setting QT_QPA_PLATFORM=xcb for OBS is not needed anymore since it runs natively on wayland. OBS supports screen capturing from pipewire too.

All that makes this guide kinda obsolete.

I leave this guide here if anyone still wants to use this hacky workaround. But I strongly discourage it.

Screen Sharing with OBS Studio on Arch Linux and Sway

Please read the instructions of the listed self-built projects. They explain more than I do and may have changed.

  1. Used Software
  2. Install OBS Studio
  3. Install the v4l2loopback kernel module
  4. Install the wlrobs OBS-plugin
  5. Usage of wlrobs
  6. Versions of the used projects at the time of writing (2021-02-04)

Used Software

Install OBS Studio

OBS Studio can be downloaded from the Arch Community Repository.

pacman -S obs-studio

Install the v4l2loopback kernel module

'This module allows you to create "virtual video devices".' - from the v4l2loopback github page. Visit it for more information about it.

This is needed to feed an video output from OBS and be used as a screen or a camera by applications.

The DKMS Version is available in the Arch Community Repository. More information about DKMS can be found in the Arch Wiki.

pacman -S v4l2loopback-dkms linux-headers

sudo dkms add -m v4l2loopback -v 0.12.5
sudo dkms build -m v4l2loopback -v 0.12.5
sudo dkms install -m v4l2loopback -v 0.12.5

dkms status v4l2loopback/0.12.5

# load the module and
# create one virtual video device
modprobe v4l2loopback 

Further helpful commands:

# the ones with the highest numbers are created by v4l2loopback
ls /dev/video*

# unloads the kernel module
modprobe -r v4l2loopback

# creates 4 virtual video devices
modprobe v4l2loopback devices=4

Install the wlrobs OBS-plugin

This plugin is responsible for actually recording screens from wlroots-based compositors. It can be installed from the AUR

Usage of wlrobs

Now choose Wayland output(scpy) as new input source.

wlrobs Source.png

I had to flip the blue and red values from the source, in order to display colors correctly. This can be done in the source preferences.

wlrobs Source Preferences.png

Now you should be able to share your screen i.e. in Firefox. You can test it here.

Thank you for reading.

Versions of the used projects at the time of writing (2022-01-06)

Linux 5.15.12.arch1-1

SwayWM 1:1.6.1-2

OBS 27.1.3-3

v4l2loopback-dkms 0.12.5-1

wlrobs 1.0-1 (AUR)

screen-share-sway's People

Contributors

hw0lff avatar

Stargazers

Alberto Oporto Ames avatar Pavel Tishkov avatar Eol avatar kohane27 avatar  avatar Julio avatar  avatar msqtt avatar  avatar Binye Qi avatar x06lan avatar  avatar Alessandro Ianne avatar  avatar Miltiadis Kallianis avatar Ivan Panchishin avatar  avatar Yoni Firroloni avatar Erfan Mola avatar Marcelo Higa avatar geemili avatar Louis Pearson avatar Daniel Seemaier avatar Jonathan Ródenas López avatar Artur Linnik avatar Ethan Cheng avatar Ben Frain avatar Alexander Zizzo avatar Fabian Hinz avatar 21eleven avatar Brent Monning avatar Jeff Langston avatar  avatar David Jeansen avatar Paul Ewing avatar  avatar Frederic Masi avatar NULL avatar Nikolaos Bezirgiannis avatar John T. Prince avatar  avatar Qyriad avatar VitalyR avatar William Roe avatar Atli Arnarsson avatar

Watchers

William Roe avatar  avatar oniuR avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.