kivy video player not video load error

24 views
Skip to first unread message

Degenerate Tech

unread,
Jun 26, 2024, 8:40:34 AM (7 days ago) Jun 26
to Kivy users support
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'

ELLIOT GARBUS

unread,
Jun 26, 2024, 1:48:04 PM (6 days ago) Jun 26
to Kivy users support
While I don't know if it will effect your issue, generally you want to set the environment variables prior to importing any Kivy modules.  A number of the kivy modules evaluate the env vars on import.



From: kivy-...@googlegroups.com <kivy-...@googlegroups.com> on behalf of Degenerate Tech <sksah...@gmail.com>
Sent: Wednesday, June 26, 2024 5:40 AM
To: Kivy users support <kivy-...@googlegroups.com>
Subject: [kivy-users] kivy video player not video load error
 
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/b38c817f-9aa7-45a8-8c00-4cbd57257c17n%40googlegroups.com.

Degenerate Tech

unread,
Jun 26, 2024, 1:57:25 PM (6 days ago) Jun 26
to Kivy users support
Any idea how to solve ?

ELLIOT GARBUS

unread,
Jun 26, 2024, 7:02:55 PM (6 days ago) Jun 26
to Kivy users support
What happens with you change the order of imports?

import os
os.environ["KIVY_VIDEO"] = "ffpyplayer"

from sys import argv
from os.path import dirname, join
from kivy.app import App
from kivy.uix.videoplayer import VideoPlayer

Sent: Wednesday, June 26, 2024 10:57 AM

To: Kivy users support <kivy-...@googlegroups.com>
Subject: Re: [kivy-users] kivy video player not video load error
 

Degenerate Tech

unread,
12:25 PM (11 hours ago) 12:25 PM
to Kivy users support
solved by uninstalling ffmpeg ffpyplayer

pip install ffpyplayer

On Thursday, June 27, 2024 at 4:32:55 AM UTC+5:30 ElliotG wrote:
What happens with you change the order of imports?

import os
os.environ["KIVY_VIDEO"] = "ffpyplayer"

from sys import argv
from os.path import dirname, join
from kivy.app import App
from kivy.uix.videoplayer import VideoPlayer

Reply all
Reply to author
Forward
0 new messages