gstreamer - 您如何找出 gstreamer 配置文件字符串
问题描述
尝试使用 encodebin 及其配置文件。此处的文档: https ://gstreamer.freedesktop.org/documentation/pbutils/encoding-profile.html?gi-language=c#defining-a-gstencodingprofile-as-a-string和那里:https://gstreamer。 freedesktop.org/data/doc/gstreamer/1.9/gst-plugins-base-libs/html/gst-plugins-base-libs-encoding-profile.html#GstEncodingProfile列出示例,但它们并没有真正解释我实际上是如何构造那些字符串。
它命名了通用muxer_source_caps:video_encoder_source_caps:audio_encoder_source_caps
格式,但我从哪里获得 muxer_source_caps。application/ogg:audio/x-vorbis
从示例中完全可以正常工作。
例如,我将如何着手找出在 mp4 容器中编码为 aac 所需的配置文件。
疯狂猜测使用来自https://github.com/GStreamer/gstreamer/blob/cc55b304ef4ab1cd95f6348d33f268ccebaab8e8/docs/random/mimetypes的 mime 类型也行不通。
仅在没有 muxer_source_cap 的情况下使用时,所有尝试都失败WARNING: erroneous pipeline: could not set property "profile" in element "enc"
或出现一些更长的错误audio/x-m4a
谢谢
解决方案
至少对于 ogg 来说,虽然它不适用于我尝试过的其他格式。
通过使用gst-inspect-1.0 | grep ogg -i
oggmux 可以找到
gst-inspect-1.0 oggmux
产量,除其他外:
SINK template: 'audio_%u'
Availability: On request
Capabilities:
audio/x-vorbis
SRC template: 'src'
Availability: Always
Capabilities:
application/ogg
muxer_source_capsSRC template
是application/ogg
audio_encoder_source_capsSINK template
是audio/x-vorbis
使application/ogg:audio/x-vorbis
有时会有变量,比如layer
在 xingmux 中。这些添加如下:
audio/mpeg,mpegversion=1,layer=3
推荐阅读
- android - 如何使子项目产生 ZIP 工件
- java - 根据参数类类型创建实现类的新实例
- redux - 我刚刚开始学习 redux,我需要一些帮助如何从状态数组中删除一个项目
- python - Python条形图中的斜条
- material-ui - 表格中的水平分页
- javascript - 如何解决 github html 预览问题?
- javascript - which is correct - jsonlint or JSON.parse?
- javascript - 在动态自定义组件上进行 V-validate
- python - 复数的 Matplotlib 热图:模数和相位作为色调和值?
- postgresql - 如何从 .Bat 文件中删除密码提示?