ArticleslgStudy

computer science

GStreamer

GStreamer is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand GStreamer rather than just read about it. In short: GStreamer is a pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. For instance, GStreamer can be used to build a system that reads files in one format, processes them, and exports them in another.

GStreamer — main illustration
GStreamer — illustration

Key takeaways

  • GStreamer belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect GStreamer to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of GStreamer from memory before moving on to harder problems.

Reference excerpt

GStreamer is a pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. For instance, GStreamer can be used to build a system that reads files in one format, processes them, and exports them in another. The formats and processes can be changed in a plug and play fashion. GStreamer supports a wide variety of media-handling components, including simple audio playback, audio and video playback, recording, streaming and editing. The pipeline design serves as a base to create many types of multimedia applications such as video editors, transcoders, streaming media broadcasters and media players. It is designed to work on a variety of operating systems, e.g. the BSDs, OpenSolaris, Linux, Android, macOS, iOS, Windows, OS/400. GStreamer is free and open-source software subject to the terms of the LGPL-2.1-or-later and is being hosted at freedesktop.org.

Distribution and adoption The GNOME desktop environment, a heavy user of GStreamer, has included GStreamer since GNOME version 2.2 and encourages GNOME and GTK applications to use it. Other projects also use or support it, such as the Phonon media framework and the Songbird media player. It is also used in the WebKit browser engine. GStreamer also operates in embedded devices like the Jolla Phone, the Palm Pre, Tizen and the Nokia 770, N800, N810, N900 and N9 Internet Tablets running the Maemo operating system. In addition to source code releases, the GStreamer project provides binary builds for Android, iOS, OSX and Windows. The LIGO Laboratory make use of GStreamer to simulate and analyze gravitational wave data. The GStreamer interface is called GstLAL.

Software architecture

GStreamer is written in the C programming language with the type system based on GObject and the GLib 2.0 object model.

Language bindings A library written in one programming language may be used in another language if bindings are written; GStreamer has a range of bindings for various languages such as Go, Python, Rust, Vala, C++, Perl, GNU Guile, C# and Ruby.

Overview GStreamer processes media by connecting a number of processing elements into a pipeline. Each element is provided by a plug-in. Elements can be grouped into bins, which can be further aggregated, thus forming a hierarchical graph. This is an example of a filter graph. Elements communicate by means of pads. A source pad on one element can be connected to a sink pad on another. When the pipeline is in the playing state, data buffers flow from the source pad to the sink pad. Pads negotiate the kind of data that will be sent using capabilities. The diagram to the right could exemplify playing an MP3 file using GStreamer. The file source reads an MP3 file from a computer's hard-drive and sends it to the MP3 decoder. The decoder decodes the file data and converts it into PCM samples which then pass to the sound-driver. The sound-driver sends the PCM sound samples to the computer's speakers.

Plug-ins GStreamer uses a plug-in architecture which makes the most of GStreamer's functionality implemented as shared libraries. GStreamer's base functionality contains functions for registering and loading plug-ins and for providing the fundamentals of all classes in the form of base classes. Plug-in libraries get dynamically loaded to support a wide spectrum of codecs, container formats, input/output drivers and effects. Plug-ins can be installed semi-automatically when they are first needed. For that purpose distributions can register a backend that resolves feature-descriptions to package-names. Since version 0.9, the plug-ins come grouped into three sets (named after the film The Good, the Bad and the Ugly).

Individual distributions may further sub-classify these plug-ins: for example Ubuntu groups the "bad" and "ugly" sets into the "Universe" or the "Multiverse" components. In addition, there is a GStreamer FFmpeg plug-in (called gst-libav for historic reasons) that extends the number of supported media formats.

Video acceleration

There are various SIP blocks that can do the computations to decode certain video codecs, such as PureVideo, UVD, QuickSync Video, TI Ducati and more. Such needs to be supported by the device driver, which in turn provides one or multiple interfaces, like VDPAU, VAAPI, Distributed Codec Engine or DXVA to end-user software like MPlayer to access this hardware and offload computation to it.

It is possible to use Video Coding Engine with GStreamer through the OpenMAX IL wrapper plugin gst-omx. This is for example possible on the Raspberry Pi. The SIP core present on some Texas Instruments SoCs is also accessible through GStreamer: gst-dmai, gst-openmax, gst-dsp. VDPAU and VAAPI are supported with GNOME Videos >= 2.28.0 and GStreamer >= 0.10.26 since 2010 Broadcom Crystal HD is supported

Media formats The Good, Bad and Ugly GStreamer plugins mentioned earlier provide, alongside processing elements/filters of all kinds, support for a wide variety of file formats, protocols and multimedia codecs. In addition to those, support for more than a hundred compression formats (including MPEG-1, MPEG-2, MPEG-4, H.261, H.263, H.264, RealVideo, MP3, WMV, etc.) is transparently provided through the gst-libav plug-in.

History and development

… excerpt ends here. Continue reading the full article.

Illustrations

GStreamer illustration
GStreamer illustration
GStreamer: Overview
Overview
GStreamer: GStreamer core with three different types of plugins
GStreamer core with three different types of plugins
GStreamer: GStreamer is a Pipeline.
GStreamer is a Pipeline.

Worked examples

Example 1 — a first encounter with GStreamer

Start with the simplest possible case. Write down what GStreamer claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to GStreamer before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about GStreamer ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of GStreamer

In research
GStreamer appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses GStreamer in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
GStreamer is common in secondary-school and first-year university syllabi. It links to neighbouring topics Collabora, Free multimedia software, Free software programmed in C, so understanding it makes those chapters shorter.
In everyday life
Look for GStreamer outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “GStreamer” →

How to study GStreamer in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what GStreamer means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain GStreamer out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is GStreamer in simple terms?

GStreamer is a pipeline-based multimedia framework that links together a wide variety of media processing systems to complete complex workflows. For instance, GStreamer can be used to build a system that reads files in one format, processes them, and exports them in another.

Why does GStreamer matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study GStreamer?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on GStreamer.

Tags

  • Collabora
  • Free multimedia software
  • Free software programmed in C
  • Freedesktop.org libraries
  • GNOME libraries
  • GStreamer
  • Multimedia frameworks
  • Software that uses Meson

Keep exploring