I'm trying this simple example to play a video using Kivy:
from kivy.app import App
from kivy.uix.videoplayer import VideoPlayer
class TestApp(App):
vid = None
def replay(self, instance, value):
if value != "play":
# self.vid.play = True
self.vid.state = "play"
def build(self):
self.vid = VideoPlayer(source="./S02E02.mp4", state="play")
# self.vid.bind(state=self.replay) # When state changes, if not playing, play it
return self.vid
TestApp().run()
The main window and the video player is shown, \bBut the video is not loaded and played. And I have this as output:
[INFO ] [Logger ] Record log in /home/villar/.kivy/logs/kivy_18-08-21_0.txt
[INFO ] [Kivy ] v1.10.1
[INFO ] [Python ] v3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0]
[INFO ] [Factory ] 194 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_gif (img_ffpyplayer ignored)
[INFO ] [Text ] Provider: sdl2
[INFO ] [Video ] Provider: null(['video_ffmpeg', 'video_ffpyplayer'] ignored)
[INFO ] [Window ] Provider: sdl2(['window_egl_rpi'] ignored)
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] Backend used <gl>
[INFO ] [GL ] OpenGL version <b'3.0 Mesa 18.0.5'>
[INFO ] [GL ] OpenGL vendor <b'Intel Open Source Technology Center'>
[INFO ] [GL ] OpenGL renderer <b'Mesa DRI Intel(R) HD Graphics 630 (Kaby Lake GT2) '>
[INFO ] [GL ] OpenGL parsed version: 3, 0
[INFO ] [GL ] Shading version <b'1.30'>
[INFO ] [GL ] Texture max size <16384>
[INFO ] [GL ] Texture max units <32>
[INFO ] [Window ] auto add sdl2 input provider
[INFO ] [Window ] virtual keyboard not allowed, single mode, not docked
[ERROR ] [Image ] Error reading file ./S02E02.png
[INFO ] [ProbeSysfs ] device match: /dev/input/event13
[INFO ] [MTD ] Read event from </dev/input/event13>
[INFO ] [ProbeSysfs ] device match: /dev/input/event7
[INFO ] [MTD ] Read event from </dev/input/event7>
[INFO ] [Base ] Start application main loop
[INFO ] [MTD ] </dev/input/event13> range position X is 0 - 1228
[INFO ] [MTD ] </dev/input/event7> range position X is 1278 - 5664
[INFO ] [MTD ] </dev/input/event13> range position Y is 0 - 928
[INFO ] [MTD ] </dev/input/event7> range position Y is 1206 - 4646
[INFO ] [MTD ] </dev/input/event13> range touch major is 0 - 0
[INFO ] [MTD ] </dev/input/event7> range touch major is 0 - 0
[INFO ] [MTD ] </dev/input/event13> range touch minor is 0 - 0
[INFO ] [MTD ] </dev/input/event7> range touch minor is 0 - 0
[INFO ] [MTD ] </dev/input/event13> range pressure is 0 - 255
[INFO ] [MTD ] </dev/input/event7> range pressure is 0 - 255
[INFO ] [MTD ] </dev/input/event13> axes invertion: X is 0, Y is 0
[INFO ] [MTD ] </dev/input/event7> axes invertion: X is 0, Y is 0
[INFO ] [MTD ] </dev/input/event13> rotation set to 0
[INFO ] [MTD ] </dev/input/event7> rotation set to 0
[ERROR ] [Image ] Error loading texture ./S02E02.mp4
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Base ] Leaving application in progress...
The video file S02E02.mp4
is in the same directory as the python script.
The kivy version I use is 1.10.1, with Python 3.6 and Ubuntu 18.04. I installed Kivy using pip3
Does anybody knows why the video is not playing?