admin管理员组文章数量:1315290
Need to change video resolution on the fly via GStreamer
. Here is its pipeline fragment:
...
"! vaapih264enc name=encoder rate-control=cbr quality-level=7 keyframe-period=8 ",
"! video/x-h264, profile=constrained-baseline, width=640, height=480 ",
"! h264parse config-interval=1 ",
...
AFAIK, the solution is to manage capsfilter
between vaapih264enc
and h264parse
. I have managed to get vaapih264enc
byt it's name:
auto encoder = gst_bin_get_by_name_recurse_up(media, "encoder");
And I've also managed to get it's sink:
auto sink = GST_PAD(context->encoder->sinkpads->data);
But I cannot find a way to get GstCaps
object and to set it's properties. Can anybody help?
Need to change video resolution on the fly via GStreamer
. Here is its pipeline fragment:
...
"! vaapih264enc name=encoder rate-control=cbr quality-level=7 keyframe-period=8 ",
"! video/x-h264, profile=constrained-baseline, width=640, height=480 ",
"! h264parse config-interval=1 ",
...
AFAIK, the solution is to manage capsfilter
between vaapih264enc
and h264parse
. I have managed to get vaapih264enc
byt it's name:
auto encoder = gst_bin_get_by_name_recurse_up(media, "encoder");
And I've also managed to get it's sink:
auto sink = GST_PAD(context->encoder->sinkpads->data);
But I cannot find a way to get GstCaps
object and to set it's properties. Can anybody help?
1 Answer
Reset to default 1In order to get the GstCaps you need to get the GstSample and the GstAppsink first. Based on the code you showed, you could do something like this:
auto appsink = GST_APP_SINK(sink);
auto sample = gst_app_sink_pull_sample(appsink)
auto caps = gst_sample_get_caps(sink);
本文标签: cSet up GstCaps on runtimeStack Overflow
版权声明:本文标题:c++ - Set up GstCaps on runtime - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741965712a2407534.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论