Skip to content

Collection of resources and useful tools for Rust πŸ¦€ and C based Gstreamer pipelines

Notifications You must be signed in to change notification settings

JaydenElliott/gstreamer-rs-toolbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 

Repository files navigation

🧰 Gstreamer Toolbox (Rust and C) 🧰

Note: The list below is currently in progress

A collection of useful documentation, tools, code snippets and articles for writing Gstreamer applications. Anyone deep enough in the gstreamer ecosystem knows how difficult it can be to find up to date documentation or examples on specific plugins/tools. Hopefully this guide can give you a hand navigating this space.

βš™οΈ Feel free to update the list with any resources you might have with a PR βš™οΈ

Table of contents

  1. Start Here
  2. Primary Sources
  3. Common Questions
  4. Observability
  5. Debugging Pipelines
  6. Profiling and Optimisation
  7. Testing
  8. Nvidia Deepstream
  9. IDE / Environment

Start Here

Todo

Rust Tutorial

Prepare to read a lot of plugin implementations and examples. Although there is a fair bit of documentation, it won't answer a lot of questions you will have about specifics. My usual workflow for findings answers is:


Primary Sources

95% of your questions can be answered by these

Core Gstreamer Docs

Core Gstreamer Documentation

For high level design overviews and core/custom plugin documentation. This should usually be your first point of call. Useful docs:


Gst-inspect-1.0 CLI

Gst-inspect-1.0 Documentation

Example Pipelines

Command line access to plugin documentation and allows you to query your own custom plugins to check:

  • Description
  • Pad capabilities
  • Properties
  • Signals

This will only work for plugins you have installed (see: installing a custom plugin in rust or in c).


Rust Bindings

Gstreamer Rust Bindings

This repository, as well as gst-plugins-rs are, imo the most useful references for writing your own plugins. @sdroege has done a momentous job building these bindings and writing excellent tutorials/documentation. I frequently visit the plugin examples and find the following resources extremely useful for newcomers and experienced gst devs alike:


Rust Plugins

Gstreamer Rust Plugins

Contains endless plugin examples, a great tutorial and is constantly active. Core maintainers are very reponsive if you have any questions not covered in their examples/docs.


Messages and Events

Messages are passed directly to the applications message bus. Events are passed up/down the pipeline and can trigger events.

For example, a QOS event send out by a sink at the end of your pipeline, could be received by a decoder who would send a Message to the message bus with stats on how many frames it has processed and dropped.

Observability

Tracers

Tracers are extremely useful for monitoring pipeline throughput, element latency, cpu usage and a variety of other metrics.

Measuring Video and Performance


Dot Graphs

Core Dot Graph Documentation

From a rust application

  1. Define GST_DEBUG_DUMP_DOT_DIR environment variable

  2. Upcast pipeline to gst::Element then call element.debug_to_dot_file(). Example usage from gstreamer-rs playbin example:

let bin_ref = playbin.downcast_ref::<gst::Bin>().unwrap();
bin_ref.debug_to_dot_file(gst::DebugGraphDetails::all(), "PLAYING");

Using GstShark

Easy pipeline image generation

  • todo: check works in non-gst-launch environment


Debugging Pipelines

GST_DEBUG

Debug Logs Documentation

Used to set the gstreamer specific log levels. Can log everything from basic errors/info logs to every event and message on the event bus.

These can be easily viewed using the debug-viewer. A small app for filtering and sorting through GST logs.


DebugProbe plugin

TODO

gst-devtools

gst-devtools

GstShark

todo - debugging todo - gstd todo - gstd2

"GStreamer Daemon is gst-launch on steroids"


Profiling and Optimisation

GstShark


Testing

GstHarness

GstHarness

GstValidate

GstValidate Tutorial


Nvidia Deepstream

Deepstream SDK

todo

Environment Setup

A lot of your time will be spent reading, compiling and testing c/c++. I would suggest setting up your IDE to enable quick definition/ reference jumping (the promise of rust bindings doesn't let you escape cpp completely unfortunately).

todo: vscode devcontainer setup for gstreamer/nvidia todo: nvim container setup


About

Collection of resources and useful tools for Rust πŸ¦€ and C based Gstreamer pipelines

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published