如何在 Rust 中指定 Gstreamer 的上限?

发布于 2025-01-12 23:58:20 字数 444 浏览 3 评论 0原文

当我这样做时:

gst-launch-1.0 v4l2src ! videoconvert ! waylandink

我从 gst-device-monitor-1.0 获得视频流,我可以说它是 video/x-raw

当我这样做时:

gst-launch-1.0 v4l2src ! video/x-h264 ! avdec_h264 ! videoconvert ! waylandink

我得到编码流而不是原始的。

我的问题是:如何在 Rust 中为我的源元素指定上限 video/x-h264 ? 我可以使用 set-property 方法更改宽度、高度或帧速率,但我找不到如何从 raw 更改为 h264

When I do:

gst-launch-1.0 v4l2src ! videoconvert ! waylandink

I get a video stream and from gst-device-monitor-1.0 I can say it's video/x-raw

When I do:

gst-launch-1.0 v4l2src ! video/x-h264 ! avdec_h264 ! videoconvert ! waylandink

I get the encoded stream instead of the raw one.

My question is: how can I specify the caps video/x-h264 for my source element in Rust?
I can use the set-property method to change the width, height, or framerate but I can't find how to change from raw to h264

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

太阳哥哥 2025-01-19 23:58:20

gst-launch 中的语法

! caps !

会自动创建 capsfilter 元件。

在 Rust 代码中,您将显式创建 capsfilter 元素。

The syntax

! caps !

in gst-launch automatically creates a capsfilter element.

In your Rust code, you would create the capsfilter element explicitly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文