I have an animated webp file that I took from the original AR Stickers APK which I'd like to show in my app for onboarding in ARCore. It looks like I can easily load the first frame of the webp file into an imageview but trying to decode it as a Movie
object fails. Is there a simple way of showing it? It's obviously possible since the AR-Stickers app clearly did it in their original release. I saw that there's a library from Facebook (Fresco) that seems like it should be able to do it but from what I understand it adds quite a bit of bloat to my app's APK. Are there any simple solutions to this?
Asked
Active
Viewed 6,540 times
4

TheHebrewHammer
- 3,018
- 3
- 28
- 45
1 Answers
9
That's true. There aren't many animated WebP/GIF solutions out there, and Fresco takes a lot.
There is this library (made an easier fork of it here ), but it can have some serious issues with files sometimes, such as here . If you know why this occurs, and how to fix it, please consider contributing to it (or to my fork).
There is, of course, a way to use the normal Android framework for loading animation files (sample here) using ImageDecoder&AnimatedImageDrawable , but it's only from Android P.
Google has promised it will be added to the support library (here), but I still don't see it.
That's why I've created a question here, where I wanted to know how to fetch frame-by-frame image of an animated WebP file.

android developer
- 114,585
- 152
- 739
- 1,270
-
Any idea of the issue? – peerless2012 Mar 30 '23 at 12:09
-
@peerless2012 What do you mean? – android developer Mar 30 '23 at 20:08
-
The [Android-WebP#issue7](https://github.com/McoyJiang/Android-WebP/issues/7) display error. – peerless2012 Mar 31 '23 at 03:41
-
@peerless2012 I just don't use this library anywhere. If you want to view the animation or have frame-by-frame of it, you can check somewhere else that I wrote about it: https://stackoverflow.com/a/53234195/878126 . Others also show solutions. Not sure which is the best – android developer Mar 31 '23 at 07:45
-
You webp glide plugin project, i have see it before and it is amazing. I just find that you use libWebP too, and i will check that project. Thanks for your work. – peerless2012 Mar 31 '23 at 08:10
-
@peerless2012 I'm sure there is a better solution instead of the weird thing I've done. One that directly fetches the frames. It's inside Glide and the other library of WEBP. – android developer Mar 31 '23 at 08:56
-
It sounds great, and i'll glad to talk about that with you somewhere. – peerless2012 Mar 31 '23 at 16:45
-
@peerless2012 If you have a nice solution that doesn't require the weird parts that I made, please write it there. – android developer Apr 01 '23 at 07:13