Reduce storage size of 'thumbs' folder (MovPic + TVSeries)

Discussion in 'Moving Pictures' started by RoChess, January 6, 2010.

  1. RoChess
    • Premium Supporter

    RoChess Extension Developer

    Joined:
    March 10, 2006
    Messages:
    4,185
    Likes Received:
    1,304
    Ratings:
    +1,683 / 2
    Note: This tool is only meant for users who want to reduce their 'thumbs' folder storage size. It is *NOT* required.

    Moving Pictures and MP-TVSeries store large images in this folder and their accumulated size can add up quick, even causing delays when scrolling fast. At first this batch file was only meant to solve the PNG image format that MovingPictures uses in some versions (some with JPG extension), but it has expanded into more.

    In short this script now converts all the images into the JPEG image format and reduces their filesize to be below certain thresholds. It will first try reducing the JPEG quality, by removing information most human eyes can't distinguish. When the first reduction fails, it will try again with a more aggressive reduction, and if that fails it will reduce the image size slightly.

    The filesize thresholds are 350kB for Fanart/Backdrops, 150kB for covers and 20kB for cover thumbnails. On my own collection roughly 60% was already below those thresholds, an additional 30% worked after the first reduction (JPEG 85), another 9.5% required JPEG 70 and only a stuborn 0.5% needed the maximum reduction. I personally found no visual difference after all was done, but then again my eyes aren't getting any younger :D

    To use this tool:



    • Please download Nconvert directly via: Nconvert 32-bit or Nconvert 64-bit
    • Download the attachment and unzip it inside the unzipped folder of the Nconvert tool.

    Then simply execute "!MediaPortal Fix Thumbs.cmd" and it will do the rest.

    Please be patient, the process takes a while. An added delay is caused by the fact that all the images are first duplicated into the Temporary folder, then processed, and finally copied back (ugly but it works and avoids problems). A crude log file is created so you can verify the process afterwards.
     

    Attached Files:

    Last edited: April 20, 2015
    • Like Like x 11
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. fforde

    fforde Community Plugin Dev

    Joined:
    June 7, 2007
    Messages:
    2,666
    Likes Received:
    1,690
    Occupation:
    Software Engineer
    Location:
    Texas
    Ratings:
    +1,696 / 0
    Home Country:
    United States of America United States of America
    Re: Reduce storage size of MovingPictures 'thumbs' folder.

    RoChess mentions this mostly above but just wanted to point out, with the next release:

    1) All images will be stored as JPGs.
    2) The "incomplete image" bug will be resolved.
    3) The image caching issue will be resolved.

    You can expect something later this week I think.
     
  4. Zinu

    Zinu Portal Pro

    Joined:
    February 28, 2008
    Messages:
    650
    Likes Received:
    23
    Ratings:
    +23 / 0
    Home Country:
    Netherlands Netherlands
    Re: Reduce storage size of MovingPictures 'thumbs' folder.

    So in the upcoming release the function (what it does) of this 'fix' will be implemented?
     
  5. fforde

    fforde Community Plugin Dev

    Joined:
    June 7, 2007
    Messages:
    2,666
    Likes Received:
    1,690
    Occupation:
    Software Engineer
    Location:
    Texas
    Ratings:
    +1,696 / 0
    Home Country:
    United States of America United States of America
    Re: Reduce storage size of MovingPictures 'thumbs' folder.

    RoChess' script converts existing covers from PNGs to JPGs and reduces the image size to a height of 800 pixels. For people with large collections this will save a lot of disk space because PNGs are large, and themoviedb.org has some ridiculously huge cover images.

    With the next release of Moving Pictures we will begin to save images as JPGs instead of PNGs. We will probably add the resizing functionality as well, but I haven't decided on that yet. Leaning towards yes. And as a side note, two somewhat related bugs will be fixed, the problem with cover art and backdrops getting loaded into the skin cache and the problem with some covers and backdrops not fully downloading.

    We will not be converting existing image files from PNG to JPG.
     
    • Like Like x 1
  6. Zinu

    Zinu Portal Pro

    Joined:
    February 28, 2008
    Messages:
    650
    Likes Received:
    23
    Ratings:
    +23 / 0
    Home Country:
    Netherlands Netherlands
    Re: Reduce storage size of MovingPictures 'thumbs' folder.

    Right, thanks, I guess I'll be running RoChess's thing first ;)
     
  7. RoChess
    • Premium Supporter

    RoChess Extension Developer

    Joined:
    March 10, 2006
    Messages:
    4,185
    Likes Received:
    1,304
    Ratings:
    +1,683 / 2
    Re: Reduce storage size of MovingPictures 'thumbs' folder.

    My 'trick' does not change the PNG extension into JPG. It does convert all the images into the JPEG format, but it leaves the file extension alone, because those are stored inside the database and would cause problems then.

    But to avoid the conflict with the MediaPortal skin cache function as fforde highlighted (MediaPortal tries to cache all the PNG files in the thumbs folder, so it crashes on the large amount of cover and backdrop images), it would still be advisable to delete the PNG files from the MovingPictures thumbs folder after you are running the version with fforde's fix included.

    Then the MovingPictures plugin can obtain those again and store them in the right format (and update the database). But at least you will be able to spread this out by doing a few per day or per month depending on your how your bandwidth usage is limited.

    I run a small 32GiB C: drive partition (my goal is to switch to one of those Kingston or Intel 40GB SSDs), so I was simply getting worried about running out of space. That problem is now fixed :D
     
  8. Zinu

    Zinu Portal Pro

    Joined:
    February 28, 2008
    Messages:
    650
    Likes Received:
    23
    Ratings:
    +23 / 0
    Home Country:
    Netherlands Netherlands
    Re: Reduce storage size of MovingPictures 'thumbs' folder.

    So what this does is: it makes JPEGs of the PNGs there are now, but still making MovPic think it's dealing with the same file, even though it's a JPEG now. So a PNG in a JPEG container.
    The upcoming MovPic version just saves images to come as JPEGs, no more PNGs. This means it's best to wait until that one's released and then run this fix?

    But does your fix make entirely new JPEG files or does it replace the PNG files?
     
  9. fforde

    fforde Community Plugin Dev

    Joined:
    June 7, 2007
    Messages:
    2,666
    Likes Received:
    1,690
    Occupation:
    Software Engineer
    Location:
    Texas
    Ratings:
    +1,696 / 0
    Home Country:
    United States of America United States of America
    Re: Reduce storage size of MovingPictures 'thumbs' folder.

    This is getting way over complicated. There are no BMP files. If you are using Moving Pictures 1.0 Beta 2 images (covers and backdrops) are saved as PNG files. These take up more space than JPG files and if you have thousands of movies in your collection this can add up. RoChess' script converts these image files from PNG to JPG to save space, while leaving the filename the same so Moving Pictures doesn't lose track of it. It is extremely unlikely this will noticably improve performance of MediaPortal or Moving Pictures. It will save you a bit of disk space, that is all.

    If you have thousands of movies and are worried about an extra gigabyte or two of space used on your hard drive you may want to consider RoChess' script. Otherwise it can be safely ignored.
     
  10. Zinu

    Zinu Portal Pro

    Joined:
    February 28, 2008
    Messages:
    650
    Likes Received:
    23
    Ratings:
    +23 / 0
    Home Country:
    Netherlands Netherlands
    Re: Reduce storage size of MovingPictures 'thumbs' folder.

    Okay, thanks. Sorry for being to hard headed :p

    I presume neither the fix in the upcoming release nor this one regarding the PNG/JPEG thing actually greatly improves performance?
     
  11. fforde

    fforde Community Plugin Dev

    Joined:
    June 7, 2007
    Messages:
    2,666
    Likes Received:
    1,690
    Occupation:
    Software Engineer
    Location:
    Texas
    Ratings:
    +1,696 / 0
    Home Country:
    United States of America United States of America
    Re: Reduce storage size of MovingPictures 'thumbs' folder.

    No worries, and no, this is not about performance. It's about disk space.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!