Streaming GIF's

When a .gif is embedded in a webpage, it displays as soon as the first frame is downloaded, and then shows the next frames as soon as it downloads them.

So, my question is, would it be possible to write a script that would stream an animation (eg a webcam view) that refreshed every 2 seconds or so?

Ideas?

Ben

<META HTTP-EQUIV="Refresh" CONTENT="2">

This will make the page refresh every 2 seconds, but I’m not sure how to get only an image to refresh every 2 seconds.

Ok, re-reading that shows I completely didn’t make myself clear.

What I’m getting at is- would it be possible to make a gif stream by creating a new image in the sequence every 2 seconds or so- so the gif itself would be infinitely long, and new frames would be added every 2 seconds.

Well, if you can automate the whole process of capturing the webcam view, saving it over the same image, then automatically upload to wherever you wish, then yes. I don’t really know how…

libgd can make animated gifs and save them frame-by-frame, so you could write a CGI program to use that… not PHP though, because it doesn’t support that feature of libgd yet.

Though I’m not sure you’d want to… there has to be a better way to do whatever it is you want to do…

like the meta refresh [in an iframe] or the many javascript or java approaches to the same thing

The animated gif version will be difficult to get to work. You will need to write your own custom webserver, which after sending one frame will claim to the browser that the gif file is still not complete and after 2 seconds send other part. There will be numerous problems with caches, browser timeouts etc etc. Not worth the hussle.

Simple solution will be to do it in JavaScript, or if you have Macromedia Flash, then in Flash.

neopets has somehting like that where you refresh the page manualy and it recevs a new image from there webcam

if thats not what your looking for sorry thats what it sounded like to me
http://neopets.com/neocam.phtml heres a link

i just checked it out but there cam might be off since it doesent seem to be moving now (there in california now so wait till business hours there and try it)