stockpiling images from a web cam

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mr. Orange

    #1

    stockpiling images from a web cam

    I've found this might not really be possible to do with js, but I'm not
    really versed enough in it to know for sure.

    I have a web cam saving an image to a server, "cam.jpg". The cam replaces
    the image every x seconds.

    On the client I have some simple js that grabs "cam.jpg?" + [current
    date/time] (to fail the browser's cache lookup of cam.jpg) when a timer
    fires. It's the typical home-brew refreshing-cam scenario, and that's all
    working fine.

    What I want to do (just for my own purposes, so browser compatibility and
    whether or not this is even a good idea isn't really an issue on this) is
    add a playable 'movie' of everything the client has grabbed so far, using
    all the previous image grabs as frames. Which at first I assumed would
    involve saving all the images to an ever-growing array, and then looping
    through it via timer to 'play the movie'. But what I'm finding is that you
    can't really store "images" in js variables, you can only store objects that
    contain information about images that already exist somewhere, is that
    right? I don't think I want to save anything to the client disk, even if I
    could... I'd rather fill up my memory and crash my browser than consume all
    my free HD space. I want to leave this thing on all day to get some
    time-lapse images out my window, and silly stuff like that. Is this even
    possible to do?


  • Thomas 'PointedEars' Lahn

    #2
    Re: stockpiling images from a web cam

    Mr. Orange wrote:
    [color=blue]
    > [...] But what I'm finding is that you can't really store "images"
    > in js variables, you can only store objects that contain information
    > about images that already exist somewhere, is that right?[/color]

    Yes, it is, unless you use a client-side API that does this.
    [color=blue]
    > I don't think I want to save anything to the client disk, even if I
    > could...[/color]

    You can and, actually, you already do. Every time the image is
    displayed, it is most certainly stored in the disk cache if not
    already there. The Image object merely allows you to use the
    cached image instead of the server resource, if supported.
    [color=blue]
    > I'd rather fill up my memory and crash my browser than consume all my
    > free HD space. I want to leave this thing on all day to get some
    > time-lapse images out my window, and silly stuff like that. Is this
    > even possible to do?[/color]

    No, it is not, unless you can use a client-side API that allows that
    (ActiveX?). You cannot specify how resources are cached by the UA
    by default.


    PointedEars

    Comment

    Working...