Screencasting with OBS Studio on Wayland

For the past few months, I’ve been doing live coding sessions on YouTube showing how GNOME development goes. Usually it’s a pair of sessions per week, one in Brazilian Portuguese so that my beloved community can enjoy GNOME in their native language; and one in English, to give other people at least a chance to follow development as well.

We are quite lucky to have OBS Studio available for screencasting and streaming, as it makes our lives a lot easier. It’s really a fantastic application. I learned about it while browsing Flathub, and it’s what actually motivated me to start streaming in the first place. However, I have to switch to X11 in order to use it, since the GNOME screencast plugin never really worked for me.

This is annoying since Mutter supports screencasting for years now, and I really want to showcase the latest and greatest while streaming. We’re still not using the appropriate APIs and methods to screencast, which doesn’t set a high standard on the community.

So I decided to get my hands dirty, bite the bullet, and fix this situation. And so was born the obs-xdg-portal plugin for OBS Studio! The plugin uses the standard ScreenCast portal, which means it should work inside and outside the Flatpak sandbox, in Wayland and X11, and on GNOME and KDE (and perhaps others?).

Selecting a monitor for screencast
Selecting a window for screencast
The screencast in action — working perfectly!

Do notice that OBS Studio itself is not yet compatible with Wayland, as this is a work in progress. In the pictures above, I’m running OBS Studio under XWayland, which really shows how powerful the platform is — it’s able to natively screencast on Wayland even on XWayland clients! If I have time, interest, motivation, and energy, perhaps the OBS Studio Wayland branch can be pushed forward.

This plugin is already available in the Flathub version of OBS Studio.

17 thoughts on “Screencasting with OBS Studio on Wayland

  1. Will you be nudging the upstream OBS devs to have it part of the mainline distribution? This is such a critical matter for the project’s future that I’m not sure why it should be confined to being a plugin.

    Like

  2. Hello, I tried to capture my screen on openSuse tumbleweed (Kernel 5.6.2-1) with GNOME3 and wayland.
    I don´t have a dedicated graphic-card, my cpu is a Intel i5-8250U.

    When using flatpack, it just shows a black screen.
    When I try choose the screen or window, the following error appears (in the shell):
    “warning: [OBS XDG] Failed to start screencast, denied or cancelled by user”

    Is there anything I could do?

    I compiled an installed the plugin, sadly also without success.

    You can find the complete log here:
    https://pastebin.com/g3trSDZY

    Like

    1. Sorry, I wanted to say, that I also compiled the plugin and installed it, for usage with the obs-version “!obs-studio-25.0.4-1.1.x86_64.rpm” from http://packman.inode.at/suse/openSUSE_Tumbleweed/Multimedia/x86_64/obs-studio-25.0.4-1.1.x86_64.rpm.

      I took some time to find out the necessary dependencies (cause they are all named different than in other distros). I finally got the plugin compiled and added to obs-studio. But as I wanted to use it, obs did only show a transparent window.

      Like

  3. no success with the flatpack version nor the one from the repos, but it works when i built from master on fedora 33.

    Small changes to the official instructions though:

    install qt5-qtbase-private-devel
    to install in a different prefix, add -DCMAKE_INSTALL_PREFIX=some/path to the cmake command
    i installed into $HOME/obs because i don’t like dirtying my tree, but then you need to configure ld.conf and stuff. but you can also export LD_LIBRARY_PATH=some/path/lib:some/path/lib64 and then ./bin/obs

    thanks for your work!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s