2 short-description: GStreamer core API reference.
7 GStreamer is a streaming media framework. It uses graphs of elements
8 which operate on data. The functionality to process media is provided by
9 plug-ins which provide features like elements, typefinding, and so on.
10 This allows new functionality to be added simply by installing new
13 GStreamer is cross-platform and works on most UNIX-like platforms as
14 well as Windows. It is released under the GNU Library General Public
17 ![ Relation between gstreamer core objects. ]
19 [ Relation between gstreamer core objects. ]: images/gst-universe.svg
23 On UNIX, GStreamer uses the standard GNU build system, using autoconf
24 for package configuration and resolving portability issues, automake for
25 building makefiles that comply with the GNU Coding Standards, and
26 libtool for building shared libraries on multiple platforms. The normal
27 sequence for compiling and installing the GStreamer library is thus:
28 `./configure` `make` `make install`
30 The standard options provided by GNU autoconf may be passed to the
31 `configure` script. Please see the autoconf documentation or run
32 `./configure --help` for information about the standard options.
34 In addition there are several options to activate or deactivate
35 features. E.g. passing `--disable-gst-debug` to `configure` will turn
36 the debugging subsystem into a non-functional stub and remove all macro
37 based invocations from within the library (and anything compiled against
38 the library afterwards.)
40 If library size matters and one builds in a controlled environment, it
41 is also possible to totally remove subsystem code. This is intentionally
42 not offered as a configure option as it causes an ABI break. Code built
43 against a version of GStreamer without these modifications needs to be
46 `make CFLAGS="-DGST_REMOVE_DEPRECATED -DGST_REMOVE_DISABLED"`
48 - `GST_REMOVE_DEPRECATED` - Omit deprecated functions from the
51 - `GST_REMOVE_DISABLED` - Omit stubs for disabled subsystems from the
54 ## Building GStreamer Applications
56 Applications and libraries can use `pkg-config` to get all the needed
57 compiler and linker flags to build against GStreamer. Please note that
58 GStreamer is split into several libraries itself.
59 `pkg-config --list-all | grep gstreamer` will list the available
62 ## Running and debugging GStreamer Applications
64 ### Environment variables
66 GStreamer inspects a few of environment variables in addition to
67 standard variables like LANG, PATH or HOME.
69 **GST_PLUGIN_SYSTEM_PATH, GST_PLUGIN_SYSTEM_PATH_1_0.**
71 This environment variable can be set to a colon-separated list of paths
72 (or semicolon-separated list on Windows). If this variable is not set,
73 GStreamer will fill in this list for you with
75 - plug-ins in the user's home directory, or rather the user's "data
76 home" directory according to the xdg base dir specification. Usually
77 this will be a directory called `plugins` inside the
78 `.local/share/gstreamer-GST_API_VERSION` directory in the user's
79 home directory by default, though this search path may change if the
80 XDG_DATA_HOME environment variable is set.
82 - plug-ins installed system-wide. On this system, they are stored in
85 GStreamer will scan these paths for GStreamer plug-ins. These plug-ins
86 will be loaded after the plug-ins in the GST_PLUGIN_PATH variable
87 below. The paths are scanned in the given order. This allows a user to
88 override system-installed plug-ins with his own versions.
90 The GST_PLUGIN_SYSTEM_PATH_1_0 variant is useful if both the old
91 GStreamer 0.10 version and the new GStreamer 1.0 version need to be
92 pointed to new plugin paths. The latter will use the _1_0 variant over
93 the non-versioned one if it is set.
95 Setting this variable to an empty string will cause GStreamer not to
96 scan any system paths at all for plug-ins. This can be useful if you're
97 running a development environment (for development purposes) or while running
100 **GST_PLUGIN_PATH, GST_PLUGIN_PATH_1_0.**
102 This environment variable can be set to a colon-separated list of paths
103 (or a semicolon-separated list on Windows). GStreamer will scan these
104 paths for GStreamer plug-ins. These plug-ins will be loaded in addition
105 to, and before, the plug-ins in the system paths.
107 The GST_PLUGIN_PATH_1_0 variant is useful if both the old GStreamer
108 0.10 version and the new GStreamer 1.0 version need to be pointed to new
109 plugin paths. The latter will use the _1_0 variant over the
110 non-versioned one if it is set.
114 If GStreamer has been configured with `--enable-gst-debug=yes`, this
115 variable can be set to a list of debug options, which cause GStreamer to
116 print out different types of debugging information to stderr.
118 The variable takes a comma-separated list of "category_name:level"
119 pairs to set specific levels for the individual categories. The level
120 value ranges from 0 (nothing) to 9 (MEMDUMP).
122 * 1 - `ERROR`: Logs all fatal errors. These are errors that do not allow the core
123 or elements to perform the requested action. The application can
124 still recover if programmed to handle the conditions that triggered
126 * 2 - `WARNING`: Logs all warnings. Typically these are non-fatal, but user-visible
127 problems are expected to happen.
128 * 3 - `FIXME`: Logs all fixme messages. Fixme messages are messages that indicate
129 that something in the executed code path is not fully implemented or
130 handled yet. The purpose of this message is to make it easier to
131 spot incomplete/unfinished pieces of code when reading the debug
133 * 4 - `INFO`: Logs all informational messages. These are typically used for events
134 in the system that only happen once, or are important and rare
135 enough to be logged at this level.
136 * 5 - `DEBUG`: Logs all debug messages. These are general debug messages for events
137 that happen only a limited number of times during an object's
138 lifetime; these include setup, teardown, change of parameters, ...
139 * 6 - `LOG`: Logs all log messages. These are messages for events that happen
140 repeatedly during an object's lifetime; these include streaming and
141 steady-state conditions.
142 * 7 - `TRACE`: Logs all trace messages. These messages for events that happen
143 repeatedly during an object's lifetime such as the ref/unref cycles.
144 * 9 - `MEMDUMP`: Log all memory dump messages. Memory dump messages are used to log
145 (small) chunks of data as memory dumps in the log. They will be
146 displayed as hexdump with ASCII characters.
148 The category_name can contain "`*"` as a wildcard.
150 For example, setting GST_DEBUG to `GST_AUTOPLUG:6,GST_ELEMENT_*:4`,
151 will cause the `GST_AUTOPLUG` category to be logged at full `LOG` level,
152 while all categories starting with `GST_ELEMENT_` will be logged at
155 To get all possible debug output, set GST_DEBUG to `*:9`. For debugging
156 purposes a `*:6` debug log is usually the most useful, as it contains
157 all important information, but hides a lot of noise such as refs/unrefs.
158 For bug reporting purposes, a `*:6` log is also what will be requested
159 usually. It's often also worth running with `*:3` to see if there are
160 any non-fatal errors or warnings that might be related to the problem at
163 Since GStreamer 1.2 it is also possible to specify debug levels by name,
164 e.g. GST_DEBUG=*:WARNING,*audio*:LOG
166 **GST_DEBUG_NO_COLOR.**
168 Set this environment variable to any value ("1" typically) to switch off
169 colouring in GST_DEBUG output. This has the same effect as specifying
170 the `--gst-debug-no-color` or `--gst-debug-color-mode`=off command line
171 option to well-behaved GStreamer applications (ie. those that pass
172 command-line options correctly to GStreamer). This is particularly
173 useful to reduce the size of debug output and also allows for the output
174 to be compressed much better than with colours turned on.
176 Has the same effect as setting GST_DEBUG_COLOR_MODE environment
179 **GST_DEBUG_COLOR_MODE.**
181 Set this environment variable to change log colouring in GST_DEBUG
182 output. Possible values:
184 * `on`: Enables debug log output coloring. Uses default coloring method for
185 current platform. This is the default.
186 * `off`: Disables debug log output coloring. This has the same effect as
187 specifying the `--gst-debug-color-mode`=off command line option to
188 well-behaved GStreamer applications (ie. those that pass
189 command-line options correctly to GStreamer). This is particularly
190 useful to reduce the size of debug output and also allows for the
191 output to be compressed much better than with colours turned on.
193 Has the same effect as setting GST_DEBUG_NO_COLOR environment
194 variable to any value.
195 * `auto`: Same as `on`.
196 * `disable`: Same as `off`.
197 * `unix`: Enables debug log output coloring and forces the use of UNIX termial
198 codes for coloring, even if this method is not normally used on
199 current platform. This has the same effect as specifying the
200 `--gst-debug-color-mode`=unix command line option to well-behaved
201 GStreamer applications (ie. those that pass command-line options
202 correctly to GStreamer). This is particularly useful to dump debug
203 output into a file on non-UNIX platforms to be sent to developers
204 who have viewers that support UNIX terminal codes.
206 **GST_DEBUG_OPTIONS.**
208 This environment variable can be used to tweak the behaviour of the
209 debugging system. Currently the only options supported are "pretty-tags"
210 and "full-tags". In "pretty-tags" mode (the default), taglists in the
211 debug log will be serialized so that only the first few and last few
212 bytes of a buffer-type tag will be serialized into the log, to avoid
213 dumping hundreds of lines of useless output into the log in case of
214 large image tags and the like.
216 **GST_DEBUG_DUMP_DOT_DIR.**
218 Set this environment variable to a path to turn on all
219 #GST_DEBUG_BIN_TO_DOT_FILE or
220 #GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS calls and have the dot files
223 This will only work if the application in question makes these calls in
224 strategic places (like when the pipeline state changes or an error
225 occurs). gst-launch-GST_API_VERSION is one such application.
227 These .dot files can then be turned into images using the 'dot' utility
228 from the graphviz set of tools, like this:
229 `dot foo.dot -Tsvg -o foo.svg` or `dot foo.dot -Tpng -o foo.png` or
230 `dot foo.dot -Tjpg -o foo.jpg`.
232 There is also a utility called `xdot` which allows you to view the dot
233 file directly without converting it first.
235 **GST_REGISTRY, GST_REGISTRY_1_0.**
237 Set this environment variable to make GStreamer use a different file for
238 the plugin cache / registry than the default one. This is useful when
239 operating in a separate environment which should not affect the default
240 cache in the user's home directory.
242 **GST_REGISTRY_FORK.**
244 Set this environment variable to "no" to prevent GStreamer from forking
245 on startup in order to update the plugin registry. This is useful for
246 debugging purposes, but should not be used under normal circumstances,
247 since it means that plugins may be loaded into memory even if they are
248 not needed by the application.
250 **GST_REGISTRY_UPDATE.**
252 Set this environment variable to "no" to prevent GStreamer from updating
253 the plugin registry. This is useful for embedded device which is not
254 updating the plugins frequently, it will save time when doing
259 Enable memory allocation tracing. Most GStreamer objects have support
260 for tracing the number of unfreed objects and their memory pointers.
262 The variable takes a comma-separated list of tracing options to enable.
264 * live: Counts all live objects and dumps an overview of the number of
265 unfreed objects at program exit.
267 * mem-live: Keep track of the unfreed memory pointers and dump an overview of
268 all unfreed memory at program exit. Together with a level 9 debug
269 log this can be used to follow the lifecycle of leaked objects in
270 order to track down where they are leaked. This can be useful for
271 debugging memory leaks in situations where tools such as valgrind
272 are not available, or not an option.
274 Use `all` to enable all tracing flags.
278 Set this variable to a file path to redirect all GStreamer debug
279 messages to this file. If left unset, debug messages with be output unto
284 Useful Orc environment variable. Set ORC_CODE=debug to enable debuggers
285 such as gdb to create useful backtraces from Orc-generated code. Set
286 ORC_CODE=backup or ORC_CODE=emulate if you suspect Orc's SIMD code
287 generator is producing incorrect code (Quite a few important GStreamer
288 plugins like videotestsrc, audioconvert or audioresample use Orc). One
289 can also combine flags like ORC_CODE=backup,debug.
293 Useful GLib environment variable. Set G_DEBUG=fatal_warnings to make
294 GStreamer programs abort when a critical warning such as an assertion
295 failure occurs. This is useful if you want to find out which part of the
296 code caused that warning to be triggered and under what circumstances.
297 Simply set G_DEBUG as mentioned above and run the program in gdb (or
298 let it core dump). Then get a stack trace in the usual way.
302 Useful GLib environment variable. Set G_SLICE=always-malloc when
303 running GStreamer programs in valgrind, or debugging memory leaks with
304 other tools. See the GLib API reference for more details.
306 **GST_TAG_ENCODING.**
308 Try this character encoding first for tag-related strings where the
309 encoding is not defined and which are not UTF-8 already. By default the
310 current locale will be tried (if not UTF-8).
312 **GST_TAG_ID3_ENCODING.**
314 Try this character encoding first for ID3 tag-related strings where the
315 encoding is not defined and which are not UTF-8 already. By default the
316 current locale will be tried (if not UTF-8).
318 **GST_TAG_ID3V1_ENCODING.**
320 Try this character encoding first for ID3v1 tag-related strings where
321 the encoding does not look like UTF-8.
325 Influences the window system to use by the GStreamer OpenGL library.
326 Common values are 'x11', 'wayland', 'win32' or 'cocoa'.
330 Influences the OpenGL platform to use by the GStreamer OpenGL library.
331 Common values are 'egl', 'glx', 'wgl' or 'cgl'.
335 Influences the OpenGL API requested by the OpenGL platform. Common
336 values are 'opengl' or 'gles2'.