Kivy supported Image types? Or Video types?

519 views
Skip to first unread message

GreyGnome

unread,
Sep 4, 2016, 7:40:35 PM9/4/16
to Kivy users support
If I want to open up images, eg
img = Image(source = "/path/to/imagefile")

What are the limits to the type of source image? I presume jpg works, and png. How about gif? tiff? bmp? Amiga IFF? 

...In other words, how do tell the users of my app what images my app will be able to display?

Same goes for Video files.

Finally, if I load a file using Image as illustrated above, and that file is a text file, then my screen is simply black. That's fine, but I'd like to tell my user that the image type is unsupported. I thought Kivy may throw an exception but it doesn't. How do I tell if my Image has been displayed correctly?

Thanks.

Dzmitry

unread,
Sep 12, 2016, 3:26:37 AM9/12/16
to Kivy users support
You can find all supported types in folders `kivy.core.image` and `kivy.core.video`. 
I know, that if Image Loader can't find loader for image type, then it raise exception.
raise Exception('Unknown <%s> type, no loader found.' % ext)


понедельник, 5 сентября 2016 г., 2:40:35 UTC+3 пользователь GreyGnome написал:

ZenCODE

unread,
Sep 12, 2016, 7:49:06 AM9/12/16
to Kivy users support
Yes. The reason it's not so easy to provide a list upfront is because this depends on your destination OS. Different providers for different OS's support different formats....

GreyGnome

unread,
Sep 12, 2016, 8:58:34 AM9/12/16
to Kivy users support
On Monday, September 12, 2016 at 2:26:37 AM UTC-5, Dzmitry wrote:
I know, that if Image Loader can't find loader for image type, then it raise exception.
raise Exception('Unknown <%s> type, no loader found.' % ext)

 In Kivy 1.9.0 I don't receive an Exception. Was this added later?

The only way I've discovered to know if my Image was not loaded properly from a source file is to check to see if Image._coreimage is None, but that's on Kivy 1.9.0.

GreyGnome

unread,
Sep 12, 2016, 9:07:46 AM9/12/16
to Kivy users support
On Monday, September 12, 2016 at 6:49:06 AM UTC-5, ZenCODE wrote:
Yes. The reason it's not so easy to provide a list upfront is because this depends on your destination OS. Different providers for different OS's support different formats....

Can I create some sort of matrix outlining the different formats for the different platforms? I presume this list is finite and well-defined for the different destination OS'. I am looking at the code under kivy/core/image for example and I can see some interesting things, but I am developing on Linux. Which of those things is available on iOS? Android? How do I tell, or how do I enable it (if that's what I'm going to have to do)? I don't see anything in there which specifies which platform the code runs on.

Without this matrix  the cross-platform capabilities of my project is limited.

Thanks.

GreyGnome

unread,
Sep 12, 2016, 11:25:17 PM9/12/16
to Kivy users support
On Monday, September 12, 2016 at 6:49:06 AM UTC-5, ZenCODE wrote:
Yes. The reason it's not so easy to provide a list upfront is because this depends on your destination OS. Different providers for different OS's support different formats....

As I look over this thread, I suspect I wasn't clear as to what I'm after.

My impression, from reading https://kivy.org/docs/guide/packaging-android.html#packaging-your-application-for-kivy-launcher and other parts of the Kivy docs, is that Kivy comes with what it needs, built-in: "Kivy is designed to operate identically across platforms and as a result, makes some clear design decisions. It includes its own set of widgets and by default, builds an APK with all the required core dependencies and libraries."

That said, does Kivy on Android include the ffmpeg library, if I use Buildozer to build my app? Let's say, for example, that my Kivy app on Linux opens up an XWD image. How do I ensure that my app will be able to do it on Android? I see that XWD is one of the formats supported for Images at https://www.ffmpeg.org/general.html#Image-Formats, from img_ffpyplayer.py. Do I need to compile anything for Android so it recognizes these formats? I didn't need to do anything on Linux.

Similarly, do I need to compile an ffmpeg library on all the platforms that will run my app, as per the instructions in video_ffpyplayer.py? I have yet to play with video in Kivy on Linux, so maybe it isn't even working here but I'm not sure.

Finally, if/when I do compile the ffmpeg library, will it automatically support the list of Video Codecs from https://www.ffmpeg.org/general.html#Image-Formats? Even on Android/iOS? If not, what are the limitations that prevent Kivy and/or ffmpeg from working on those platforms, and how do I determine which of the formats are available and which are not or never will be?

I'm anxious to take advantage of Kivy's cross-platform capabilities but thoroughly confused as to how to get there with regards to images and video/audio. Thanks.
Reply all
Reply to author
Forward
0 new messages