Fresco: The WebP animation twinkles

Created on 15 Mar 2017  Â·  13Comments  Â·  Source: facebook/fresco

Hi, I use Fresco to play webp animations, but sometimes it do not work well, every frame is flashing, may be loaded too slowly?

Here is the code, contains the flashing webp file:

        Uri uri = Uri.parse("http://77flrh.com1.z0.glb.clouddn.com/038B98F02B26B70DF0DF8EF62257F9EB.webp");
        DraweeController controller = Fresco.newDraweeControllerBuilder()
                .setUri(uri)
                .setAutoPlayAnimations(true)

                .setControllerListener(new BaseControllerListener<ImageInfo>() {
                    @Override
                    public void onFinalImageSet(String id, ImageInfo imageInfo, final
                    Animatable animatable) {
                        animatable.start();
                    }
                })
                .build();
        SimpleDraweeView draweeView = (SimpleDraweeView) findViewById(R.id.my_image_view);
        draweeView.setController(controller);

Most helpful comment

@erikandre @oprisnik
This is exciting news. I've just updated to the latest version(1.4.0), tested all the webp files that have problems and found no problems. all of the problem have been resolved.

You've done a great job. Thank you very much for your support during this time。

All 13 comments

Hi @notice501 !

Thank you for submitting the bug report. I managed to reproduce the issue using the provided URL.

I do notice that there seems to be something a bit odd with that WEBP file. When loaded in Chrome (on desktop and mobile) the transparency does not work correctly until the animation has looped once.

I can not reproduce this issue when trying to play other animated WEBP files, so I'm thinking that it might be an issue with the file itself. It might be a good idea to try different tools or different settings when exporting the animation (like trying to export it without alpha to see if the glitch is still there).

Hi, thanks for your reply.
I export animations with the guide from Google. Almost every file has the same issue, like this one. Do you have some suggestions about tools or something else?

By the way, I use YYImage to play WebP animation for IOS, everything works well with the same WebP file.

There are a couple of interesting options you could try experimenting with. For example the "-bgcolor A,R,G,B" option (try setting a background with no alpha) or the options related to the dispose method for each frame.

I find out that the problem is related to the frame rate of the animation. when I use the same resource which I mentioned before, but exported with higher frame rate, the flashing is gone. But I still cannot find out why. Do you have any idea?

@notice501 , I suspect it could be an issue in libwebp since that is where the actual animation is handled. We are currently a bit behind the latest version of this library so there is always a chance that upgrading could resolve it. This will require quite a bit of testing though, so it's not something that will happen in the very short term.

Thanks, look forward to being resolved.

@erikandre

Is there any progress in this problem?
I have the same problem in use Fresco,The picture will flash several times at the beginning.
But when I use YYImage to play WebP animation for IOS, everything works well with the same WebP file.

Also,I have try to change the frame rate of the animation or set a background with no alpha ,But no improvement has been made,

@UFreedom The next release of Fresco will contain an updated version of libwebp (0.6.0), hopefully this will resolve this problem.

@erikandre

Have you found the reason for the specific problem? Or does libwebp know the problem?

By the way, when the next release comes, I can't wait to test it.

Thanks

We've released Fresco v1.4.0, which includes a new implementation for animated GIFs and animated WebPs that is way more performant, especially in the case where you display multiple images. Let us know if you're still experiencing problems with 1.4.0.

@erikandre @oprisnik
This is exciting news. I've just updated to the latest version(1.4.0), tested all the webp files that have problems and found no problems. all of the problem have been resolved.

You've done a great job. Thank you very much for your support during this time。

Thanks! Great to hear that it works now!

Was this page helpful?
0 / 5 - 0 ratings