General Debugging and Performance Analysis
General Debugging and Performance Analysis
5.1 Enable Logging
GStreamer log levels are as follows:
| Level | Value |
|---|---|
| ERROR | 1 |
| WARNING | 2 |
| FIXME | 3 |
| INFO | 4 |
| DEBUG | 5 |
| LOG | 6 |
| TRACE | 7 |
Set the global log level:
GST_DEBUG=2 gst-play-1.0 test.mp4Set different levels for different modules:
GST_DEBUG='2,decodebin:5,v4l2*:4' gst-play-1.0 test.mp45.2 Check the Frame Rate
fpsdisplaysink measures the video frame rate and forwards the frames to the actual video sink:
GST_DEBUG=fpsdisplaysink:7 \
gst-launch-1.0 videotestsrc \
! fpsdisplaysink video-sink=autovideosink \
signal-fps-measurements=true text-overlay=falsesync=false can be used to test maximum pipeline throughput, but it disables clock synchronization and does not represent normal playback behavior.
GST_DEBUG=fpsdisplaysink:7 \
gst-launch-1.0 videotestsrc \
! fpsdisplaysink video-sink=fakesink \
signal-fps-measurements=true text-overlay=false sync=false5.3 Export a Pipeline Graph
export GST_DEBUG_DUMP_DOT_DIR=/tmp
gst-play-1.0 test.mp4
ls -l /tmp/*.dotConvert the graph to an image on a host with Graphviz installed:
dot pipeline.dot -Tpng -o pipeline.pngOne run may generate multiple DOT files, each representing the pipeline structure in a different state.
5.4 General Troubleshooting Procedure
- Use
gst-inspect-1.0to verify that the plugin exists and inspect its pads, Caps, and properties. - Use
gst-discoverer-1.0orv4l2-ctlto identify the input format. - Add
-vtogst-launch-1.0to inspect the negotiated Caps. - Reduce a complex pipeline to
Source → Parser/Decoder → fakesink. - Gradually add format conversion, encoding, display, audio, and network branches.
- Add a
queueafter atee, demuxer, or dynamic pad to rule out branch blocking. - Use
GST_DEBUGto locate plugin-loading, state-transition, and negotiation errors. - Use
fpsdisplaysinkto distinguish input, codec, processing, and display bottlenecks. - Export a DOT graph to confirm the elements that were actually created and how they are connected.

