首页 > 解决方案 > 您如何找出 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

谢谢

标签: gstreamergst-launchgst-launch-1.0

解决方案


至少对于 ogg 来说,虽然它不适用于我尝试过的其他格式。

通过使用gst-inspect-1.0 | grep ogg -ioggmux 可以找到

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 templateapplication/ogg

audio_encoder_source_capsSINK templateaudio/x-vorbis

使application/ogg:audio/x-vorbis

有时会有变量,比如layer在 xingmux 中。这些添加如下:

audio/mpeg,mpegversion=1,layer=3


推荐阅读