Skip to content

Instantly share code, notes, and snippets.

@rootnotez
Last active May 20, 2025 20:04
Show Gist options
  • Select an option

  • Save rootnotez/e3368146636e8cf8e89c339f8c285921 to your computer and use it in GitHub Desktop.

Select an option

Save rootnotez/e3368146636e8cf8e89c339f8c285921 to your computer and use it in GitHub Desktop.

Gstreamer Debugging

Debuggging and troubleshooting

Command-line Tools

Show what debug options can be enabled.
gst-launch-1.0 --gst-debug-help

View negotiated caps with gst-launch-1.0 --verbose
gst-launch-1.0 -v videotestsrc ! videoconvert ! autovideosink

Inspect element capabilities and properties with gst-inspect-1.0
gst-inspect-1.0 nvh264enc

Debug Environment Variables

GStreamer Enviornment Variables
Set global debug level (0-9)
GST_DEBUG=3 gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink

Common debug categories

  • GST_STATES - Element state changes
  • GST_CAPS - Capability negotiation
  • GST_PADS - Pad operations
  • GST_ELEMENT_PADS - Element pad operations
  • GST_PARAMS - Element property access

Element-Specific Debugging

Syntax to debug specific elements
GST_DEBUG=videoconvert:GST_CAPS:6

Syntax to add more specific elements. Set global debug to 3, set videoconvert debug to 5, set videoconvert GST_CAPS to 6
GST_DEBUG=3,videoconvert:5,GST_CAPS:6 gst-launch-1.0 videotestsrc ! videoconvert ! fakesink

Command line global debug --gst-debug and --gst-debug-no-color=1
gst-launch-1.0 videotestsrc ! videoconvert ! fakesink --gst-debug=6,GST_BUFFER:5 --gst-debug-no-color=1

Pipeline Visualization

GST_DEBUG_DUMP_DOT_DIR=/tmp/gst-dot can export your pipeline in dot format for visualization.
GST_DEBUG_DUMP_DOT_DIR=/tmp/gst-dot gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink

Performance Tracing

GST_TRACERS="latency;proctime;interlatency" GST_DEBUG="GST_TRACER:7" gst-launch-1.0 videotestsrc ! fakesink

gst-shark not in packages, needs to be built https://github.com/RidgeRun/gst-shark

Available tracers: (requires gst-shark package)

  • latency: Buffer latency
  • proctime: Processing time
  • interlatency: Latency between elements
  • framerate: Pipeline framerate
  • queuelevel: Queue levels
  • bitrate: Throughput measurement
  • scheduling: Task scheduling details

Performance Tuning

https://developer.ridgerun.com/wiki/index.php/Embedded_GStreamer_Performance_Tuning
https://nnstreamer.github.io/tools/profiling/README.html
https://github.com/kirushyk/gst-instruments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment