Screencasting over Wi‑Fi on GNOME

On GNOME we usually had no good way of using remote display devices like Chromecast, Miracast or AirPlay. VLC for example does support streaming to Chromecast, but the Miracast implementations were all not integrated well enough to be usable. Also, at least Miracast requires the use of the H264 or H265 codecs, which have been problematic due to licensing requirements.

I have been working on a gnome‑screencast application, which currently has working support for Miracast devices. It requires a current development version of NetworkManager, but should work out of the box otherwise. If you are on Fedora, you can try out gnome‑screencast by using my copr repository.

To stream to a Miracast (revision 1) device, a few things need to happen. First we need to establish a Wi‑Fi Direct connection. We also need to start an RTSP server that the sink can connect to. And finally, once the sink is connected, a GStreamer pipeline is used to fetch the screen content from mutter, encode it and send it to the Miracast sink.

For the encoding, gnome-screencast will make use of the OpenH264 and Frauenhofer FDK ACC codecs that are available on Fedora. If you have better encoders installed, then these may be used automatically.

When available, gnome‑screencast will make use of the Mutter Screencasting API which allows it to grab the screens content on Wayland. The API is still improving in mutter, and in the future it will be possible to add support to stream the cursor separately.

One major piece that was missing for Miracast devices is integrated support for Wi‑Fi Direct (a.k.a. Wi‑Fi P2P) in our platform. While this was supported in the lower parts of the stack (Kernel and wpa_supplicant), we were lacking the required bits in NetworkManager to enable the usage in GNOME. I worked on adding the required support and thanks to Thomas Haller this has now been merged into NetworkManager 1.16.

With all this in place, it is possible to implement proper support for screen-casting using Miracast in GNOME. The below video shows gnome-screencast in action streaming my laptop screen with the Blender short film “Caminandes 3: Llamigos“ playing.

If you have a Miracast compatible device, then please try out the copr repository. You can report issues on github. Also, feel free to comment here or write me a mail with your experiences.

Leave a Reply

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