简体   繁体   English

加载自定义gstreamer插件会引发gst.ElementNotFoundError

[英]loading custom gstreamer plugin raises gst.ElementNotFoundError

I'm trying to set GST_PLUGIN_PATH environment variable before loading custom gstreamer plugin in an integration test, so I need to change GST_PLUGIN_PATH programmatically. 我正在尝试在集成测试中加载自定义gstreamer插件之前设置GST_PLUGIN_PATH环境变量,因此我需要以编程方式更改GST_PLUGIN_PATH

But without GST_PLUGIN_PATH set in shell, gst.element_factory_make fails. 但是,如果没有在外壳GST_PLUGIN_PATH设置gst.element_factory_make ,则gst.element_factory_make失败。

I'm using gstreamer-0.10, python2.6 and linux 3.2.0 (debian 6). 我正在使用gstreamer-0.10,python2.6和linux 3.2.0(debian 6)。

Example: 例:

import gst, os
os.environ['GST_PLUGIN_PATH'] = '/tmp'
print gst.element_factory_make('myelem')

Without GST_PLUGIN_PATH set in shell: 在shell中GST_PLUGIN_PATH设置GST_PLUGIN_PATH

$ export GST_PLUGIN_PATH=
$ ./gstpathtest.py
Traceback (most recent call last):
  File "./gstpathtest.py", line 7, in <module>
    print gst.element_factory_make('myelem')
gst.ElementNotFoundError: myelem

With GST_PLUGIN_PATH set in shell: 在外壳中设置了GST_PLUGIN_PATH

$ GST_PLUGIN_PATH=/tmp ./gstpathtest.py
/MyElem:myelem0 (__main__.MyElem)

or with GST_PLUGIN_PATH exported in shell: 或在外壳中导出GST_PLUGIN_PATH

$ export GST_PLUGIN_PATH=/tmp
$ ./gstpathtest.py
/MyElem:myelem0 (__main__.MyElem)

When run with GST_DEBUG=6 I noticed that myelem gets created but is immediately unref-ed and destroyed, which is probably the cause of the error. 当以GST_DEBUG=6运行时,我注意到myelem创建,但立即被未引用和破坏,这可能是错误的原因。

I even tried to add the path to os.environ['PATH'] , or directly to sys.path but it didn't change anything. 我什至尝试将路径添加到os.environ['PATH'] ,或直接添加到sys.path但没有任何改变。

My main question is: am I doing something wrong on python-level (and what exactly) or does it indicate some bug in the myelem plugin itself? 我的主要问题是:我在python级别上做错了什么(以及究竟是什么),或者它表明myelem插件本身存在一些错误?

噢,愚蠢的我-如果我在导入gst之前设置了os.environ['GST_PLUGIN_PATH'] ,那么一切都会按预期进行。

Also, gst.registry.scan_path works: 此外, gst.registry.scan_path可以工作:

import gst
gst.registry_get_default().scan_path('/tmp')
print gst.element_factory_make('myelem')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 python的gst.LinkError问题的Gstreamer - Gstreamer of python's gst.LinkError problem 带有Python 2.7的GStreamer无法导入GST - GStreamer with Python 2.7 cannot import gst Anaconda Gstreamer Gst 包装缺少“jpegenc” - Anaconda Gstreamer Gst packge lacking “jpegenc” GStreamer-CRITICAL **:gst_element_make_from_uri:断言“ gst_uri_is_valid(uri)”失败 - GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed 自定义中间件类引发错误 - Custom middleware class raises error 链接元素时,GStreamer错误“声明&#39;GST_IS_ELEMENT(src)&#39;失败” - GStreamer error “assertion 'GST_IS_ELEMENT (src)' failed” when linking elements 如何在Mac OSX上轻松安装gst-python(gstreamer python bind)? - How to install gst-python (gstreamer python bind) on Mac OSX the easy way? 为什么&#39;gst.Element.get_request_pad(self.filter,&#39;filter&#39;)&#39;返回&#39;None&#39;(gstreamer | python) - why 'gst.Element.get_request_pad(self.filter, 'filter')' returns 'None' (gstreamer | python) 如何通过将 gstreamer 与 python 子进程模块或 gst-launch-1.0 命令一起使用来接收字节流? - How to receive byte-stream by using gstreamer with python subprocess module or gst-launch-1.0 command? django中的自定义用户引发了ValueError - Custom user in django raises ValueError
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM