我是kivy和python的新手。对于一个项目,我想创建一个带有显示视频的kivy的桌面应用程序。当我运行代码时,出现错误“无法创建播放箱”
有人可以帮我吗?
mainKivyApp.py
import kivy
from kivy.app import App
from kivy.uix.relativelayout import RelativeLayout
class video_player(RelativeLayout):
pass
class video(App):
def build(self):
return video_player()
if __name__ == "__main__":
video().run()
video.kv
<video_player>:
Video:
source: "../example.mp4"
play: True
奇异果日志:
[INFO ] Kivy: v1.10.1
[INFO ] Python: v3.6.8 (v3.6.8:3c6b436a57, Dec 24 2018, 02:04:31)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]
[INFO ] Factory: 194 symbols loaded
[INFO ] Image: Providers: img_tex, img_imageio, img_dds, img_sdl2,
img_gif (img_pil, img_ffpyplayer ignored)
[INFO ] Window: Provider: sdl2
[INFO ] GL: Using the "OpenGL ES 2" graphics system
[INFO ] GL: Backend used <gl>
[INFO ] GL: OpenGL version <b'2.1 INTEL-12.4.7'>
[INFO ] GL: OpenGL vendor <b'Intel Inc.'>
[INFO ] GL: OpenGL renderer <b'Intel(R) Iris(TM) Plus Graphics 640'>
[INFO ] GL: OpenGL parsed version: 2, 1
[INFO ] GL: Shading version <b'1.20'>
[INFO ] GL: Texture max size <16384>
[INFO ] GL: Texture max units <16>
[INFO ] Window: auto add sdl2 input provider
[INFO ] Window: virtual keyboard not allowed, single mode, not docked
[INFO ] VideoGstplayer: Using Gstreamer 1.10.4.0
[INFO ] Video: Provider: gstplayer
[ERROR ] Image: Error loading texture ../example.mp4
[INFO ] Base: Start application main loop
[INFO ] Base: Leaving application in progress...
答案 0 :(得分:0)
答案 1 :(得分:0)
似乎确实是另外一个问题。对我来说,brew install gst-plugins-bad
也没有为我解决问题。
所做的工作是删除我的kivy安装程序中的“ gstplayer”。您可以在“ site-packages / kivy / lib / gstplayer”中的任何位置进行kivy安装
做rm -R site-packages/kivy/lib/gstplayer
同样,此路径应替换为本地安装路径。
基于kivy github网站上this issue中此处的评论。 该目录称为“ gstreamer”。在我的安装中,它被称为“ gstplayer”。
删除该目录后,将显示视频窗口。