我需要一些关于GStreamer中caps的帮助

我需要一些关于GStreamer中caps的帮助,gstreamer,Gstreamer,我有以下管道: pipeline_str = g_strdup_printf ("rtspsrc name=source location=%s ! \ decodebin ! video/x-raw ! videoconvert ! \ textoverlay line-alignment=0 name=overlay font-desc=20 ! \ video

我有以下管道:

pipeline_str = 
            g_strdup_printf ("rtspsrc name=source location=%s ! \
                decodebin ! video/x-raw ! videoconvert ! \
                textoverlay line-alignment=0 name=overlay font-desc=20 ! \
                videoscale ! video/x-raw, width=%d, height=%d ! videorate ! \
                x264enc name=encoder bitrate=%d key-int-max=4 ! \
                video/x-h264 ! \
                h264parse config-interval=1 ! \
                video/x-h264, stream-format=byte-stream, alignment=au ! \
                rtph264pay pt=96 ! udpsink host=%s port=%d", 
                _uri.c_str(), _width, _height, _bitrate, _address.c_str(), _port);

如果我需要更改编码器中的比特率,我可以这样做:

GstElement *_encoder;
_encoder = gst_bin_get_by_name(GST_BIN(data.pipeline), "encoder");
g_object_set(G_OBJECT(_encoder), "bitrate", _bitrate, NULL);
但是,如果我需要在运行时更改宽度或高度,我无法在capfilter中插入名称:“video/x-raw name=resol,width=%d,height=%d”

错误:无法分析caps“视频/x-raw名称=分辨率,宽度=1920,高度=1080”


以这种方式,这相当于CAP的“gst_bin_get_by_name”以及如何命名CAP,当我创建管道时,使用
capsfilter
本身。您使用的语法是为了方便,因为它经常被使用

检查此处的示例:


在第一个示例中,您还应该能够设置名称。

使用
capsfilter
本身。您使用的语法是为了方便,因为它经常被使用

检查此处的示例:


在第一个示例中,您还应该能够设置名称。

回答得很好!!非常感谢你!很好的回答!!非常感谢你!