?
Solved

Trying to control a webcam

Posted on 2005-03-17
7
Medium Priority
?
497 Views
Last Modified: 2008-02-01
I am trying to control a DLink DCS-900 (securicam)

I can get the camera running within HTML using the following code:
**************
<html>
<center>
<BODY scroll="no">
        <APPLET name="cvcs" CODEBASE="http://206.12.4.38:80/" CODE="xplug.class" WIDTH=320 HEIGHT=240>
          <param name="RemotePort" value=80>
          <param name="Timeout" value=5000>
          <param name="RotateAngle" value=0>
          <param name="PreviewFrameRate" value=2>
          <param name="DeviceSerialNo" value="bWNyZW5zaGE6MkR0VWlJ">
        </APPLET>
*********************

But what I'd like to do is be able to tell when i is connected or not, since it takes a long time to load sometimes, I don't know if it's being slow, or actually disconnected.

IE, Id like the screen to show either "Loading..." or "Disconnected" untill the webcam pops up.

Any leads into how I might be able to do this would be awesme.


Here's the small bit of code D-link provides:
http://support.dlink.com/faq/view.asp?prod_id=1871&question=DCS-1000%20/%20DCS-1000W%20/%20DCS-900%20/%20DCS-900W

     
0
Comment
Question by:galneweinhaw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
7 Comments
 
LVL 3

Expert Comment

by:blaines
ID: 13571075
Unless you have the Java source code, you can't modify any "Loading" prompt or "Disconnected" inside the Java Applet.
0
 
LVL 3

Accepted Solution

by:
blaines earned 2000 total points
ID: 13571128
I use some software installed on my local machine to stream my webcam, none of this "REFRESH" every few seconds, but real streaming. The downside is the software I use is not free.

You can get it here for $39.95:
http://surveyor.com/

It's awesome, I use it and it streams GREAT!!! I'll even post the code I use to stream. It has a stop and start functionality. And you can also provide an image to be displayed when you are offline/disconnected. It's great stuff.



-----------------------------------------------------------------------------------
<html>
<HEAD>
<TITLE>Web Cam</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR=#000000>

<div align="center">
            
<script LANGUAGE="JavaScript">
<!--
browserType = navigator.appName;            
newImage = new Image();
document.onstop = document_onstop;

function startstop_onclick()
{
      if (startstop.value == "-- click here to STOP the cam --")
      {
            stopLoad();
      }
      else
      {
            startstop.value = "-- click here to STOP the cam --";
            newImage.onload=loadNewImage;
            loadNewImage();
      }
}

function document_onstop()
{
      stopLoad();
}

function stopLoad()
{
      newImage.onload="";      
      startstop.value = "-- click here to START the cam --";
      window.status = "Live video stopped ...";
}

function loadNewImage()
{
    uniq = new Date();
    uniq = uniq.getTime();
    document.images.webcam32.src=newImage.src;
    newImage.src="http://127.0.0.1:8888/video/pull?"+uniq;
    window.status = "Displaying live video ...";    
}
function initialImage()
{
      uniq = new Date();
      uniq = uniq.getTime();
      newImage.onload=loadNewImage;
      newImage.src="http://http://127.0.0.1:8888/video/pull?"+uniq;
    document.images.webcam32.onload="";
}

function imageError()
{
      window.status = "Sorry ... we're not online right now";
      image = document.images.webcam32;
      image.onload = "";
      image.onerror = "";
      startstop.disabled = true;
      document.images.webcam32.src = "/images/spacer.gif";
}

if (browserType == "Netscape")
{
      document.write('<IMG SRC="http://http://127.0.0.1:8888/video/push" width=320 height=240>');
}
else
{
      document.write('<IMG SRC="http://http://127.0.0.1:8888/video/pull" name=webcam32 onload="initialImage()" onerror="imageError()" width=320 height=240>');
}
//-->
</script><br><INPUT id=startstop type=button value="-- click here to STOP the cam --" LANGUAGE=javascript onclick="return startstop_onclick()"></div>
</BODY>
</html>
-----------------------------------------------------------------------------------
0
 
LVL 3

Expert Comment

by:blaines
ID: 13571149
I forgot to add. The code I posted above will only work if you have the WebCam32 software installed.

http://surveyor.com/

BTW, I don't work for or get paid for this, I'm just posting what I personally use since it does exactly what you are trying to do.
0
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 

Author Comment

by:galneweinhaw
ID: 13572440
Thanks for the help!

Is there any way I can confirm this will work with my particular webcam?
0
 
LVL 3

Expert Comment

by:blaines
ID: 13575927
Not sure how to confirm, however, this program has worked on 4 different web cams I've owned. This program also detected my TV Tuner card which allowed me to broadcast a television show through my web cam site. I feel very confident it'll work for your web cam.

Here is how you can be sure:
http://surveyor.com/support/webcam32help/multimedia.html
0
 
LVL 6

Expert Comment

by:PreachDotNet
ID: 13576005
Windows Media Services 9 is free and can stream audio, movies, or live cam over the web.  

http://www.microsoft.com/windows/windowsmedia/9series/server.aspx

Its very easy to set up and works a treat.  Handles buffering etc for you.  I guarantee you'll have it up and running in an hour.
0
 
LVL 3

Expert Comment

by:blaines
ID: 13576352
I was unable to find out how to set up the M$ Media server to stream to my web cam site. Where do I get the Java or HTML code to make this stream work? I'm interested in testing it.
0

Featured Post

What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question