import kivy
#kivy.require('1.2.0')
from sys import argv
from os.path import dirname, join
from
kivy.app import App
from kivy.uix.videoplayer import VideoPlayer
import os
os.environ["KIVY_VIDEO"] = "ffpyplayer"
# check what formats are supported for your targeted devices
# for example try h264 video and acc audo for android using an mp4
# container
class VideoPlayerApp(App):
def build(self):
if len(argv) > 1:
filename = argv[1]
else:
curdir = dirname(__file__)
filename = join(curdir, 'vid_1.mp4')
return VideoPlayer(source='./vid_1.mp4', state='play')
if __name__ == '__main__':
VideoPlayerApp().run()
[INFO ] [Logger ] Record log in /home/.kivy/logs/kivy_24-06-26_51.txt
[INFO ] [Kivy ] v2.3.0
[INFO ] [Kivy ] Installed at "/home/.local/lib/python3.10/site-packages/kivy/__init__.py"
[INFO ] [Python ] v3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
[INFO ] [Python ] Interpreter at "/usr/bin/python3"
[INFO ] [Logger ] Purge log fired. Processing...
[INFO ] [Logger ] Purge finished!
[INFO ] [Factory ] 195 symbols loaded
[INFO ] [ImageLoaderFFPy] Using ffpyplayer 4.5.1
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil, img_ffpyplayer
[INFO ] [Text ] Provider: sdl2
[INFO ] [Video ] Provider: ffmpeg
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] Backend used <sdl2>
[INFO ] [GL ] OpenGL version <b'4.6 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2'>
[INFO ] [GL ] OpenGL vendor <b'AMD'>
[INFO ] [GL ] OpenGL renderer <b'RENOIR (renoir, LLVM 15.0.7, DRM 3.49, 6.2.0-26-generic)'>
[INFO ] [GL ] OpenGL parsed version: 4, 6
[INFO ] [GL ] Shading version <b'4.60'>
[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
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
[INFO ] [ProbeSysfs ] device match: /dev/input/event9
[INFO ] [MTD ] Read event from </dev/input/event9>
[INFO ] [Base ] Start application main loop
[DEBUG ] Importing BlpImagePlugin
[DEBUG ] Importing BmpImagePlugin
[DEBUG ] Importing BufrStubImagePlugin
[DEBUG ] Importing CurImagePlugin
[DEBUG ] Importing DcxImagePlugin
[DEBUG ] Importing DdsImagePlugin
[DEBUG ] Importing EpsImagePlugin
[DEBUG ] Importing FitsImagePlugin
[DEBUG ] Importing FliImagePlugin
[DEBUG ] Importing FpxImagePlugin
[DEBUG ] Importing FtexImagePlugin
[DEBUG ] Importing GbrImagePlugin
[DEBUG ] Importing GifImagePlugin
[DEBUG ] Importing GribStubImagePlugin
[DEBUG ] Importing Hdf5StubImagePlugin
[DEBUG ] Importing IcnsImagePlugin
[DEBUG ] Importing IcoImagePlugin
[DEBUG ] Importing ImImagePlugin
[DEBUG ] Importing ImtImagePlugin
[DEBUG ] Importing IptcImagePlugin
[DEBUG ] Importing JpegImagePlugin
[DEBUG ] Importing Jpeg2KImagePlugin
[DEBUG ] Importing McIdasImagePlugin
[DEBUG ] Importing MicImagePlugin
[DEBUG ] Importing MpegImagePlugin
[DEBUG ] Importing MpoImagePlugin
[DEBUG ] Importing MspImagePlugin
[DEBUG ] Importing PalmImagePlugin
[DEBUG ] Importing PcdImagePlugin
[DEBUG ] Importing PcxImagePlugin
[DEBUG ] Importing PdfImagePlugin
[DEBUG ] Importing PixarImagePlugin
[DEBUG ] Importing PngImagePlugin
[DEBUG ] Importing PpmImagePlugin
[DEBUG ] Importing PsdImagePlugin
[DEBUG ] Importing QoiImagePlugin
[DEBUG ] Importing SgiImagePlugin
[DEBUG ] Importing SpiderImagePlugin
[DEBUG ] Importing SunImagePlugin
[DEBUG ] Importing TgaImagePlugin
[DEBUG ] Importing TiffImagePlugin
[DEBUG ] Importing WebPImagePlugin
[DEBUG ] Importing WmfImagePlugin
[DEBUG ] Importing XbmImagePlugin
[DEBUG ] Importing XpmImagePlugin
[DEBUG ] Importing XVThumbImagePlugin
[ERROR ] [Image ] Error loading <./vid_1.mp4>
[INFO ] [GL ] NPOT texture support is available
[INFO ] [Base ] Leaving application in progress...
Traceback (most recent call last):
File "/home/Kivymd_UI_Examples/UI11/tests/vp.py", line 28, in <module>
VideoPlayerApp().run()
File "/home/.local/lib/python3.10/site-packages/kivy/app.py", line 956, in run
runTouchApp()
File "/home/.local/lib/python3.10/site-packages/kivy/base.py", line 574, in runTouchApp
EventLoop.mainloop()
File "/home/local/lib/python3.10/site-packages/kivy/base.py", line 339, in mainloop
self.idle()
File "/home/.local/lib/python3.10/site-packages/kivy/base.py", line 391, in idle
Clock.tick_draw()
File "/home/.local/lib/python3.10/site-packages/kivy/clock.py", line 783, in tick_draw
self._process_events_before_frame()
File "kivy/_clock.pyx", line 662, in kivy._clock.CyClockBase._process_events_before_frame
File "kivy/_clock.pyx", line 708, in kivy._clock.CyClockBase._process_events_before_frame
File "kivy/_clock.pyx", line 704, in kivy._clock.CyClockBase._process_events_before_frame
File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
File "/home/.local/lib/python3.10/site-packages/kivy/uix/video.py", line 227, in _do_video_load
self._video.play()
File "/home/.local/lib/python3.10/site-packages/kivy/core/video/video_ffmpeg.py", line 47, in play
self._player = ffmpeg.FFVideo(self._filename)
AttributeError: module 'ffmpeg' has no attribute 'FFVideo'
self._player = ffmpeg.FFVideo(self._filename)
AttributeError: module 'ffmpeg' has no attribute 'FFVideo'