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