Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

AnimatedImage very slow on first load



  • Hi, I want to view an animated .webp image (469.1 kB ). The QML type AnimatedImage is able to display the animation.
    When starting the animation by setting the property paused to false, the animation starts but the whole ui is getting unresponsive and the animation is running with a very slow framerate. After one loop the animation runs smooth and the ui is responsive again. This happens when cache is set to true.
    When setting cache to false, even after completing one loop, the animation remains slow and the ui is unresponsive.

    I was able to force a full cache of the animation by doing the following:

    AnimatedImage {
                    id: ani
                   
                    source: "qrc:/assets/images/ani.webp"
                    anchors.fill: parent                
                    asynchronous: true
                    cache:true                
                    Component.onCompleted:  currentFrame= ani.frameCount-1
                }
    

    The problem with this solution is that the gui is blocked for almost 10 seconds on startup.
    Is there a way to let the animation cache without blocking the gui? Setting asynchronous does not help.

    OS: debian
    processor: i.MX6DL
    Using Qt 5.12.3


  • Moderators

    @bozo
    hi,
    you could try wrapping the AnimatedImage in a Loader, see if that helps



  • Using a Loader did not help. Gui is still blocked during the first loop.


  • Moderators

    @bozo 🤔
    Maybe it's the webp format ? I always used AnimatedImage with gif's

    Can you share the ani.webp ?

    I would test it then on my pc



  • @J-Hilk said in AnimatedImage very slow on first load:

    @bozo 🤔
    Maybe it's the webp format ? I always used AnimatedImage with gif's
    Can you share the ani.webp ?
    I would test it then on my pc

    I can't share the particular animation but i have a sample one that also blocks for about 1-2 seconds.
    https://drive.google.com/file/d/1wlGzKEG0OQd42mt2MDknQPJPS7qet-MQ/view?usp=drivesdk

    I am not able to reproduce this on my development pc. This only happends on an emmbedded linux device with an imx6dl processor.


  • Moderators

    @bozo said in AnimatedImage very slow on first load:

    This only happends on an emmbedded linux device with an imx6dl processor.

    that would have been a useful information on the beginning   😏

    I don't have such a device at hand.

    You could indeed try it with a gif. If it's an embedded device, you probably won't need a high quality webp



  • ~ comment removed ~



  • I am having the same problem on a raspberry pi 4


Log in to reply