Announcement

Collapse
No announcement yet.

Web display of picture with changing filename

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

  • Web display of picture with changing filename

    Greetings,

    For a number of reasons, I now have a system running that takes snapshots of cctv cameras at frequent intervals. Each camera saves the snapshots to it's own folder, and the filename is a timestamped name.

    Now what I want to do is display the LAST (newest) snapshot on a web page for that camera. Each page refresh would cause the newest snapshot to display.

    I either need a way for html (or something) to display the latest file, or automated software to copy the file name to a standard name (no timestamp).

    I want to keep the original timestamped files for future time lapse construction.

    Any advice would be greatly appreciated.

    Tom
    Last edited by yelloow7t; March 14th, 2008, 11:30 AM. Reason: spelling

  • #2
    you can use geturl in a script and filter the imagename out of it.
    Peter

    http://ohh.pcgsm.nl

    Comment


    • #3
      Originally posted by peterpc View Post
      you can use geturl in a script and filter the imagename out of it.
      Um... Hu?

      Sorry, I dont understand...get what url?

      Tom

      Comment


      • #4
        If you can modify the image saving software, tell it to also save the picture in a file named camera1.jpg. Then on your web page simply call up the camera1.jpg image. It will always be the most recent picture.

        Steve Q
        HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
        2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

        Comment


        • #5
          Originally posted by Steve Q View Post
          If you can modify the image saving software, tell it to also save the picture in a file named camera1.jpg. Then on your web page simply call up the camera1.jpg image. It will always be the most recent picture.

          Steve Q
          I am only allowed one address to save the file, currently using it to save the time stamped version. Simplest would be for HTML to display the last image, but I cant find anything like that...

          Tom

          Comment


          • #6
            Tom,

            Could you post an example of the time stamped file?

            Does this directory gradually fill up with more and more images over time or is this just a single file?
            Jon

            Comment


            • #7
              Jon,

              Yes the directory(s) fill with pictures. Here is an example. The filename before uploading was: Camera 2 3-14-2008 10.20.58 AM 11.jpg
              Attached Files

              Comment


              • #8
                Is the time stamp on the file attributes updated for each new image? If so you could simply pull the newest file from the directory.
                -Rupp
                sigpic

                Comment


                • #9
                  Originally posted by Rupp View Post
                  Is the time stamp on the file attributes updated for each new image? If so you could simply pull the newest file from the directory.
                  That's exactly what I'm asking how to do... I think the file attribute is only HR:Min so would'nt work if more than one picture per minute??

                  Originally posted by yelloow7t View Post

                  Now what I want to do is display the LAST (newest) snapshot on a web page for that camera. Each page refresh would cause the newest snapshot to display.

                  I either need a way for html (or something) to display the latest file, or automated software to copy the file name to a standard name (no timestamp).
                  I think the file attribute is only HR:Min so would'nt work if more than one picture per minute?? But I still dont know how to do it.

                  Thanks
                  Tom

                  Comment


                  • #10
                    Bump...

                    Anybody got a suggestion? I need to either:

                    Find a way to display the last picture from a folder, or

                    Find a software program or script that will take the latest picture and transfer it to another folder and rename it to a standard name...

                    Thanks in advance

                    Tom

                    Comment


                    • #11
                      Here's a VBScript example:

                      Code:
                      dim mostRecentFileDate, mostRecentFile
                      strPath = "\path\to\search"
                      Set oFSO = CreateObject("Scripting.FileSystemObject")
                      Set oFolder = oFSO.GetFolder(strPath)
                      Set cFiles = oFolder.Files
                      For Each objFile In cFiles
                      	If(objFile.dateLastModified > mostRecentFileDate) Then
                      		mostRecentFileDate = objFile.dateLastModified
                      		mostRecentFile = objFile
                      	End If
                      Next
                      MsgBox(mostRecentFile & " " & mostRecentFileDate)
                      You could turn this into a function for your ASP page to return the latest file.

                      Hope this helps.
                      Last edited by rmasonjr; April 2nd, 2008, 07:14 PM. Reason: variable strPath needs to point to your folder of pics
                      HS3Pro Running on a Raspberry Pi3
                      64 Z-Wave Nodes, 168 Events, 280 Devices
                      UPB modules via OMNI plugin/panel
                      Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
                      HSTouch Clients: 3 Android, 1 Joggler

                      Comment


                      • #12
                        I was meaning to take a look at this for you but have been rather busy with my Touchscreen interface

                        Anyway, I knew I had written something several years ago which I finally found on my old Homeseer server. It's probably not so elegant as Rob's code as it uses a sort routine to re-order the files but should do what you want.

                        Hopefully the 3 entries you need to setup are self explanatory.

                        Just to recap, this will copy the latest file in a directory and copy it to a new directory with a filename of your choice.
                        Attached Files
                        Jon

                        Comment


                        • #13
                          I am attempting to do something similar. So I am hoping for some assistance. I can retrieve the current still image using the URL: XXX.XXX.XXX/Cam_1.jpg, but I would like to retrieve the last image that was captured with the systems motion dectection ie Alerts. These Alert images are stored in a folder where the folder name is the current date YYYYMMDD. The files stored in the Alerts directory & are named Cam_X__YYYYMMDD_TIME. I would like to have the file copied to a different directory, renamed & overwrite existing. This script will run on my video server pc and not HS. Motion dection will triger the script & pass the image name to the script.

                          Code:
                          Sub Main(ByVal Parms As String) 
                          Dim oFS
                          Dim StrFileName As String
                          Dim StrName2 As String
                          Dim StrFolder As String
                          StrFileName="cam_3_20090702_070559_1.jpg" ' TEST  file name will be passed from WebCamXp
                          StrName2=Left(StrFileName,5) 
                          StrFolder=Format(Date,YYYYMMDD)
                           Set oFS=CreateObject(" Scripting.FileSystemObject" )
                           oFS.CopyFile "C:\Documents and Settings\All Users\Application Data\webcamXP 5\Alerts\" & StrFolder & "\" & StrFileName, " C:\Documents and Settings\All Users\Application Data\webcamXP 5\WWWRoot\Images\" & StrName2
                           
                           Set oFS=Nothing
                          End Sub
                          Larry

                          Comment


                          • #14
                            If its any help for you all Blade has a plugin that monitors folders (on my lan in my case) and copies the latest picture to a destination of your choice (in my case to the Homeseer/html/security folder for displaying on my quickview page.

                            Images can be updated at timed intervals OR when the folder beiong monitored is updated.

                            BLLatestimage

                            TrOjAn

                            Comment


                            • #15
                              You may be able to use a batch file to move abd rename the captured .jpg to a standard name that can be written over. If this does not involve homeseer, then it probably can be done with vbscript and/or batch files.
                              Why I like my 2005 rio yellow Honda S2000 with the top down, and more!

                              Comment

                              Working...
                              X