Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. AnimatedImage very slow on first load
QtWS25 Last Chance

AnimatedImage very slow on first load

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
8 Posts 4 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bozo
    wrote on last edited by bozo
    #1

    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

    J.HilkJ 1 Reply Last reply
    0
    • B bozo

      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

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

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


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bozo
        wrote on last edited by
        #3

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

        J.HilkJ 1 Reply Last reply
        0
        • B bozo

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

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @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


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bozo
            wrote on last edited by
            #5

            @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.

            J.HilkJ 1 Reply Last reply
            0
            • B bozo

              @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.

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by
              #6

              @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


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              1 Reply Last reply
              1
              • MarkkyboyM Offline
                MarkkyboyM Offline
                Markkyboy
                wrote on last edited by Markkyboy
                #7

                ~ comment removed ~

                Don't just sit there standing around, pick up a shovel and sweep up!

                I live by the sea, not in it.

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  CsassoV
                  wrote on last edited by
                  #8

                  I am having the same problem on a raspberry pi 4

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved