Luca
Luca

Reputation: 10996

Issue with creating QtGStreamer pipeline from description

I am using the Qt GStreamer wrappers and trying to create a pipeline as follows:

QGst::ElementPtr bin = 
    QGst::Bin::fromDescription("videotestsrc ! videoscale 
    ! video/x-raw,width=100,height=100");

However, when I run this, I get the error:

GStreamer-CRITICAL **: gst_bin_add: assertion 'GST_IS_ELEMENT (element)' failed
terminate called after throwing an instance of 'QGlib::Error'
what():  no element "video"

I think that there is some issue with the "/" but not sure how to fix it.

The gstreamer pipeline with:

gst-launch-1.0 -v  videotestsrc ! videoscale ! video/x-raw,width=100,height=100 
! xvimagesink -e --gst-debug-level=3 sync=false

works fine.

I tried by escaping the quotation marks like:

QGst::ElementPtr bin = 
    QGst::Bin::fromDescription(\""videotestsrc ! videoscale 
    ! video/x-raw,width=100,height=100\"");

but this gives:

terminate called after throwing an instance of 'QGlib::Error'
what():  specified empty bin "bin", not allowed

Upvotes: 0

Views: 758

Answers (1)

mpr
mpr

Reputation: 3378

In GStreamer this is the syntax for caps (element capabilities):

video/x-raw,width=100,height=100

The parser expects it to be between two elements to determine how they should join up. It's not an element itself. If you want the pipeline to parse you could add an identity at the end. That'll yield raw 100x100 video frames, of some undetermined colorspace.

And as you're probably aware, that pipeline won't do anything until you hook up a sink to it.

Upvotes: 1

Related Questions