GStreamer:Basic
lastmod 2025-02-13created 2023-01-2012 edits
Notes on the basics of GStreamer.
Terms
Example setup:
Gstreamer_-basic-pipeline-_ogg_player.png
Components
- Elements
- The most important object in GStreamer. You can build a chain of linked elements and use that chain to process stream data.
-
Gstreamer_-basic-_elements.png - Source elements
- Have only outputs, no inputs (receiving side).
- Read from disk or sound card to produce data for the pipeline
- Filters, Convertors, Demuxers, Muxers, Codecs
- Have input and output pads. (Receive data, process it, and send it out)
- Can be 1:1 (filter, convertor) or 1:N (demuxer, muxer).
- Examples include Filter (volume), Convertor (video resizing), and Ogg (file containing video + audio) Demuxer.
- Sink elements
- End point of the media pipeline
- Have only inputs (receiving side), no outputs.
- Mainly perform hardware output (display on a monitor, audio output) and file saving
- Source elements
- Pads
- Pads represent an Element's Input and Output. Through them, it can be linked to other Elements.
- Pads have Capabilities that determine the Data they can handle. For example, a Pad can restrict the flow of certain data.
- Pads are divided into Source Pads and Sink Pads.
- Sink Pads are used to bring data into the Element, - Sink is input! (Differs from my mind map!)
- Source Pads are used to send data out of the Element. - Src is output! (Differs from my mind map!)
-
Gstreamer_-basic-_bin.png
- Cap
- Filters the data Types supported by a Pad (size, frame count, etc.). Usually placed after a Converter.
- Bins
- A Container that collects Elements (a kind of group)
- Once grouped into a Bin, Elements can be controlled all at once instead of one by one.
- For example, to change the state of all Elements grouped in a Bin, simply change the state of the Bin itself and the state of every Element inside the Bin changes.
- Pipelines
- Top-level Bin; provides a Bus for the application. Manages synchronization of its children.
-
Gstreamer_-basic-_pipeline.png
Communication
GStreamer provides mechanisms for data exchange or communication between the application and the pipelin in various ways.
Gstreamer_-basic-_communication.png
- Bus
- Checks the state while the Pipeline loop runs. Used by attaching a message handler to the Bus.
- Buffer
- Buffers are used to transfer data between Elements within a Pipeline.
- Buffers always travel from Source to Sink. (Downstream)
- Message
- Data sent from each Element to the application
- Event
- An object sent from the application -> each Element
- Query
- Data sent from the application -> the Pipeline
Basic tutorials
- Basic tutorials - Link to the Basic Tutorials on the official site.
These tutorials describe general topics required to understand the rest of tutorials.
- Basic tutorial 1: Hello world! – The mandatory 'Hello world' example
- Basic tutorial 2: GStreamer concepts – Gstreamer Elements, Pipeline and the Bus
- Basic tutorial 3: Dynamic pipelines
- Basic tutorial 4: Time management
- Basic tutorial 5: GUI toolkit integration
- Basic tutorial 6: Media formats and Pad Capabilities
- Basic tutorial 7: Multithreading and Pad Availability
- Basic tutorial 8: Short-cutting the pipeline
- Basic tutorial 9: Media information gathering
- Basic tutorial 10: GStreamer tools
- Basic tutorial 11: Debugging tools
- Basic tutorial 12: Streaming
- Basic tutorial 13: Playback speed
- Basic tutorial 14: Handy elements
- Basic tutorial 16: Platform-specific elements
See also
- GStreamer
- GStreamer:Basic
- GStreamer:GstLaunch - gst-launch-1.0 command line.
- GStreamer:GstInspect - gst-inspect-1.0 command line.
- GStreamer:Python
- GStreamer:C
Favorite site
Tutorials
- Studying developer :: I. Introduction to GStreamer : Chapter 1. What is GStreamer?
- (Translation)(gstreamer) basic tutorial 1: Hello world! :: Palranggwi
- (NNStreamer) Gstreamer basic tutorial 1 - NiklasJang’s Blog - Based on Basic tutorial 1: Hello world!.
- (NNStreamer) Gstreamer basic tutorial 3 - NiklasJang’s Blog
- Gstreamer basic tutorial 02: GStreamer concepts - jtrimind blog
Pages that link here