Skip to content
This repository has been archived by the owner on Aug 3, 2019. It is now read-only.

Evaluate using GStreamer for Xorg capture #118

Open
ao2 opened this issue Jan 16, 2019 · 1 comment
Open

Evaluate using GStreamer for Xorg capture #118

ao2 opened this issue Jan 16, 2019 · 1 comment

Comments

@ao2
Copy link

ao2 commented Jan 16, 2019

Hi, this is just an idea, feel free to close if it's not going to happen.

Using GStreamer instead of ffmpeg for capturing an Xorg screen can help sharing more code between the Xorg and Wayland back-end in the long run.

Let me explain what I mean.

A new way to capture a Wayland screen is to use org.gnome.Mutter.ScreenCast instead of org.gnome.Shell.Screencast, the former makes it possible to use a full GStreamer pipeline (using pipewiresrc) instead of just a partial pipeline for the encoding part as done now, see https://gitlab.gnome.org/snippets/15 (org.gnome.Shell.Screencast hardcodes the source and the sink).

Capturing Xorg with GStreamer can be done using the ximagesrc element (here is an example: https://git.ao2.it/experiments/gstreamer.git/blob/HEAD:/shell/gst-screencast.sh).

So by using GStreamer for every back-end it would be possible to share most of the pipeline and only change where the screen is coming from:

  • ximagesrc in case of Xorg;
  • pipewiresrc + some dbus code to get the screen path in case of Wayland;
  • v4lsrc for capturing a webcam, as requested in Record from webcam? #34.

In all cases the sound can be taken from a GStreamer source too (e.g. pulsesrc) and muxed live instead of using the current post-processing approach.

In principle using this design could also make it easier to change the sink: one could stream to the network instead of saving to a file.

@mhsabbagh
Copy link
Owner

Thank you, I'll definitely take a look at this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants