...

View Full Version : Image update blinking HELP PLEASE



elikpr
09-03-2011, 06:11 PM
Hi Community,

I am running simple web cam streaming to html. Let me explain how it works:
First C code grabs frame from web cam and PHP code send the image to the client where exists receiver php code. It saves the submitted image to disk and javascript updates image every 0.1 sec or less. it is working fine but there is blinking. So I changed Javascript to avoid blinking (changed to other script). In this case streaming is fine but after 2-5 sec it stops updating. here is script:

<head>
<title> Streaming</title>
</head>
<body>
<!-- <img name="frame" src="" border="0" /> -->

<img src="" id="webcam1" width="640" height="480" border="5" alt="Camera1"/>

<script language="javascript">

document.images.webcam1.src = "http://my_IP_address/img.jpg";
document.images.webcam1.onload = Start;

function LoadImage()
{
uniq1 = Math.random();
document.images.webcam1.src = "http://my_IP_address/img.jpg?"+uniq1;
document.images.webcam1.alt = uniq1;
}

function Start()
{
setTimeout("LoadImage();", 70);
}
</script>

</body>
</html>


Where is mistake? Why it stops updating after 2-5 seconds every time.

Please help!

Thank you



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum