简体   繁体   English

从描述创建QtGStreamer管道的问题

[英]Issue with creating QtGStreamer pipeline from description

I am using the Qt GStreamer wrappers and trying to create a pipeline as follows: 我正在使用Qt GStreamer包装器,并尝试如下创建管道:

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: gstreamer管道具有:

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): 在GStreamer中,这是上限(元素功能)的语法:

video/x-raw,width=100,height=100 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. 如果希望管道解析,则可以在末尾添加一个identity That'll yield raw 100x100 video frames, of some undetermined colorspace. 这将产生原始的100x100视频帧,具有一些不确定的色彩空间。

And as you're probably aware, that pipeline won't do anything until you hook up a sink to it. 您可能已经知道,在将接收器连接到该管道之前,该管道不会做任何事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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