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

Evaluate using GStreamer for Xorg capture #118

@ao2

Description

@ao2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions