简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM