dotlottie / dotlottieloader-android

Android library to load dotLottie animations in android projects
21 stars 6 forks source link

[Question] Slower by using dotLottie #4

Closed Drjacky closed 1 year ago

Drjacky commented 1 year ago

I have a GIF that I converted to both JSON and Lottie file types. I used one by one but, when I use the Lottie filetype, it takes a couple of seconds to load the animation.

The Lottie version: 3.5.0

kudanai commented 1 year ago

Hi!

When you say you've converted a GIF I assume you're either using the video->lottie tool or a manual process, but essentially have a sequence of image assets encapsulated in a Lottie yes?

IF that's the case you should be able to skip this loader lib and use lottie-android directly which might give you some speedups. The most likely issue is that images take a little bit of time and compute power to decompress

Drjacky commented 1 year ago

This is the content

{"v":"5.5.2","fr":25,"ip":0,"op":120,"h":720,"w":1080,"nm":"lfvideo2lottie","ddd":0,"assets":[{"id":"1","w":1080,"h":720,"p":"data:image/png;base64,UklGRhIHAABXRUJQVlA4WAoAAAAQAAAANwQAzwIAQUxQSDAAAAABBxARERCQJP3/T0b0P+M///nPf/7zn//85z//+c9//vOf//znP//5z3/+85//Fw9WUDggvAYAAPC2AJ0BKjgE0AI/OZzLXy8rKSUgCAHgJwlpbuF3YRq8WIDG8ABPYB77ZOQ99snIe+2TkPfbJyHvtk5D32ych77Z.......
.
.
.
....."sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[0,0,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":119,"op":120,"st":119,"bm":0}]}
kudanai commented 1 year ago

I see you used the video2lottie tool. You should be able to use that Lottie directly in lottie-android without this library and it should give you a performance boost.

Drjacky commented 1 year ago

I used Convert video and image sequence to Lottie (Beta) from https://app.lottiefiles.com/

kudanai commented 1 year ago

Thank you for clarifying. Had a look and I believe the performance issues are coming from the double buffer from dotlottie-loader and lottie-android. I'd recommend the original suggestion of lottie-android directly. It should be able to support the file directly

Drjacky commented 1 year ago

I used Lottie-android and JSON and there is no issue.