gstreamer caps 语法是什么?
gstreamer 中用于指定媒体功能的 caps 的语法是什么? Caps 是指定允许的媒体类型的字符串,看起来像“audio/x-raw-int,...”,但我无法找到关于 caps 字符串中允许的内容的良好文档。
What is the syntax for caps, specifying media capabilities, in gstreamer? Caps are strings that specify the type of media allowed and look like "audio/x-raw-int,..." but I haven't been able to find good documentation on exactly what is allowed in a caps string.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
我不确定你的问题是关于语法的,但是 “定义类型列表”可能会有所帮助。
I'm unsure due to your question is about syntax, but "list of defined types" may be helpful.
部分答案,我相信您已经解决了:
正式地,大写字母不是由字符串表示,而是由包含 GstStructures 数组的 GstCaps 对象表示。请参阅此处的文档。
也许如果我们在这里找到明确的答案,我们可以提交函数
gst_caps_from_string()
的文档补丁a partial answer, which i'm sure you've worked out already:
formally, caps are not represented by strings but by a GstCaps object containing an array of GstStructures. see the documentation here.
perhaps if we work out a definitive answer here we could submit a documentation patch for the function
gst_caps_from_string()
来自 x264enc 源代码: https 对于此CAPS, ://github.com/GStreamer/gst-plugins-ugly/blob/master/ext/x264/gstx264enc.c#L693-L704
,当通过gst-inspect检查时,它就像:
from x264enc source code: https://github.com/GStreamer/gst-plugins-ugly/blob/master/ext/x264/gstx264enc.c#L693-L704
for this CAPS, when inpstected by gst-inspect, it's like:
语法是:
请注意,该类型不是 MIME 类型,无论它看起来有多像。
您可以使用
gst-inspect
找出哪些 caps 属性元素支持。它将为元素的焊盘提供“焊盘模板”,它将指定支持的上限范围。GStreamer 插件编写者指南还包含一个 列表定义类型,描述常见音频、视频和图像格式的属性。
The syntax is:
Note that the type is not a MIME type, however much it may look like one.
You can find out which caps properties elements support by using
gst-inspect
. It will proviide "pad templates" for the element's pads, which will specify the ranges of caps supported.The GStreamer plugin writer's guide also contains a list of defined types which describes properties for common audio, video and image formats.
在 Java 中,对于 gstreamer-java
在 C 中,假设您想要 videoscale caps 过滤器,
然后设置属性
,然后您可以将它们添加到 bin 中并以使用 gst-launch 构建媒体管道的方式链接它们
In Java, for gstreamer-java
In C, say you want videoscale caps filter
then set properties
then you could add these to bin and link them the way you have constructed media pipeline using gst-launch
据我了解,这是格式:
Here is the format as far as I understand it:
我发现你在寻找音频。
我只会给你长版本,你可以删除或更改不需要的部分。但它在 GStreamer 0.10 和 GStreamer 1.0 之间发生了变化。我将同时给出:
对于 GStreamer 0.10:
对于 GStreamer 1.0:
如您所见,对于 1.0,您将需要组合音频格式。 S16LE 表示有符号 + int + 16 宽度 + 小尾数 (=1234)。
I see you are after audio.
I'll just give you the long version, you can drop or change the parts you don't need. It changes between GStreamer 0.10 and GStreamer 1.0 though. I'll give both:
for GStreamer 0.10:
for GStreamer 1.0:
As you can see, with 1.0, you will need to combine the audio format. S16LE means signed + int + 16 width + little endian (=1234).
这就是我在 python 中使用它的方式...HTH
This is how i use it in python...HTH