October 18, 2016 - Thibault Saunier

Improving Debugging in GStreamer Validate

Debugging GStreamer is often a hard and time-consuming task; because of this, the community has been working to enhance debugging tools and make it simpler in the gst-devtools official module and its gst-validate component (you can find more information about this in my previous post).

Lately, we’ve decided to take a step forward and enhance the GStreamer validate reports for specific and very common GStreamer issues. We started with the classic Not Negotiated Error which basically happens when the elements in the pipeline are not able to agree on a data format (Caps) in which to do the processing. This can happen for many reasons, and until recently, the only way to figure out what went wrong was to read verbose and sometimes hard to read GStreamer debug logs; this is time consuming, particularly for people who are not very familiar with GStreamer. Starting from the next 1.10 release, GstValidate will attempt to explain the precise reason and place in the pipeline where the negotiation could not properly occur. Basically, we started caching information about negotiation events in the pipeline (query caps queries and accept caps events) in the GstValidateMonitor-s so that we can figure out what led to the error and report it.

Examples of New Debugging Helpers

For example, for the following pipeline that can’t be negotiated:

GstValidate will output the following report:

Which explains in ‘plain English’ that the data coming inside capsfilter is an audio stream, but we’re trying to force a video stream using the capsfilter, which is simply not possible and thus, produces the Not Negotiated Error.

Here’s another example where the problem happens later in the negotiation (during the ACCEPT_CAPS event):

GStreamer validate will report the following issue:

This informs us there is incompatibility in the ‘channel-mask’ field of the caps proposed by the audioconvert element and the caps we are forcing to be used in the capsfilter (this seems to be a bug in audioconvert as it does not take into account the value returned during QUERY_CAPS).

GstValidate is now also able to add backtraces to its reports if the user explicitly asks for them by setting the GST_VALIDATE_REPORTING_DETAILS variable to all for the wanted messages. The backtraces will contain the stack leading to the message report with the source files names and line numbers.

We are planning to add more of these detailed reports as we have a good idea of  how to do it. Finally, if you have any ideas to contribute to this, please let us know either in the comments here or on the gstreamer-devel mailing list.

Thibault Saunier

About Thibault Saunier

Thibault Saunier is an open source Multimedia engineer mostly developing and maintaining the GStreamer framework and the Pitivi Video editor.

Image Credits: Open Source Way

Development / GStreamer Caps Negotiation / Debugging / GstValidate /

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments Protected by WP-SpamShield Anti-Spam