3 This is GStreamer, a framework for streaming media.
9 https://gstreamer.freedesktop.org
11 Our documentation, including tutorials, API reference and FAQ can be found at
13 https://gstreamer.freedesktop.org/documentation/
15 You can subscribe to our mailing lists:
17 https://lists.freedesktop.org/mailman/listinfo/gstreamer-announce
19 https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
21 We track bugs, feature requests and merge requests (patches) in GitLab at
23 https://gitlab.freedesktop.org/gstreamer/
25 You can join us on IRC - #gstreamer on irc.freenode.org
27 This repository contains all official modules supported by the GStreamer
28 community which can be found in the `subprojects/` directory.
32 ### Install git and python 3.5+
34 If you're on Linux, you probably already have these. On macOS, you can use the
35 [official Python installer](https://www.python.org/downloads/mac-osx/).
37 You can find [instructions for Windows below](#windows-prerequisites-setup).
39 ### Install meson and ninja
41 Meson 0.52 or newer is required.
43 For cross-compilation Meson 0.54 or newer is required.
45 On Linux and macOS you can get meson through your package manager or using:
47 $ pip3 install --user meson
49 This will install meson into `~/.local/bin` which may or may not be included
50 automatically in your PATH by default.
52 You should get `ninja` using your package manager or download the [official
53 release](https://github.com/ninja-build/ninja/releases) and put the `ninja`
56 You can find [instructions for Windows below](#windows-prerequisites-setup).
58 ### Build GStreamer and its modules
60 You can get all GStreamer built running:
67 This will automatically create the `build` directory and build everything
70 NOTE: On Windows, you *must* run this from [inside the Visual Studio command
71 prompt](#running-meson-on-windows) of the appropriate architecture and version.
73 ### External dependencies
75 All mandatory dependencies of GStreamer are included as [meson subprojects](https://mesonbuild.com/Subprojects.html):
76 libintl, zlib, libffi, glib. Some optional dependencies are also included as
77 subprojects, such as ffmpeg, x264, json-glib, graphene, openh264, orc, etc.
79 Mandatory dependencies will be automatically built if meson cannot find them on
80 your system using pkg-config. The same is true for optional dependencies that
81 are included as subprojects. You can find a full list by looking at the
82 `subprojects` directory.
84 Plugins that need optional dependencies that aren't included can only be built
85 if they are provided by the system. Instructions on how to build some common
86 ones such as Qt5/QML are listed below. If you do not know how to provide an
87 optional dependency needed by a plugin, you should use [Cerbero](https://gitlab.freedesktop.org/gstreamer/cerbero/#description)
88 which handles this for you automatically.
90 Plugins will be automatically enabled if possible, but you can ensure that
91 a particular plugin (especially if it has external dependencies) is built by
92 enabling the gstreamer repository that ships it and the plugin inside it. For
93 example, to enable the Qt5 plugin in the gst-plugins-good repository, you need
94 to run meson as follows:
97 meson -Dgood=enabled -Dgst-plugins-good:qt5=enabled builddir
100 This will cause Meson to error out if the plugin could not be enabled. You can
101 also flip the default and disable all plugins except those explicitly enabled
105 meson -Dauto_features=disabled -Dgstreamer:tools=enabled -Dbad=enabled -Dgst-plugins-bad:openh264=enabled
108 This will disable all optional features and then enable the `openh264` plugin
109 and the tools that ship with the core gstreamer repository: `gst-inspect-1.0`,
110 `gst-launch-1.0`, etc. As usual, you can change these values on a builddir that
111 has already been setup with `meson configure -Doption=value`.
113 ### Building the Qt5 QML plugin
115 If `qmake` is not in `PATH` and pkgconfig files are not available, you can
116 point the `QMAKE` env var to the Qt5 installation of your choosing before
117 running `meson` as shown above.
119 The plugin will be automatically enabled if possible, but you can ensure that
120 it is built by passing `-Dgood=enabled -Dgst-plugins-good:qt5=enabled` to `meson`.
122 ### Building the Intel MSDK plugin
124 On Linux, you need to have development files for `libmfx` installed. On
125 Windows, if you have the [Intel Media SDK](https://software.intel.com/en-us/media-sdk),
126 it will set the `INTELMEDIASDKROOT` environment variable, which will be used by
127 the build files to find `libmfx`.
129 The plugin will be automatically enabled if possible, but you can ensure it by
130 passing `-Dbad=enabled -Dgst-plugins-bad:msdk=enabled` to `meson`.
134 Since *1.18.0* when doing a static build using `--default-library=static`, a
135 shared library `gstreamer-full-1.0` will be produced and includes all enabled
136 GStreamer plugins and libraries. A list of libraries that needs to be exposed in
137 `gstreamer-full-1.0` ABI can be set using `gst-full-libraries` option. glib-2.0,
138 gobject-2.0 and gstreamer-1.0 are always included.
141 meson --default-library=static -Dgst-full-libraries=app,video builddir
144 GStreamer *1.18* requires applications using gstreamer-full-1.0 to initialize
145 static plugins by calling `gst_init_static_plugins()` after `gst_init()`. That
146 function is defined in `gst/gstinitstaticplugins.h` header file.
148 Since *1.20.0* `gst_init_static_plugins()` is called automatically by
149 `gst_init()` and applications must not call it manually any more. The header
150 file has been removed from public API.
152 One can use the `gst-full-version-script` option to pass a
153 [version script](https://www.gnu.org/software/gnulib/manual/html_node/LD-Version-Scripts.html)
154 to the linker. This can be used to control the exact symbols that are exported by
155 the gstreamer-full library, allowing the linker to garbage collect unused code
156 and so reduce the total library size. A default script `gstreamer-full-default.map`
157 declares only glib/gstreamer symbols as public.
159 One can use the `gst-full-plugins` option to pass a list of plugins to be registered
160 in the gstreamer-full library. The default value is '*' which means that all the plugins selected
161 during the build process will be registered statically. An empty value will prevent any plugins to
164 One can select a specific set of features with `gst-full-elements`, `gst-full-typefind-functions`, `gst-full-device-providers` or `gst-full-dynamic-types` to select specific feature from a plugin.
165 When a feature has been listed in one of those options, the other features from its plugin will no longer be automatically included, even if the plugin is listed in `gst-full-plugins`.
167 The user must insure that all selected plugins and features (element, typefind, etc.) have been
168 enabled during the build configuration.
170 To register features, the syntax is the following:
171 plugins are separated by ';' and features from a plugin starts after ':' and are ',' separated.
174 * `-Dgst-full-plugins=coreelements;playback;typefindfunctions;alsa;pbtypes`: enable only `coreelements`, `playback`, `typefindfunctions`, `alsa`, `pbtypes` plugins.
175 * `-Dgst-full-elements=coreelements:filesrc,fakesink,identity;alsa:alsasrc`: enable only `filesrc`, `identity` and `fakesink` elements from `coreelements` and `alsasrc` element from `alsa` plugin.
176 * `-Dgst-full-typefind-functions=typefindfunctions:wav,flv`: enable only typefind func `wav` and `flv` from `typefindfunctions`
177 * `-Dgst-full-device-providers=alsa:alsadeviceprovider`: enable `alsadeviceprovider` from `alsa`.
178 * `-Dgst-full-dynamic-types=pbtypes:video_multiview_flagset`: enable `video_multiview_flagset` from `pbtypes
180 All features from the `playback` plugin will be enabled and the other plugins will be restricted to the specific features requested.
182 All the selected features will be registered into a dedicated `NULL` plugin name.
184 This will cause the features/plugins that are not registered to not be included in the final gstreamer-full library.
186 This is an experimental feature, backward uncompatible changes could still be
189 # Development environment
191 ## Development environment target
193 GStreamer also contains a special `devenv` target that lets you enter an
194 development environment where you will be able to work on GStreamer
195 easily. You can get into that environment running:
198 ninja -C builddir devenv
201 If your operating system handles symlinks, built modules source code will be
202 available at the root for example GStreamer core will be in
203 `gstreamer/`. Otherwise they will be present in `subprojects/`. You can simply
204 hack in there and to rebuild you just need to rerun `ninja -C builddir`.
206 NOTE: In the development environment, a fully usable prefix is also configured
207 in `gstreamer/prefix` where you can install any extra dependency/project.
209 An external script can be run in development environment with:
212 ./gst-env.py external_script.sh
215 ## Custom subprojects
217 We also added a meson option, `custom_subprojects`, that allows the user
218 to provide a comma-separated list of subprojects that should be built
219 alongside the default ones.
225 git clone my_subproject
227 rm -rf * && meson .. -Dcustom_subprojects=my_subproject
233 You can easily run the test of all the components:
239 To list all available tests:
242 meson test -C builddir --list
245 To run all the tests of a specific component:
248 meson test -C builddir --suite gst-plugins-base
251 Or to run a specific test file:
254 meson test -C builddir --suite gstreamer gst_gstbuffer
257 Run a specific test from a specific test file:
260 GST_CHECKS=test_subbuffer meson test -C builddir --suite gstreamer gst_gstbuffer
263 ## Optional Installation
265 You can also install everything that is built into a predetermined prefix like
269 meson --prefix=/path/to/install/prefix builddir
271 meson install -C builddir
274 Note that the installed files have `RPATH` stripped, so you will need to set
275 `LD_LIBRARY_PATH`, `DYLD_LIBRARY_PATH`, or `PATH` as appropriate for your
276 platform for things to work.
279 ## Add information about GStreamer development environment in your prompt line
283 We automatically handle `bash` and set `$PS1` accordingly.
285 If the automatic `$PS1` override is not desired (maybe you have a fancy custom
286 prompt), set the `$GST_BUILD_DISABLE_PS1_OVERRIDE` environment variable to
287 `TRUE` and use `$GST_ENV` when setting the custom prompt, for example with a
288 snippet like the following:
292 if [[ -n "${GST_ENV-}" ]];
294 PS1+="[ ${GST_ENV} ]"
301 In your powerline theme configuration file (by default in
302 `{POWERLINE INSTALLATION DIR}/config_files/themes/shell/default.json`)
303 you should add a new environment segment as follow:
307 "function": "powerline.segments.common.env.environment",
308 "args": { "variable": "GST_ENV" },
313 ## Windows Prerequisites Setup
315 On Windows, some of the components may require special care.
319 Use the [Git for Windows](https://gitforwindows.org/) installer. It will
320 install a `bash` prompt with basic shell utils and up-to-date git binaries.
322 During installation, when prompted about `PATH`, you should select the
325 ![Select "Git from the command line and also from 3rd-party software"](/data/images/git-installer-PATH.png)
327 ### Python 3.5+ on Windows
329 Use the [official Python installer](https://www.python.org/downloads/windows/).
330 You must ensure that Python is installed into `PATH`:
332 ![Enable Add Python to PATH, then click Customize Installation](/data/images/py-installer-page1.png)
334 You may also want to customize the installation and install it into
335 a system-wide location such as `C:\PythonXY`, but this is not required.
339 The easiest way to install Ninja on Windows is with `pip3`, which will download
340 the compiled binary and place it into the `Scripts` directory inside your
347 You can also download the [official release](https://github.com/ninja-build/ninja/releases)
348 and place it into `PATH`.
352 **IMPORTANT**: Do not use the Meson MSI installer since it is experimental and known to not
353 work with `gst-build`.
355 You can use `pip3` to install Meson, same as Ninja above:
361 Note that Meson is written entirely in Python, so you can also run it as-is
362 from the [git repository](https://github.com/mesonbuild/meson/) if you want to
363 use the latest master branch for some reason.
365 **ARM64 native only**: You might need
366 [native upstream ARM64 support fix](https://github.com/mesonbuild/meson/pull/7432)
367 which is expected to be a part of Meson 0.55.1.
368 If your Meson package version which was installed via `pip3` is lower than 0.55.1,
369 then you need to use [the latest master branch](https://github.com/mesonbuild/meson/).
371 ### Running Meson on Windows
373 At present, to build with Visual Studio, you need to run Meson from inside the
374 VS 2019 command prompt. Press `Start`, and search for `VS 2019`, and click on
375 `x64 Native Tools Command Prompt for VS 2019`, or a prompt named similar to
378 ![x64 Native Tools Command Prompt for VS 2019](/data/images/vs-2019-dev-prompt.png)
380 **ARM64 native only**: Since Visual Studio might not install dedicated command
381 prompt for native ARM64 build, you might need to run `vcvarsx86_arm64.bat` on CMD.
382 Please refer to [this document](https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019#developer_command_file_locations)
384 ### Setup a mingw/wine based development environment on linux
386 #### Install wine and mingw
391 sudo dnf install mingw64-gcc mingw64-gcc-c++ mingw64-pkg-config mingw64-winpthreads wine
394 FIXME: Figure out what needs to be installed on other distros
396 #### Get meson from git
398 This simplifies the process and allows us to use the cross files
399 defined in meson itself.
402 git clone https://github.com/mesonbuild/meson.git
405 #### Build and install
408 BUILDDIR=$PWD/winebuild/
409 export WINEPREFIX=$BUILDDIR/wine-prefix/ && mkdir -p $WINEPREFIX
410 # Setting the prefix is mandatory as it is used to setup symlinks during uninstalled development
411 meson/meson.py $BUILDDIR --cross-file meson/cross/linux-mingw-w64-64bit.txt -Dgst-plugins-bad:vulkan=disabled -Dorc:gtk_doc=disabled --prefix=$BUILDDIR/wininstall/ -Djson-glib:gtk_doc=disabled
412 meson/meson.py install -C $BUILDDIR/
415 > __NOTE__: You should use `meson install -C $BUILDDIR` each time you make a change
416 > instead of the usual `ninja -C build` as the environment is not uninstalled.
418 #### The development environment
420 You can get into the development environment the usual way:
423 ninja -C $BUILDDIR/ devenv
426 Alternatively, if you'd rather not start a shell in your workflow, you
427 can mutate the current environment into a suitable state like so:
430 gst-env.py --only-environment
433 This will print output suitable for an sh-compatible `eval` function,
434 just like `ssh-agent -s`.
436 After setting up [binfmt] to use wine for windows binaries,
437 you can run GStreamer tools under wine by running:
440 gst-launch-1.0.exe videotestsrc ! glimagesink
443 [binfmt]: http://man7.org/linux/man-pages/man5/binfmt.d.5.html