2016-05-27 02:21:04 +00:00
# Installing on Linux
2016-05-16 14:30:34 +00:00
2016-06-17 22:41:07 +00:00
## Prerequisites
2016-05-16 14:30:34 +00:00
2016-10-09 12:33:39 +00:00
GStreamer is included in all Linux distributions. We recommend using the latest version of a fast moving distribution such as Fedora, Ubuntu (non-LTS), Debian sid or OpenSuse to get a recent GStreamer release.
2016-05-16 14:30:34 +00:00
All the commands given in this section are intended to be typed in from
a terminal.
2018-11-11 15:49:19 +00:00
> ![Warning](images/icons/emoticons/warning.svg)
2017-05-29 05:12:30 +00:00
Make sure you have superuser (root) access rights to install GStreamer.
2016-05-16 14:30:34 +00:00
2016-10-09 12:33:39 +00:00
## Install GStreamer on Fedora
2016-05-16 14:30:34 +00:00
2016-10-09 12:33:39 +00:00
Run the following command:
2016-05-16 14:30:34 +00:00
2016-05-27 02:48:36 +00:00
```
2021-02-14 12:17:15 +00:00
dnf install gstreamer1-devel gstreamer1-plugins-base-tools gstreamer1-doc gstreamer1-plugins-base-devel gstreamer1-plugins-good gstreamer1-plugins-good-extras gstreamer1-plugins-ugly gstreamer1-plugins-bad-free gstreamer1-plugins-bad-free-devel gstreamer1-plugins-bad-free-extras
2016-05-16 14:30:34 +00:00
```
2017-05-29 05:12:30 +00:00
## Install GStreamer on Ubuntu or Debian
2016-05-16 14:30:34 +00:00
2016-10-09 12:33:39 +00:00
Run the following command:
2016-05-16 14:30:34 +00:00
2021-03-05 07:00:13 +00:00
`apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio`
2016-05-16 14:30:34 +00:00
2016-10-09 12:33:39 +00:00
## Building applications using GStreamer
2016-05-16 14:30:34 +00:00
The only other “development environment” that is required is
2016-10-09 12:33:39 +00:00
the `gcc` compiler and a text editor. In order to compile code that
2017-05-29 05:12:30 +00:00
requires GStreamer and uses the GStreamer core library, remember
2016-10-09 12:33:39 +00:00
to add this string to your `gcc` command:
2016-05-16 14:30:34 +00:00
2016-05-27 02:48:36 +00:00
```
2016-10-09 12:33:39 +00:00
pkg-config --cflags --libs gstreamer-1.0
2016-05-16 14:30:34 +00:00
```
If you're using other GStreamer libraries, e.g. the video library, you
2016-05-27 18:49:41 +00:00
have to add additional packages after gstreamer-1.0 in the above string
(gstreamer-video-1.0 for the video library, for example).
2016-05-16 14:30:34 +00:00
If your application is built with the help of libtool, e.g. when using
automake/autoconf as a build system, you have to run
2016-10-09 12:33:39 +00:00
the `configure` script from inside the `gst-sdk-shell` environment.
2016-05-16 14:30:34 +00:00
2016-06-17 22:41:07 +00:00
#### Getting the tutorial's source code
2016-05-16 14:30:34 +00:00
The source code for the tutorials can be copied and pasted from the
2016-10-25 20:16:42 +00:00
tutorial pages into a text file, but, for convenience, it is also available
2016-11-05 08:18:49 +00:00
in a GIT repository in the `examples/tutorials` subdirectory.
2016-05-16 14:30:34 +00:00
2016-10-09 12:33:39 +00:00
The GIT repository can be cloned with:
2016-05-16 14:30:34 +00:00
2016-05-27 02:48:36 +00:00
```
2018-08-01 04:20:27 +00:00
git clone https://gitlab.freedesktop.org/gstreamer/gst-docs
2016-05-16 14:30:34 +00:00
```
2016-06-17 22:41:07 +00:00
#### Building the tutorials
2016-05-16 14:30:34 +00:00
2016-05-27 02:48:36 +00:00
```
2016-05-27 18:49:41 +00:00
gcc basic-tutorial-1.c -o basic-tutorial-1 `pkg-config --cflags --libs gstreamer-1.0`
2016-05-16 14:30:34 +00:00
```
Using the file name of the tutorial you are interested in
2016-10-09 12:33:39 +00:00
(`basic-tutorial-1` in this example).
2016-05-16 14:30:34 +00:00
2018-11-11 15:49:19 +00:00
> ![Warning](images/icons/emoticons/warning.svg) Depending on the GStreamer libraries you need to use, you will have to add more packages to the `pkg-config` command, besides `gstreamer-1.0`
2016-10-09 12:33:39 +00:00
> At the bottom of each tutorial's source code you will find the command for that specific tutorial, including the required libraries, in the required order.
> When developing your own applications, the GStreamer documentation will tell you what library a function belongs to.
2016-05-16 14:30:34 +00:00
2016-06-17 22:41:07 +00:00
#### Running the tutorials
2016-05-16 14:30:34 +00:00
2016-10-09 12:33:39 +00:00
To run the tutorials, simply execute the desired tutorial:
2016-05-16 14:30:34 +00:00
2016-06-06 00:58:09 +00:00
``` c
2016-05-16 14:30:34 +00:00
./basic-tutorial-1
```