kivy videoplayer on android

161 views
Skip to first unread message

Degenerate Tech

unread,
Apr 27, 2020, 7:17:28 AM4/27/20
to Kivy users support
i wrote simple videoplayer app ...apk version running well on android but see the adb logcat  'loading  texture of video error' 
please tell me what is the problem?



I/python  (11418): Run user program, change dir and execute entrypoint
I/python  (11418): [INFO   ] [Logger      ] Record log in /data/data/org.test.myapp/files/app/.kivy/logs/kivy_20-04-27_3.txt
I/python  (11418): [INFO   ] [Kivy        ] v1.11.1
I/python  (11418): [INFO   ] [Kivy        ] Installed at "/data/data/org.test.myapp/files/app/_python_bundle/site-packages/kivy/__init__.pyc"
I/python  (11418): [INFO   ] [Python      ] v3.7.1 (default, Apr 27 2020, 15:10:15)  
I/python  (11418): [Clang 6.0.2 (https://android.googlesource.com/toolchain/clang 183abd29fc496f55
I/python  (11418): [INFO   ] [Python      ] Interpreter at "android_python"
I/python  (11418): [INFO   ] [Factory     ] 184 symbols loaded
I/python  (11418): [INFO   ] [ImageLoaderFFPy] Using ffpyplayer 4.2.0.dev0
I/python  (11418): [INFO   ] [Image       ] Providers: img_tex, img_dds, img_sdl2, img_ffpyplayer, img_gif (img_pil ignored)
I/python  (11418): [INFO   ] [Text        ] Provider: sdl2
I/python  (11418): [INFO   ] [VideoFFPy   ] Using ffpyplayer 4.2.0.dev0
I/python  (11418): [INFO   ] [Video       ] Provider: ffpyplayer(['video_ffmpeg'] ignored)
I/python  (11418): [INFO   ] [Window      ] Provider: sdl2
I/python  (11418): [INFO   ] [GL          ] Using the "OpenGL ES 2" graphics system
I/python  (11418): [INFO   ] [GL          ] Backend used <sdl2>
I/python  (11418): [INFO   ] [GL          ] OpenGL version <b'OpenGL ES 2.0'>
I/python  (11418): [INFO   ] [GL          ] OpenGL vendor <b'ARM'>
I/python  (11418): [INFO   ] [GL          ] OpenGL renderer <b'Mali-400 MP'>
I/python  (11418): [INFO   ] [GL          ] OpenGL parsed version: 2, 0
I/python  (11418): [INFO   ] [GL          ] Texture max size <4096>
I/python  (11418): [INFO   ] [GL          ] Texture max units <8>
I/python  (11418): [INFO   ] [Window      ] auto add sdl2 input provider
I/python  (11418): [INFO   ] [Window      ] virtual keyboard not allowed, single mode, not docked
I/python  (11418): [WARNING] [Base        ] Unknown <android> provider
I/python  (11418): [INFO   ] [Base        ] Start application main loop
I/python  (11418): [ERROR  ] [Image       ] Error loading texture video.mp4
I/python  (11418): [INFO   ] [GL          ] NPOT texture support is available
I/python  (11418): [WARNING] Deprecated property "<BooleanProperty name=play>" of object "<kivy.uix.video.Video object at 0xa0a829d0>" was accessed, it will be removed in a future version
I/python  (11418): [WARNING] [Image       ] Unable to load image </data/data/org.test.myapp/files/app/_python_bundle/site-packages/kivy/data/images/image-loading.gif>
I/python  (11418): [ERROR  ] [Image       ] Error loading texture data/images/image-loading.gif
I/python  (11418): [WARNING] [ffpyplayer  ] [swscaler @ 0xa4556000] No accelerated colorspace conversion found from yuv420p to rgba.


main.py
buildozer.spec

Degenerate Tech

unread,
Apr 27, 2020, 7:18:23 AM4/27/20
to Kivy users support
i mean how to solve video texture error ....?

Elliot Garbus

unread,
Apr 27, 2020, 8:09:46 AM4/27/20
to kivy-...@googlegroups.com

You can ignore this error.

If you trace through the video widget you will see the code first attempts to load a still image, if that fails, then it will load the video.  You can use the video widget to display a slide show of jpeg images or mix a list of still images and videos.

--
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/d9afc61e-a6a5-4ac9-9bf4-6fa4fdb67eaf%40googlegroups.com.

 

Elliot Garbus

unread,
Apr 27, 2020, 8:10:55 AM4/27/20
to kivy-...@googlegroups.com

I should add – if you load a still image with the Video widget, you  will not see the error.

Degenerate Tech

unread,
Apr 27, 2020, 8:12:28 AM4/27/20
to Kivy users support

how ? can you give me a simple example ?

Elliot Garbus

unread,
Apr 27, 2020, 8:16:29 AM4/27/20
to kivy-...@googlegroups.com

The example below plays a list of videos or images from the list video_list.  Replace the filenames with your own.  You will see in the log that there are no error for the still images, and errors for the videos.

 

 

from kivy.app import App
from kivy.uix.video import Video
from kivy.lang import Builder

kv =
"""
BoxLayout:
    orientation: 'vertical'
    Player:
        id:player
    BoxLayout:
        size_hint_y: .1
        Button:
            text: 'play'
            on_release: player.state = 'play'
"""

video_list = ['IMG_1853.jpg',
             
'Hand Washing - 34091.mp4']  # Put you content in this list.

class Player(Video):
   
def __init__(self, **kwargs):
       
self.v = 0
       
super().__init__(source=video_list[0], state='stop', **kwargs)

   
def on_eos(self, *args):
       
print(f'on_eos: {self.eos} loaded: {self.loaded}, state: {self.state}')
       
if self.eos:
           
self.v += 1
           
if self.v == len(video_list):
               
print('End of playlist')
                
self.v = 0
               
return
       
self.source = video_list[self.v]
       
self.state = 'play'  # must set state to play for video to be loaded

   
def on_loaded(self, *args):
       
# print('*' * 80)
       
print(f'loaded: {self.loaded}')


class VideoPlayerApp(App):
   
def build(self):
       
return Builder.load_string(kv)


if __name__ == '__main__':
    VideoPlayerApp().run()

 

 

 

From: Degenerate Tech
Sent: Monday, April 27, 2020 5:12 AM
To: Kivy users support

--

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.

Degenerate Tech

unread,
Apr 27, 2020, 8:19:39 AM4/27/20
to Kivy users support
thank you sir...

Degenerate Tech

unread,
Apr 27, 2020, 8:24:42 AM4/27/20
to Kivy users support
sir can I change aspect ratio of video ..?..I want to hide video control widgets as play button , volume control etc while Playing video ...It is possible by Kivy ?

Degenerate Tech

unread,
Apr 27, 2020, 8:26:23 AM4/27/20
to Kivy users support
&. can I make my coustom video player? by using button ,slider etc ?

Elliot Garbus

unread,
Apr 27, 2020, 8:56:53 AM4/27/20
to kivy-...@googlegroups.com

Yes,  You can make your own custom video player using buttons and sliders.

The video will size automatically to fit the size of the enclosing layout.

 

 

From: Degenerate Tech
Sent: Monday, April 27, 2020 5:26 AM
To: Kivy users support
Subject: RE: [kivy-users] Re: kivy videoplayer on android

 

&. can I make my coustom video player? by using button ,slider etc ?

 

--

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.

Degenerate Tech

unread,
Apr 27, 2020, 9:06:22 AM4/27/20
to Kivy users support
sir aspect ratio ? i want to fit video in whole screen..


On Monday, April 27, 2020 at 6:26:53 PM UTC+5:30, Elliot Garbus wrote:

Yes,  You can make your own custom video player using buttons and sliders.

The video will size automatically to fit the size of the enclosing layout.

 

 

From: Degenerate Tech
Sent: Monday, April 27, 2020 5:26 AM
To: Kivy users support
Subject: RE: [kivy-users] Re: kivy videoplayer on android

 

&. can I make my coustom video player? by using button ,slider etc ?

 

--

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-...@googlegroups.com.

Elliot Garbus

unread,
Apr 27, 2020, 9:12:23 AM4/27/20
to kivy-...@googlegroups.com

You can go fullscreen – but I don’t see an easy way to change the aspect ratio.

If you need to change the aspect ratio, it might be useful to look at the source code for Image and look how keep_ratio (especially keep_ratio: False) works to change the aspect ration of a still image.

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/f1d19adc-3ba5-4cfb-a8ac-608f45c81564%40googlegroups.com.

 

Degenerate Tech

unread,
Apr 27, 2020, 1:20:26 PM4/27/20
to Kivy users support
sir can you tell me video formats can run by ffpyplayer ? i tested it running mp4,mkv, are running well.. 


On Monday, April 27, 2020 at 6:42:23 PM UTC+5:30, Elliot Garbus wrote:

You can go fullscreen – but I don’t see an easy way to change the aspect ratio.

If you need to change the aspect ratio, it might be useful to look at the source code for Image and look how keep_ratio (especially keep_ratio: False) works to change the aspect ration of a still image.

 

From: Degenerate Tech
Sent: Monday, April 27, 2020 6:06 AM
To: Kivy users support
Subject: Re: [kivy-users] Re: kivy videoplayer on android

 

sir aspect ratio ? i want to fit video in whole screen..

On Monday, April 27, 2020 at 6:26:53 PM UTC+5:30, Elliot Garbus wrote:

Yes,  You can make your own custom video player using buttons and sliders.

The video will size automatically to fit the size of the enclosing layout.

 

 

From: Degenerate Tech
Sent: Monday, April 27, 2020 5:26 AM
To: Kivy users support
Subject: RE: [kivy-users] Re: kivy videoplayer on android

 

&. can I make my coustom video player? by using button ,slider etc ?

 

--

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-...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/aee54975-59ec-451d-aa84-0d8a202557df%40googlegroups.com.

 

--
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-...@googlegroups.com.

Elliot Garbus

unread,
Apr 27, 2020, 1:40:10 PM4/27/20
to kivy-...@googlegroups.com

FFPyPlayer is a python binding for the FFmpeg library for playing and writing media files.

https://pypi.org/project/ffpyplayer/

 

FFmpeg supports:

https://www.ffmpeg.org/general.html#Video-Codecs

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/45768349-ff0f-492e-9d98-a16f13577a9c%40googlegroups.com.

 

Message has been deleted

Degenerate Tech

unread,
Apr 27, 2020, 3:34:08 PM4/27/20
to Kivy users support
sir...I want to open a video by this video player .....how to implement that ?
I want to click on video list will show my video player ..how to do that in Android ... openwith mode ..

Elliot Garbus

unread,
Apr 27, 2020, 4:04:06 PM4/27/20
to kivy-...@googlegroups.com

Your asking some big open ended questions.  There are lots of ways.  Start coding up some ideas.  Happy to answer a more specific question.

 

From: Degenerate Tech
Sent: Monday, April 27, 2020 12:34 PM
To: Kivy users support
Subject: RE: [kivy-users] Re: kivy videoplayer on android

 

sir...I want to open a video by this video player .....how to implement that ?

I want to click on video list will show my video player ..how to do that in Android ... openwith mode ..

 

--

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.

Degenerate Tech

unread,
Apr 27, 2020, 5:25:41 PM4/27/20
to Kivy users support
give me a direction ...I am new in Python

Elliot Garbus

unread,
Apr 27, 2020, 6:07:31 PM4/27/20
to kivy-...@googlegroups.com
Use glob to get a list of video files. Put a list of file names on buttons in a scroll view, or recycle view, on the button press, play a video.

Sent from my iPhone

> On Apr 27, 2020, at 2:25 PM, Degenerate Tech <sksah...@gmail.com> wrote:
>
> give me a direction ...I am new in Python
>
> --
> 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/a341f0f5-2816-43a8-8b2a-c0a99ef4a8a3%40googlegroups.com.

Degenerate Tech

unread,
Apr 30, 2020, 3:19:22 PM4/30/20
to Kivy users support
sir see this... Video player using button slider... running on Android phone ..I did .. with Help of u & others in this group.. Thank you for guiding me .. .


On Tuesday, April 28, 2020 at 3:37:31 AM UTC+5:30, Elliot Garbus wrote:
Use glob to get a list of video files. Put a list of file names on buttons in a scroll view, or recycle view, on the button press, play a video.

Sent from my iPhone

> On Apr 27, 2020, at 2:25 PM, Degenerate Tech <sksah...@gmail.com> wrote:
>
> give me a direction ...I am new in Python
>
> --
> 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-...@googlegroups.com.
P_20200501_004259.jpg

Elliot Garbus

unread,
Apr 30, 2020, 3:22:29 PM4/30/20
to kivy-...@googlegroups.com

😊 Congratulations! 

 

From: Degenerate Tech
Sent: Thursday, April 30, 2020 12:19 PM
To: Kivy users support

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/e27d2238-9916-4d20-ae72-991a74f6cc4b%40googlegroups.com.

 

Adarsh Singh

unread,
Jun 26, 2020, 5:51:02 AM6/26/20
to Kivy users support

Hi @Elliot Garbus, Can you tell me how should I install ffmpeg on android such that I should get this output correctly.

def test_ffmpeg():
try:
import subprocess
print(subprocess.check_output(['ffmpeg', '-version']))
except Exception as e:
print(e)
print('==> ffmpeg is not good :(, nooooooooooooo')
else:
print('==> ffmpeg is good :)')

test_ffmpeg()
Please reply ASAP, I am stuck on this since many days.

Thanks

Elliot Garbus

unread,
Jun 26, 2020, 9:17:04 AM6/26/20
to kivy-...@googlegroups.com

I have no experience with Android.   Robert, Do you know?

 

Take a look at the source for the kivy core video player to see how kivy uses ffpyplayer.

https://github.com/kivy/kivy/blob/master/kivy/core/video/video_ffpyplayer.py

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/4f0ca95c-4783-4a32-b66b-41d315e1f87co%40googlegroups.com.

 

Robert Flatt

unread,
Jun 26, 2020, 1:35:10 PM6/26/20
to Kivy users support
Assuming ffmpeg is specified in requirements. There are I think two issues with the approach (meaning its not going to work):

1) where would the executable be? There is no $PATH

2) I think the recipe says the executable is not built.

Look in
Line 84:
# disable binaries / doc
 flags
+= [
 
'--disable-programs',
 
'--disable-doc',
 
]



However you know what version of ffmpeg was used because you built it ! 

Also in requirements one can specify a version of a package (e.g kivy==2.0.0rc3).
So  ffmpeg==whatever   HOWEVER I can't tell you if version WHATEVER will catually build on Android. 
Reply all
Reply to author
Forward
0 new messages