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 responses to “Screencasting with OBS Studio on Wayland”

  1. “This plugin is already available in the Flathub version of OBS Studio.”
    Not on my version of OBS (from flathub)…

  2. Wow really great feaneron! One reason less for me to use X now 🙂 genius

  3. 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.

    1. I plan to propose this as an upstream plugin, but only after working on some bugs and bottlenecks in Mutter.

  4. […] é possível gravar a tela normalmente com OBS pelo Wayland na seção Gnome, através de um plugin incluso em uma versão Flatpack do mesmo, pelo desenvolvedor brasileiro do projeto Gnome  o brasileiro […]

  5. […] Wayland altında OB Studio ile bir eklenti kullanarak kaydetmek (ve yayınlamak) mümkündür gibi atıl-xdg-portal eklenti (GNOME ve KDE üzerinde hem Wayland hem de X11 ile, belki de başkalarında da çalışır) […]

  6. the application being screencasted got lagg

  7. […] now, I’ve done a quick recording using OBS Studio, and the obs-xdg-portal plugin that I wrote about a few months […]

  8. […] el screencasting. La versión Flatpak de OBS Studio es oficial e incluye por defecto el plugin obs-xdg-portal, que permite grabar desde una sesión de Wayland. Sin embargo, en Fedora 31 los resultados de las […]

  9. […] screencasting. La versión Flatpak de OBS Studio es oficial e incluye por defecto el plugin obs-xdg-portal, que permite grabar desde una sesión de Wayland. Sin embargo, en Fedora 31 los resultados de […]

  10. […] screencasting. La versión Flatpak de OBS Studio es oficial e incluye por defecto el plugin obs-xdg-portal, que permite grabar desde una sesión de Wayland. Sin embargo, en Fedora 31 los resultados de […]

  11. suseUser Avatar

    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

    1. suseUser Avatar

      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.

  12. […] Studio这样的插件在Wayland中录制(和广播)您的桌面。 obs-xdg-portal […]

  13. […] record (broadcast) your desktop under Wayland under OB Studio by using plug-ins such as OB Studio. obs-xdg-portal Plugins (can be used with Wayland and X11 on GNOME and KDE, and maybe with other plugins), or GNOME […]

  14. florent Avatar

    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!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.