Announcement

Collapse
No announcement yet.

PicViewer and lots of files

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    PicViewer and lots of files

    I have PicViewer set up to show me my camera motion detected pictures. On a day like today (beautiful spring day outside) when we are busy doing lots of things in view of the camera, a lot of captures are done. Right now there are more than 5000 jpg's in today's directory.
    Everything eventually loads and displays OK, but it takes a while to load (couple of minutes) and meanwhile my server is running at high CPU usage, which I don't like.
    Can anything be done to either speed this up or limit how many pictures it tries to load?
    Dick
    HS PRO 2.5.0.81, WinXP, IE8, Shuttle XS35V3, 2.13GHz, 4GB, 40GB SSD drive, AC-RF2, ADIOcelot, Message Server, TI103, SNEVL CID, pjcOutlook, MCSTemperature, Powertrigger, BLBackup, BLFloorplan, BLIcon, BLOccupied, BLRadar, BLRfid, BLLogMonitor, ACPUPSD, UltraECM, WeatherXML & Stipus' script connector. 500+ devices, 260+ events, 1-wire weather station + temp/humidity sensors & Oregon Scientific temp & humidity sensors & 2 Brultech ECM-1240s

    #2
    If you're snapping a pic via an event each time a motion detector sends an "on", you can just limit the execution by entering a value (any value in seconds) in the "cannot retrigger for..." field in the event. It's under the event "name" tab.
    Real courage is not securing your Wi-Fi network.

    Comment


      #3
      Dick,

      How large are the image files approx? I may have a solution but would need a script written.
      Jon

      Comment


        #4
        Originally posted by Wadenut View Post
        If you're snapping a pic via an event each time a motion detector sends an "on", you can just limit the execution by entering a value (any value in seconds) in the "cannot retrigger for..." field in the event. It's under the event "name" tab.
        WebCamXP is saving the pictures, not Homeseer and I have little control over how many get saved. When it detects motion it saves jpg's as fast as it can as long as there is motion.

        Originally posted by jon00 View Post
        Dick,

        How large are the image files approx? I may have a solution but would need a script written.
        The files are ~21K each.
        Dick
        HS PRO 2.5.0.81, WinXP, IE8, Shuttle XS35V3, 2.13GHz, 4GB, 40GB SSD drive, AC-RF2, ADIOcelot, Message Server, TI103, SNEVL CID, pjcOutlook, MCSTemperature, Powertrigger, BLBackup, BLFloorplan, BLIcon, BLOccupied, BLRadar, BLRfid, BLLogMonitor, ACPUPSD, UltraECM, WeatherXML & Stipus' script connector. 500+ devices, 260+ events, 1-wire weather station + temp/humidity sensors & Oregon Scientific temp & humidity sensors & 2 Brultech ECM-1240s

        Comment


          #5
          The latest version has an option to use thumbnail images which speeds up page load times due to their small size. Clicking on the thumbnail will show the full size image. This is great for fixed picture albums as you can create thumbs using a freeware program I specified.

          What I can do is script to create thumbnail images automatically which are copies of the originals but very poor quality. For a thumb this is OK but has small file size. This could be done by calling the script via recurring event and/or automatically when calling the picture viewer page.

          Does that sound like a possible solution?
          Jon

          Comment


            #6
            Originally posted by jon00 View Post
            The latest version has an option to use thumbnail images which speeds up page load times due to their small size. Clicking on the thumbnail will show the full size image. This is great for fixed picture albums as you can create thumbs using a freeware program I specified.

            What I can do is script to create thumbnail images automatically which are copies of the originals but very poor quality. For a thumb this is OK but has small file size. This could be done by calling the script via recurring event and/or automatically when calling the picture viewer page.

            Does that sound like a possible solution?
            I have it set up to display thumbnails now (72x54 pixels). I'm sure that's what's taking all the time now, is the creation of all those thumbnails, am I right?

            If I ran this new script say, every hour to create thumbnail images, would those thumbnails be saved and updated each hour or would it be re-creating the whole batch of thumbnails each hour? I assume from the fact you're suggesting this approach, that it would speed things up when the PicViewer page is called?
            Dick
            HS PRO 2.5.0.81, WinXP, IE8, Shuttle XS35V3, 2.13GHz, 4GB, 40GB SSD drive, AC-RF2, ADIOcelot, Message Server, TI103, SNEVL CID, pjcOutlook, MCSTemperature, Powertrigger, BLBackup, BLFloorplan, BLIcon, BLOccupied, BLRadar, BLRfid, BLLogMonitor, ACPUPSD, UltraECM, WeatherXML & Stipus' script connector. 500+ devices, 260+ events, 1-wire weather station + temp/humidity sensors & Oregon Scientific temp & humidity sensors & 2 Brultech ECM-1240s

            Comment


              #7
              The thumbnails as you have it are actually the full image but just resized. When you view a directory with a large number of images, the page has to load every full size image as a thumbnail. This eats up memory in the browser and takes a long time to load.

              I added a feature recently in that if the filename of an image has another image exactly the same but with a prefix of ~thumb~ then that image is displayed as the thumbnail rather than the main image.

              As you can see, if your 21K file has a duplicate thumbnail file of only 2-3K (but poor quality), then things should load much faster. If you do click on the thumbnail, the main picture is then downloaded from the server.

              If I write a script, only the images that did not have corresponding thumbnails would be updated.
              Jon

              Comment


                #8
                Originally posted by jon00 View Post
                The thumbnails as you have it are actually the full image but just resized. When you view a directory with a large number of images, the page has to load every full size image as a thumbnail. This eats up memory in the browser and takes a long time to load.

                I added a feature recently in that if the filename of an image has another image exactly the same but with a prefix of ~thumb~ then that image is displayed as the thumbnail rather than the main image.

                As you can see, if your 21K file has a duplicate thumbnail file of only 2-3K (but poor quality), then things should load much faster. If you do click on the thumbnail, the main picture is then downloaded from the server.

                If I write a script, only the images that did not have corresponding thumbnails would be updated.
                If you could do that, I'm quite sure it would solve my issue. Let me know when you have something I can test.
                THANKS! !
                Dick
                HS PRO 2.5.0.81, WinXP, IE8, Shuttle XS35V3, 2.13GHz, 4GB, 40GB SSD drive, AC-RF2, ADIOcelot, Message Server, TI103, SNEVL CID, pjcOutlook, MCSTemperature, Powertrigger, BLBackup, BLFloorplan, BLIcon, BLOccupied, BLRadar, BLRfid, BLLogMonitor, ACPUPSD, UltraECM, WeatherXML & Stipus' script connector. 500+ devices, 260+ events, 1-wire weather station + temp/humidity sensors & Oregon Scientific temp & humidity sensors & 2 Brultech ECM-1240s

                Comment


                  #9
                  Ok, I'll take a look over the next few days.
                  Jon

                  Comment


                    #10
                    Originally posted by jon00 View Post
                    Ok, I'll take a look over the next few days.
                    Thanks. I'll wait to hear from you.
                    Dick
                    HS PRO 2.5.0.81, WinXP, IE8, Shuttle XS35V3, 2.13GHz, 4GB, 40GB SSD drive, AC-RF2, ADIOcelot, Message Server, TI103, SNEVL CID, pjcOutlook, MCSTemperature, Powertrigger, BLBackup, BLFloorplan, BLIcon, BLOccupied, BLRadar, BLRfid, BLLogMonitor, ACPUPSD, UltraECM, WeatherXML & Stipus' script connector. 500+ devices, 260+ events, 1-wire weather station + temp/humidity sensors & Oregon Scientific temp & humidity sensors & 2 Brultech ECM-1240s

                    Comment


                      #11
                      Ok, I have something working!

                      It was more complex than I first thought (why did I volunteer to do this!) but really quite happy with the results.

                      Basically the original image is copied and resized down to the thumbnail image size defined in the [settings] area. Jpg's are then re-encoded to a lower quality which can be set in the ini file.

                      Both a 30K and a 2 meg jpg file had thumbnails created with a size of 1.5K and still quite usable!

                      When you call a gallery with thumbnail generation activated, you can set it to generate these thumbs automatically before the page is displayed.

                      I need to tidy this up but may be ready for download later today.
                      Jon

                      Comment


                        #12
                        Dick,

                        Version 1.09 is now available. You must read the instructions again especially the area highlighted with a gray background.

                        Let me know if it makes any difference to your load times.

                        Remember that with the number of files you have, you should generate the thumbnails via a recurring event only
                        Jon

                        Comment


                          #13
                          Tried 1.09 - got errors

                          I installed 1.09, made appropriate changes to settings.ini and PicViewer.ini.
                          When I either run the event to create the thumbnails (with CreateThumb set to "2") or load the PicViewer.ash page (with CreateThumb set to "1") I get the following errors in my HS log file:
                          6/2/2009 2:55:01 PM ~!~Jon00_PicViewerThumb~!~Error in Subroutine resize A generic error occurred in GDI+.
                          6/2/2009 2:55:01 PM ~!~Jon00_PicViewerThumb~!~Error in Subroutine JpgQuality Parameter is not valid.
                          6/2/2009 2:55:01 PM ~!~Jon00_PicViewerThumb~!~Error in Subroutine FindFiles Access to the path '\\ha-x10\WebcamXP\Alerts\20090602\~tmp~cam_1_20090602_050834_1.jp g' is denied.

                          Attached is my PicViewer.ini file
                          Attached Files
                          Dick
                          HS PRO 2.5.0.81, WinXP, IE8, Shuttle XS35V3, 2.13GHz, 4GB, 40GB SSD drive, AC-RF2, ADIOcelot, Message Server, TI103, SNEVL CID, pjcOutlook, MCSTemperature, Powertrigger, BLBackup, BLFloorplan, BLIcon, BLOccupied, BLRadar, BLRfid, BLLogMonitor, ACPUPSD, UltraECM, WeatherXML & Stipus' script connector. 500+ devices, 260+ events, 1-wire weather station + temp/humidity sensors & Oregon Scientific temp & humidity sensors & 2 Brultech ECM-1240s

                          Comment


                            #14
                            Hmmm

                            1) Please copy/paste your ScriptingReferences= string from [settings.ini] here.
                            2) Copy around 20 webcam image files to a directory in your HTML directory and create a new gallery. See if that is working.
                            Jon

                            Comment


                              #15
                              Another thing. Make sure you allow full access/rights/permissions to the web cam directory for file writing by the HS server. If not, it cannot create the thumbnails and will error.

                              I've just tried using a UNC path and it's working here.
                              Jon

                              Comment

                              Working...
                              X