0

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
Luca
  • 10,458
  • 24
  • 107
  • 234

1 Answers1

1

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.

mpr
  • 3,250
  • 26
  • 44
  • Thanks for the reply. The pipeline I have works fine using `gst-launch`. However, it has issues when I try and create it with QtGStreamer. – Luca May 31 '16 at 13:35
  • In your QT code you don't have xvimagesink in there. Is that intentional? – mpr May 31 '16 at 13:41
  • Yes, but I use an equivalant sink. The problem happens even before the pipeline gets connected and it complains about `no element "video"`, which leads me to believe this has to do with the parsing – Luca May 31 '16 at 13:56
  • How are you connecting your sink up in QT? I don't see it anywhere in the code you listed? Did you try adding an "identity" element at the end of your pipeline in QT? The syntax you're using now is wrong. – mpr May 31 '16 at 14:05