kivy - Trying to load a video gets a gstreamer err

2019-08-11 22:33发布

问题:

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