kivy-尝试加载视频会遇到gstreamer错误 [英] kivy - Trying to load a video gets a gstreamer error
问题描述
我是新手,并且正在OSX中工作.我正在尝试通过以下方式使用kivy.uix.video的Video类实现播放视频的简单示例:
I'm new in kivy and I'm working in OSX. I'm trying to implement a simple example of playing a video using the Video class from kivy.uix.video in this way:
Video:
id: video
source: 'resources/videos/testVideo.mpg'
state: 'play'
但是我得到这个错误:
kivy.lib.gstplayer._gstplayer.GstPlayerException: Unable to create a playbin
我确定gstreamer已正确安装.我有1.6.2.0版本.
I'm certain that gstreamer is correctly installed. I have the 1.6.2.0 version.
有人可以帮我吗?我一直在尝试研究此错误,这似乎是因为未安装gstreamer ...但我不确定.
Can someone help me with this? I've been trying to research on this error, and seems that is because the gstreamer is not installed... but I'm not sure.
请帮助我.
谢谢
推荐答案
我终于解决了这个问题.我在OSX上使用的是kivy的便携式版本.我使用kivy文档站点中显示的pip重新安装了kivy:
I finally solved this issue. I was using the portable version of kivy for OSX. I re-installed kivy myself using pip as it is shown in the kivy documentation site:
https://kivy.org/docs/installation/installation- osx.html#using-pip
或者,您可以按照以下步骤安装Kivy:
Alternatively you can install Kivy using the following steps:
1.使用自制软件安装要求:
1.Install the requirements using homebrew:
$ brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer
2.使用pip安装cython 0.23和kivy:
2.Install cython 0.23 and kivy using pip:
$ pip install -I Cython==0.23
$ USE_OSX_FRAMEWORKS=0 pip install kivy
现在gstreamer可以正常工作.您需要安装正确的gst-plugins.
And now the gstreamer works fine. You need to install the properly gst-plugins thought.
这篇关于kivy-尝试加载视频会遇到gstreamer错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!