stockpiling images from a web cam

M

Mr. Orange

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?
 
T

Thomas 'PointedEars' Lahn

Mr. Orange said:
[...] 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?

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

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.
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?

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top