GStreamer gst_element_factory_make 失败

发布于 2024-08-10 07:46:10 字数 986 浏览 4 评论 0原文

我正在尝试 GStreamer 测试应用程序,但在运行时以下行失败:

demuxer = gst_element_factory_make ("oggdemux", "ogg-demuxer"); // returns NULL

我使用 MacOSX 并通过 MacPorts 安装了 GStreamer、libogg 和 vorbis-tools。所以我不明白为什么它会失败。

关于如何使其发挥作用有什么建议吗?

编辑:已解决!

问题是我需要从 gst-plugins-good 包安装自动检测插件。

以下是使其发挥作用的操作列表:

删除 MacPorts 安装:

sudo port uninstall gstreamer

将以下行添加到 ~/.profile

export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

下载 gstreamer、gstreamer-plugins-base 和 gstreamer-plugins-good 源。

构建并安装 gstreamer (./configure, make, make install)

构建并安装 gstreamer-plugins-base (./configure, make, make install)

对于 gstreamer-plugins-good 我只构建了自动检测包,因为构建所有结果一些我现在不需要或不关心的插件的错误。我是这样做的:

./configure
cd gst/autodetect/
make
sudo make install

现在程序已构建并运行。然而我似乎没有得到任何音频输出:(但这是另一个问题。

I'm trying out a GStreamer test application, but at runtime the following line fails:

demuxer = gst_element_factory_make ("oggdemux", "ogg-demuxer"); // returns NULL

I am using MacOSX and installed GStreamer, libogg and vorbis-tools through MacPorts. So I don't see why it fails.

Any suggestions on how to make it work?

EDIT: SOLVED!

The problem was that I needed to install the autodetect plugin from the gst-plugins-good package.

Here's a list of actions that made it work:

Remove the MacPorts installation:

sudo port uninstall gstreamer

Add the following line to ~/.profile

export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

Download gstreamer, gstreamer-plugins-base and gstreamer-plugins-good sources.

Build and install gstreamer (./configure, make, make install)

Build and install gstreamer-plugins-base (./configure, make, make install)

And for gstreamer-plugins-good I only built the autodetect package because building all resulted in errors for some plugins that I don't need or care about now. I did it like this:

./configure
cd gst/autodetect/
make
sudo make install

Right now the program builds and runs. I don't seem to be getting any audio output however :( but that's another issue.

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

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

发布评论

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

评论(2

另类 2024-08-17 07:46:10

读取gstelementfactory.c(GStreamer版本0.10.25)第463行(gst_element_factory_make函数定义),存在三个导致NULL返回的错误:

  1. 第一个参数 ('factoryname') 是 NULL (显然在您的代码中没问题)
  2. 找不到指定的元素工厂(函数 gst_element_factory_find 返回 NULL code>)
  3. 无法创建元素实例(函数 gst_element_Factory_create 返回 NULL

该代码执行大量日志记录,因此如果您能够打开此功能,那么您可能会得到进一步的提示至于根本问题。

要检查 oggdemux 插件是否配置正确,请尝试运行:

gst-inspect oggdemux

如果未返回结果,请尝试使用 gst-register 来注册它。

Reading gstelementfactory.c (GStreamer version 0.10.25) line 463 (gst_element_factory_make function definition), there are three errors which cause a NULL return:

  1. The first argument ('factoryname') is NULL (obviously OK in your code)
  2. The named element factory could not be found (the function gst_element_factory_find returned NULL)
  3. The element instance could not created (the function gst_element_Factory_create returned NULL)

The code performs substantial logging so if you are able to turn this on then you may get further hints as to the underlying problem.

To check that the oggdemux plugin is configured correctly, try running:

gst-inspect oggdemux

If this doesn't return a result, try using gst-register to register it.

战皆罪 2024-08-17 07:46:10

如果您使用的是 ubuntu 系统,只需执行以下操作

sudo apt-get install gstreamer1.0-*

即可解决问题。

If you are using the ubuntu system just do as follows

sudo apt-get install gstreamer1.0-*

this will solve the problem.

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