我是 Gstreamer 的新手,所以如果这个问题非常简单,我深表歉意,但我已经被困太久了。
我在树莓派上使用 Mopidy 通过扬声器播放音乐。当 Mopidy 播放时,我希望能够使一些灯光与低频段、中频和高频段同步。据我了解,Mopidy 在后端使用 Gstreamer,您可以通过指定来自定义管道
[audio]
output= spectrum bands=3 ! autoaudiosink
我需要在频谱和接收器之间放置一些东西,以分析“频谱”在总线上发布的元素消息(除非有人有更好的主意)。我正在尝试在 python 中编写一个简单的元素,它通过音频但有一个可以实现我的自定义逻辑的消息处理元素。但是,我什至无法从简单的在线示例开始,因为我不知道如何让注册的元素让 gstreamer 识别它。当我遵循https://github.com/GStreamer/gst-python/blob/master/examples/plugins/python/identity.py上的 gst-python identity.py 示例时,规定的说明不起作用。
jlc@FuzzPi:~/Rise $ export GST_PLUGIN_PATH=$GST_PLUGIN_PATH:$PWD
jlc@FuzzPi:~/Rise $ GST_DEBUG=python:4 gst-launch-1.0 fakesrc num-buffers=10 ! identity_py ! fakesink
WARNING: erroneous pipeline: no element "identity_py"
我已经尝试了所有可以想象的 GST_PLUGIN_PATH,并尝试了我能找到的每个在线帖子中的所有内容,我可能只是错过了一些非常基本的东西,但我真的可以用手弄清楚我错过了什么!据我所知,这不应该这么复杂。
我的操作系统是 Ubuntu MATE 16.04,我所有的 gstreamer 包的版本都是 >1.6
jlc@FuzzPi:~/Rise $ dpkg -l | grep gst
ii gir1.2-gst-plugins-base-1.0 1.8.3-1ubuntu0.2 armhf GObject introspection data for the GStreamer Plugins Base library
ii gir1.2-gstreamer-1.0 1.8.3-1~ubuntu0.1 armhf GObject introspection data for the GStreamer library
ii gstreamer1.0-alsa:armhf 1.8.3-1ubuntu0.2 armhf GStreamer plugin for ALSA
ii gstreamer1.0-clutter-3.0 3.0.18-1 armhf Clutter PLugin for GStreamer 1.0
ii gstreamer1.0-libav:armhf 1.8.3-1ubuntu0.2 armhf libav plugin for GStreamer
ii gstreamer1.0-nice:armhf 0.1.13-0ubuntu2 armhf ICE library (GStreamer plugin)
ii gstreamer1.0-plugins-base:armhf 1.8.3-1ubuntu0.2 armhf GStreamer plugins from the "base" set
ii gstreamer1.0-plugins-good:armhf 1.8.3-1ubuntu0.4 armhf GStreamer plugins from the "good" set
ii gstreamer1.0-plugins-ugly:armhf 1.8.3-1ubuntu0.1 armhf GStreamer plugins from the "ugly" set
ii gstreamer1.0-plugins-ugly-amr:armhf 1.8.3-1ubuntu0.1 armhf GStreamer plugins from the "ugly" set
ii gstreamer1.0-pulseaudio:armhf 1.8.3-1ubuntu0.4 armhf GStreamer plugin for PulseAudio
ii gstreamer1.0-tools 1.8.3-1~ubuntu0.1 armhf Tools for use with GStreamer
ii gstreamer1.0-x:armhf 1.8.3-1ubuntu0.2 armhf GStreamer plugins for X11 and Pango
ii libclutter-gst-3.0-0:armhf 3.0.18-1 armhf Open GL based interactive canvas library GStreamer elements
ii libgstreamer-plugins-base1.0-0:armhf 1.8.3-1ubuntu0.2 armhf GStreamer libraries from the "base" set
ii libgstreamer-plugins-good1.0-0:armhf 1.8.3-1ubuntu0.4 armhf GStreamer development files for libraries from the "good" set
ii libgstreamer1.0-0:armhf 1.8.3-1~ubuntu0.1 armhf Core GStreamer libraries and elements
ii libreoffice-avmedia-backend-gstreamer 1:5.1.6~rc2-0ubuntu1~xenial1 armhf GStreamer backend for LibreOffice
ii python-gst-1.0 1.6.2-1build1 armhf GStreamer GObject Introspection overrides for Python
ii python-gst-1.0-dbg 1.6.2-1build1 armhf GStreamer GObject Introspection overrides for Python (debug extensions)