I'm running Ubuntu 16.04 with Anaconda Python distribution. I installed gstreamer-1.0 libraries using Synaptic. I wanted to test my installation with: gst-inspect-1.0 fakesrc
(as suggested in the docs) but I get the following error:
我使用的是Anaconda Python发行版Ubuntu 16.04。我使用Synaptic安装了gstreamerl -1.0库。我想测试我的安装:gst- inspection -1.0 fakesrc(正如在文档中建议的那样),但我有以下错误:
No such element or plugin 'fakesrc'
没有这样的元素或插件的fakesrc。
So, I tried just typing gst-inspect-1.0
. This told me that it looks like none of the plugins were successfully installed:
所以,我试着输入gst- inspection -1.0。这告诉我,看起来没有一个插件被成功安装:
staticelements: bin: Generic bin
staticelements: pipeline: Pipeline object
Total count: 1 plugin, 2 features
I don't understand why no plugins are found because I had already installed through Synaptic the libraries: libgstreamer-plugins-bad1.0
,libgstreamer-plugins-base1.0
,libgstreamer-plugins-good1.0
, libgstreamer-1.0-0
as well as all the -dev
versions. I also made sure that I removed the old gstreamer0.10*
plugins so that they wouldn't interfere.
我不明白为什么没有找到插件,因为我已经在Synaptic上安装了:libgstreamerl -plugins-bad1.0,libgstreamer-plugins-base1.0,libgstreamer-plugins-good1.0, libgstreamerl -1.0-0,以及所有的-dev版本。我还确保删除了旧的gstreamer0.10*插件,这样它们就不会干扰了。
Finally, I checked the output of pkg-config --cflags --libs gstreamer-1.0
and noticed something that might be causing the problem:
最后,我检查了pkg-config—cflags—libs gstreamer-1.0的输出,并注意到可能导致问题的一些东西:
-pthread -I/home/guel/anaconda2/include/gstreamer-1.0
-I/home/guel/anaconda2/lib/gstreamer-1.0/include
-I/home/guel/anaconda2/include/glib-2.0
-I/home/guel/anaconda2/lib/glib-2.0/include
-I/home/guel/anaconda2/include
-L/home/guel/anaconda2/lib -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0
It looks like the required libraries are inside the Anaconda directories. Could that somehow prevent the gst-inspect-1.0
binary (which is in /usr/bin
) to link to those libraries? My PKG_CONFIG_PATH
contains the directory /home/guel/anaconda2/lib/pkgconfig
.
看起来需要的库都在Anaconda目录中。这是否可以阻止gst- inspection -1.0二进制文件(在/usr/bin中)链接到这些库?我的PKG_CONFIG_PATH包含目录/home/guel/anaconda2/lib/pkgconfig。
Sorry if the question is too naive; I'm a beginner with pkg-config
and linking libraries.
对不起,如果这个问题太天真了;我是一个使用pkg-config和链接库的初学者。
1 个解决方案
#1
0
I solved the problem by first realizing that I had modified my PKG_CONFIG_PATH
in my .bashrc
file in order to add some custom pkgconfig
paths for libraries like ffmpeg and anaconda (I had added e.g. /opt/ffmpeg/lib/pkgconfig
). However, I forgot to keep the default paths in PKG_CONFIG_PATH
and simply overwritten the variable with the new ones with export
command.
我解决了这个问题,首先意识到我在.bashrc文件中修改了PKG_CONFIG_PATH,以便为像ffmpeg和anaconda这样的库添加一些自定义的pkgconfig路径(我已经添加了例如/opt/ffmpeg/lib/pkgconfig)。但是,我忘记了在PKG_CONFIG_PATH中保留默认路径,并简单地将变量覆盖到带有导出命令的新变量。
The answer here helped me figure out where pkg-config searches for installed libraries by default. The default path includes the /usr/lib/x86_64-linux-gnu/pkgconfig
directory where all gstreamer-*-1.0.pc
are present. Therefore, it was just necessary to keep the default search paths of pkg-config so that the system could locate the gstreamer plugins.
这里的答案帮助我找到了pkg-config在默认情况下如何搜索已安装的库。默认路径包括/usr/lib/x86_64-linux-gnu/pkgconfig目录,其中所有gstreamer-*-1.0。电脑存在。因此,必须保留pkg-config的默认搜索路径,以便系统能够定位gstreamer插件。
#1
0
I solved the problem by first realizing that I had modified my PKG_CONFIG_PATH
in my .bashrc
file in order to add some custom pkgconfig
paths for libraries like ffmpeg and anaconda (I had added e.g. /opt/ffmpeg/lib/pkgconfig
). However, I forgot to keep the default paths in PKG_CONFIG_PATH
and simply overwritten the variable with the new ones with export
command.
我解决了这个问题,首先意识到我在.bashrc文件中修改了PKG_CONFIG_PATH,以便为像ffmpeg和anaconda这样的库添加一些自定义的pkgconfig路径(我已经添加了例如/opt/ffmpeg/lib/pkgconfig)。但是,我忘记了在PKG_CONFIG_PATH中保留默认路径,并简单地将变量覆盖到带有导出命令的新变量。
The answer here helped me figure out where pkg-config searches for installed libraries by default. The default path includes the /usr/lib/x86_64-linux-gnu/pkgconfig
directory where all gstreamer-*-1.0.pc
are present. Therefore, it was just necessary to keep the default search paths of pkg-config so that the system could locate the gstreamer plugins.
这里的答案帮助我找到了pkg-config在默认情况下如何搜索已安装的库。默认路径包括/usr/lib/x86_64-linux-gnu/pkgconfig目录,其中所有gstreamer-*-1.0。电脑存在。因此,必须保留pkg-config的默认搜索路径,以便系统能够定位gstreamer插件。