GStreamer gst_element_factory_make 失败
我正在尝试 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
读取
gstelementfactory.c
(GStreamer版本0.10.25)第463行(gst_element_factory_make
函数定义),存在三个导致NULL
返回的错误:NULL
(显然在您的代码中没问题)gst_element_factory_find
返回NULL
code>)gst_element_Factory_create
返回NULL
)该代码执行大量日志记录,因此如果您能够打开此功能,那么您可能会得到进一步的提示至于根本问题。
要检查 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 aNULL
return:NULL
(obviously OK in your code)gst_element_factory_find
returnedNULL
)gst_element_Factory_create
returnedNULL
)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:
If this doesn't return a result, try using
gst-register
to register it.如果您使用的是 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.