kivy - Trying to load a video gets a gstreamer error

筅森魡賤 提交于 2020-01-25 02:30:11

问题


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'

But I get this error:

kivy.lib.gstplayer._gstplayer.GstPlayerException: Unable to create a playbin

I'm certain that gstreamer is correctly installed. I have the 1.6.2.0 version.

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.

Someone please help me.

Thanks


回答1:


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

Alternatively you can install Kivy using the following steps:

1.Install the requirements using homebrew:

$ brew install sdl2 sdl2_image sdl2_ttf sdl2_mixer gstreamer

2.Install cython 0.23 and kivy using pip:

$ pip install -I Cython==0.23
$ USE_OSX_FRAMEWORKS=0 pip install kivy

And now the gstreamer works fine. You need to install the properly gst-plugins thought.




回答2:


Thats mostly because you are missing 'gstreamer0.10-ffmpeg' package, see:

https://bugs.launchpad.net/ubuntu/+s...g/+bug/1275556

You'd have to install it from a ppa

sudo add-apt-repository ppa:mc3man/trusty-media

sudo apt-get update

sudo apt-get install gstreamer0.10-ffmpeg


来源:https://stackoverflow.com/questions/36460305/kivy-trying-to-load-a-video-gets-a-gstreamer-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!