【发布时间】:2009-11-11 09:55:50
【问题描述】:
我正在试用 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,我只构建了 autodetect 包,因为构建所有这些都会导致一些我现在不需要或不关心的插件出现错误。我是这样做的:
./configure
cd gst/autodetect/
make
sudo make install
现在程序构建并运行。但是,我似乎没有得到任何音频输出 :( 但这是另一个问题。
【问题讨论】:
-
您是否尝试过将
NULL作为第二个参数传递(它应该为您生成一个唯一的名称)? -
@Matthew Murdoch:刚刚试过,但函数仍然返回 NULL...