How to Screen Capture Using GStreamer with MacOs

Muratcan Yeldan
2 min readNov 21, 2021

What is GStreamer

GStreamer is framework for creating streaming media applications. Streamer framework makes it possible to write all types of streaming multimedia applications which handle audio or video or both.

GStreamer Tools
Obtained from gstreamer.freedesktop.org

Installing GStreamer

The easiest way to install GStreamer on your macOs is to use Homebrew. You can install GStreamer with running the following command. Open the Terminal and execute :

brew install gstreamer

You can check if you installation is complete with executing this command :

brew info gstreamer

Then you will see a screen like that :

Brew info screen for gstreamer formula
You can get path from here if you need it. Here is in my example path is “/usr/local/Cellar/gstreamer/1.18.4”

After installation of GStreamer completed you can add plugins. There is four different plugin packages available now for GStreamer. You can add this plugins to GStreamer with Homebrew. You can check available plugins by running this command :

brew search gst-plugins

You will see a screen like that :

available gst-plugins search screen
Probably you won’t see tick signs next to plugin names. This signs means this plugin already installed on your system.

You can install any plugin from this list by running this command :

brew install plugin-name

An example :

brew install gst-plugins-base

You don’t have to install all plugins from this list. You can check your requirements and install associated plugins. If you don’t sure which plugins you will use you can install all plugins from this list. If you decide you don’t need any of these plugins you uninstall it with following command :

brew uninstall plugin-name

If you don’t have Homebrew on your system you can install it with running the following command. Open the Terminal and execute :

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Live Stream Computer Screen

With GStreamer you can live stream your computer screen. Open Terminal and execute :

gst-launch-1.0 avfvideosrc capture-screen=true ! autovideosink
Live Stream of computer screen
You should get a result like this when you execute above command.

Thank you for reading my article about GStreamer. I hope it will be helpful with your projects.

--

--