0

我正在使用 Qt GStreamer 包装器并尝试按如下方式创建管道:

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

但是,当我运行它时,我得到了错误:

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

我认为存在一些问题,"/"但不确定如何解决。

gstreamer 管道具有:

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

工作正常。

我尝试转义引号,例如:

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

但这给出了:

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

1 回答 1

1

在 GStreamer 中,这是 caps(元素功能)的语法:

视频/x-raw,宽度=100,高度=100

解析器期望它位于两个元素之间以确定它们应该如何连接。它本身不是一个元素。如果您希望管道解析,您可以identity在最后添加一个。这将产生一些未确定的色彩空间的原始 100x100 视频帧。

正如您可能知道的那样,在您将水槽连接到它之前,该管道不会做任何事情。

于 2016-05-31T13:24:15.077 回答