Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Saving a large amount of .png images to disk from camera?
Qt 6.11 is out! See what's new in the release blog

Saving a large amount of .png images to disk from camera?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 1.9k Views 1 Watching
  • 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.
  • N Offline
    N Offline
    nevind7
    wrote on last edited by
    #1

    Hi, I am trying to save a large amount of images (5000ish) to disk.

    Currently, I have a camera running, and when the user presses a button, it saves consecutive QImages into a QVector. Afterwards, I created a QImageWriter object and save it to the harddrive. As you can imagine, saving that many images to disk is quite slow. Does anyone know of a way to make writing to disk faster with png format? The quality is already on the lowest compression (100).

    Thanks!

    • Nevin
    1 Reply Last reply
    1
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      The disk speed is determined by the actual disk.
      Being SSD or spin disk. So not sure there is anything you can do to
      speed it up.
      Options include using threads as not to block GUI while writing
      but it wont speed up the actual transfer to the hd.

      Since its an app for user, using ramdisk is not an option so im not sure
      there is much to do.

      You could have multiple threads write at the same time ( to different files) and if
      hd can take that payload, that would be faster.

      1 Reply Last reply
      1
      • N Offline
        N Offline
        nevind7
        wrote on last edited by
        #3

        Ah yes that is what I figured. Thanks!

        mrjjM 1 Reply Last reply
        1
        • N nevind7

          Ah yes that is what I figured. Thanks!

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @nevind7
          I would inspect the current disk usage when saving.
          If its not saturated, you might save 2-3 image at a time cutting total time
          but if spin disk, it might not give much.

          1 Reply Last reply
          1
          • N Offline
            N Offline
            nevind7
            wrote on last edited by
            #5

            Ah okay thank you very much :)

            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