How joshdoe/gst-plugins-vision works
This repository is a collection of GStreamer 1.x plugins for machine-vision pipelines. The overall architecture is “many small plugins, one build system”: each plugin is built as its own loadable module and discovered at runtime via GST_PLUGIN_PATH rather than being a monolithic app.
The code splits into three main functional areas:
1. Hardware acquisition plugins (sys/)
These are the largest subsystem. Each subdirectory wraps a specific vendor SDK or frame-grabber API and exposes a GStreamer source element such as aptinasrc, bitflowsrc, gsteuresyssrc, gstidsueyesrc, gstmatroxsrc, gstpylonsrc, gstpleorasrc, and others. The key architectural boundary is that each plugin is isolated around one external camera/frame-grabber ecosystem and depends on that vendor’s C/C++ SDK, license, and driver stack.
2. Hardware/simulator output plugins (sys/ and ext/)
A smaller set of plugins act as sinks or transmitters, not just sources. Examples include gigesimsink, kayasink, edtpdvsink, and pleorasink. These are used to feed simulated or SDK-managed outputs into other systems, especially GigE Vision or frame-grabber simulators. This makes the repo useful not only for capture but also for lab/testbed generation.
3. Generic processing plugins (gst/)
These are vendor-neutral elements that operate on image data after capture. Examples include extractcolor for channel extraction, videolevels for scaling monochrome video to 8-bit with AGC/manual setpoints, sfx3dnoise for synthetic noise, and bayer2gray for Bayer-pattern handling. These plugins are the main “in-pipeline” image-processing layer between acquisition and downstream consumers.
4. KLV / MISB metadata path (gst/klv, gst/misb, gst-libs/klv)
This is a distinct metadata subsystem. The repo includes a KLV library and plugins for synchronous KLV handling: injection, inspection, timestamping, and MISB IR packing/unpacking. The README notes KLV is optional and gated by ENABLE_KLV, with downstream dependency impact on the Pleora plugin. This is a separate data flow from pixel/video data, but designed to travel alongside it in GStreamer streams.
5. Image codec / utility plugins (ext/freeimage)
This module wraps FreeImage into GStreamer elements for decoding/encoding image formats. It sits at the boundary between file/image codec functionality and the rest of the vision pipeline, typically converting still-image formats into GStreamer buffers or vice versa.
6. Vendor-independent support code (common/ and gst-libs/)
common/ holds shared low-level helpers such as pixel-format definitions and a UNIX nanosecond timestamp utility. gst-libs/klv is a reusable support library rather than a plugin itself. These shared pieces reduce duplication across the many vendor-specific plugins, especially where buffer metadata or timing semantics are shared.
7. Build and dependency resolution (CMakeLists.txt, cmake/modules/)
The repository is heavily CMake-driven and uses many custom Find*.cmake modules to detect optional SDKs and libraries. The build is therefore feature-assembled: only the plugins whose vendor SDKs are present will compile. This is an important architectural boundary because the runtime plugin set depends on the build environment, OS, and installed drivers.
8. Runtime model
At runtime, these plugins are intended to be used inside standard GStreamer pipelines. Typical flow is: hardware source or simulator source → optional processing/metadata plugins → sink or downstream GStreamer consumer. The repository itself does not include an application layer; it supplies the reusable building blocks that other GStreamer-based applications compose.
9. Platform and SDK coupling
The repo is cross-platform in intent, but many plugins are tightly coupled to Windows-centric vendor SDKs and device drivers, while others can build on Linux. The architecture therefore mixes portable GStreamer plugin logic with highly platform-specific device bindings.
10. Primary architectural takeaway for a diagram
Draw a central GStreamer plugin layer with three branches: hardware acquisition/simulation, generic image processing, and KLV/MISB metadata handling. Surround that with vendor SDK dependencies as external systems, and show CMake as the build-time selector that includes/excludes plugins based on available SDKs and optional features.
Main entry points: sys Camera sources · freeimage FreeImage codecs · klv KLV plugins · common Common code
Components 16
Build system
CMake-based feature selection and module discovery
- CMake · Top-level CMake build that assembles available plugins
CMakeLists.txt - Find modules · Custom CMake checks for GStreamer, image libs, and vendor SDKs
cmake/modules
Plugin runtime
GStreamer plugin layer composed of loadable modules
- GStreamer plugins · Loadable modules discovered at runtime through the GStreamer plugin path
Acquisition / I/O
Vendor and simulator source/sink plugins for camera and frame-grabber ecosystems
- Camera sources · Vendor-specific capture elements wrapping camera and frame-grabber APIs
sys - Output sinks · Simulator and SDK-managed output elements for testbeds and transmit paths
sys - GenTL source · Generic GenTL-based acquisition plugin and bundled support code
sys/gentl
Image processing
Vendor-neutral in-pipeline image transforms
- FreeImage codecs · Image decode/encode wrapper around the FreeImage library
ext/freeimage - Bayer utils · Bayer-pattern handling and gray conversion utilities
gst/bayerutils - Extract color · Channel and component extraction from image buffers
gst/extractcolor - Video levels · Monochrome scaling and AGC/manual level adjustment
gst/videoadjust - Sensor FX · Noise and blur generation for synthetic or test pipelines
gst/sensorfx
KLV / MISB
Synchronous metadata and IR payload handling
- KLV plugins · KLV injection, inspection, and timestamping elements
gst/klv - MISB IR · MISB infrared packing and unpacking elements
gst/misb
Shared support
Reusable helpers and library code
- KLV lib · Reusable KLV library used by metadata plugins
gst-libs/klv - Common code · Shared pixel-format and timestamp utilities
common
External SDKs
Optional vendor SDKs, drivers, and libraries detected at build time
- Vendor SDKs · Optional camera, frame-grabber, and imaging libraries detected by CMake
Connections 25
- CMake → Find modules: configures · Top-level build delegates feature detection to custom find modules
- Find modules → Vendor SDKs: detects · Probes for vendor SDKs, drivers, and third-party libraries
- CMake → GStreamer plugins: builds · Compiles only the plugin modules enabled by the environment
- GStreamer plugins → Camera sources: includes · Runtime plugin layer exposes camera acquisition elements
- GStreamer plugins → Output sinks: includes · Runtime plugin layer exposes simulator/output elements
- GStreamer plugins → GenTL source: includes · Generic GenTL acquisition module is part of the plugin set
- GStreamer plugins → FreeImage codecs: includes · Image codec boundary for still-image conversion
- GStreamer plugins → Bayer utils: includes · Vendor-neutral Bayer conversion utilities
- GStreamer plugins → Extract color: includes · Channel extraction element used inside pipelines
- GStreamer plugins → Video levels: includes · Video scaling and level adjustment element
- GStreamer plugins → Sensor FX: includes · Synthetic noise and blur effects for test pipelines
- GStreamer plugins → KLV plugins: includes · Synchronous metadata handling elements
- GStreamer plugins → MISB IR: includes · MISB-specific metadata transforms
- KLV plugins → KLV lib: uses · Metadata plugins share a reusable KLV support library
- Camera sources → Vendor SDKs: wraps · Each source element binds to a specific vendor ecosystem
- Output sinks → Vendor SDKs: targets · Sink plugins integrate with simulator or device SDKs
- GenTL source → Vendor SDKs: depends on · GenTL capture path relies on external transport-layer support
- FreeImage codecs → Vendor SDKs: links to · Codec module depends on the FreeImage library
- Bayer utils → Common code: uses · Shares pixel-format definitions and low-level helpers
- Video levels → Common code: uses · Shares numeric/timing support where needed
- Sensor FX → Common code: uses · Synthetic effects share common utility code
- KLV plugins → GStreamer plugins: streams with · Metadata travels alongside video buffers in GStreamer pipelines
- Camera sources → GStreamer plugins: feeds · Capture elements are upstream entry points into the pipeline
- Output sinks → GStreamer plugins: consumes · Output elements terminate or hand off pipeline data
- FreeImage codecs → GStreamer plugins: converts · Codec elements bridge file/image formats and pipeline buffers