Solved

I have a question about writing a script so that I can "stream" video from a recording made by my Linksys WVC11B camera.

Posted on 2004-08-20
16
1,355 Views
Last Modified: 2012-06-27
Hello.

I have a question about writing a script so that I can "stream" video from a recording made by my Linksys WVC11B camera.  

Alternatively, if anyone has a different idea as to how to stream the live feed from the
Linksys WVC11B camera (other than through the camera's built-in webserver webpage), I would certainly prefer to do that.  

A very similar question was asked last year (http://www.experts-exchange.com/Web/Q_20799705.html) and the answer provided was probably exactly what I need to do, but I do not know how to write the script to implement it.  I have included the highlights of the answer and I hope someone may be able to advise as how to code this script and incorporate it into a simple html web page.  

I am running 2000 Server with IIS5 and Windows Media server.

Thanks!
- Joe


Highlights of answer, provided by Insolence:
“Go download or install the LinkSys Viewer and Recorder Utility. Schedule a recording that is 5 minutes long, every 5 minutes (or something like this... maybe 1 min.?) and save it in a directory.

Write a few scripts using your favorite server-side web-based language (PHP, ASP, Java, etc) that automatically puts a link to the latest file saved to that directory.  In PHP you'd just use some file listing, find the latest date file, and put a link to that on your website.  That isn't LIVE streaming, but it's live enough...  If you need help writing these scripts for whatever language... ask  =)

You will still in this case have to write an "inbetween".  A script, PHP, CGI, Java, VB, something, that tells the streaming server to change what file it's streaming... or if you manage to find software to patch video together... then you need to write a small program to string them onto the end of the current file being streamed constantly.”
0
Comment
Question by:JOE-BULLITT
  • 8
  • 7
16 Comments
 
LVL 10

Expert Comment

by:avidya
ID: 11854273
Hi, maybe i can help, but knowing why you don't want to use the buildin webserver would help me to understand what your goal is.
0
 
LVL 5

Expert Comment

by:Gitcho
ID: 11854291
I believe Windows Media Encoder 9 can do this.

It can take video from any source (live, or pre-recorded) and brodcase to any other source (web, video out, hard drive etc.).   It's free !

If you set entered the camera's live video feed url into WME9's input source, you can do whatever you want with the captured stream.

Check out : http://www.microsoft.com/windows/windowsmedia/9series/encoder/default.aspx

I have used this to broadcast live video from my TV to the net (with compression & reduced frame-rate of course)
0
 
LVL 10

Expert Comment

by:avidya
ID: 11854604
this explains how with Windows media server :
http://home.wangjianshuo.com/archives/20020918_realtime_stream_broadcasting_cookbook.htm

this one is whitout: http://my.anywebcam.com/ (free)

and here is some sample code, you should replace "http://www.russellshaw.net:1121"with your own url.:

....Host Your Own Stream
If you would rather stream your Webcam from your own site, the more you know about coding, the more precise this set-up will be for you. If I were to perform this operation from my own site, I would need to decide whether or not I wanted to embed the streaming media player on my Web page (www.russellshaw.net) or cause it to come up when a user clicked on the link to my streaming Webcam feed.

If I were to choose the embed option and wanted to specify Windows Media Player, I would choose Port 1121 and then input the following into the source code for the page my Webcam is linked from:

<! -- - BEGIN PLAYER -- ->
<! -- webbot bot="HTMLMarkup" startspan -- -- > 
<object ID="MediaPlayer" WIDTH="320" HEIGHT="270" CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6 ,4,7,1112">
<param name="autoStart" value="True">
<param name="filename" value="http://www.russellshaw.net:1121">
<param NAME="ShowControls" VALUE="False">
<param NAME="ShowStatusBar" VALUE="False">
<embed TYPE="application/x-mplayer2" SRC="russellshaw.net:1121" NAME="MediaPlayer" WIDTH="320" HEIGHT="270" autostart="1" showcontrols="0"></embed></object>
<! -- webbot bot="HTMLMarkup" endspan -- -- > 
<! -- - end PLAYER -- ->

Next, I would need to indicate where on the page I would want my embedded Webcam stream image to pop up. Here is the code I would use:

<p>
<object id="Player" width="176" height="144" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<param name="URL" value="http://www.russellshaw.net:1121">
<param name="uiMode" value="none">
</object>
</p>
<p>
<input type="BUTTON" name="BtnPlay2" value="Play" onClick="StartMeUp()">
<input type="BUTTON" name="BtnStop2" value="Stop" onClick="ShutMeDown()">
</p>
<script>
<! --
function StartMeUp ()

Player.controls.play();

function ShutMeDown ()

Player.controls.stop();

-- > 
</script>
<script language="VBScript">
<! --
On error resume next
Player.URL = "" 
if err then msgbox "You need Windows Media Player 7. Go to" & chr(13) &_
"http://www.microsoft.com/windowsmedia
err.clear
-- > 
</script>

That last bit of code is necessary for those users who do not have Windows Media Player already installed.

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:JOE-BULLITT
ID: 11855200
Thank you VERY much for the help and great information.  I will try this tonight and (hopefully) have some good news later!

The reason that I want to incorporate the video into my own page, or at least a link for it to open in a player, is because the built-in web server webpage is very busy and includes the links for the web cam configuration and setup, which I would like to keep from even being seen.  I like the built-in web server features, but would prefer if I could just have the video display by itself, either in a separate viewer or in one of my sites pages.

Thanks!
:-)  Joe
0
 
LVL 10

Expert Comment

by:avidya
ID: 11855249
you could post youre buildin webserver code to.
I will try to rebuild it without the config stuff.
0
 

Author Comment

by:JOE-BULLITT
ID: 11855645
Hi avidya.

Here is a link to the "image" web page built into the Linksys web server.  I pulled the password requirement off for now.  <Removed per asker request>
Are you able to view the source code from this?  If not, I can try to get into the camera's web server and pick apart the pages to find what we need.

Thanks so much.  I really appreciate your kind assistance.

:-)  Joe
0
 
LVL 10

Expert Comment

by:avidya
ID: 11855675
Hi Joe,

got an error while accessing:
There was an unusual problem serving the requested URL '/img/main_fs.htm/img/main_fs.htm'.
0
 

Author Comment

by:JOE-BULLITT
ID: 11855964
Hi.
I am sorry about that.  When I wrote the last message, I was at home for lunch and while there I needed to reset my dsl router, but my dynamic dns update runs once an hour and I forgot to manually run it so my dns is off the map probably for another half-hour.  If you don't mind too much to check again a little later that would be most cool.  :-)
Thanks!
- Joe
0
 
LVL 10

Expert Comment

by:avidya
ID: 11856016
ok
0
 

Author Comment

by:JOE-BULLITT
ID: 11856257
Hello.
Please try this link, it should work better.  <Removed per asker request>
Thanks.
- Joe
0
 

Author Comment

by:JOE-BULLITT
ID: 11856263
Or maybe this one....
<Protected>
0
 
LVL 10

Expert Comment

by:avidya
ID: 11856284
tied the last one, it works, im gonna look at the code, ok?
0
 

Author Comment

by:JOE-BULLITT
ID: 11856393
thank you
0
 
LVL 10

Accepted Solution

by:
avidya earned 500 total points
ID: 11856769
Hi Joe,

Nice fish!

try this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
 <head><title>Linksys Web Camera</title>
 <LINK REL="stylesheet" TYPE="text/css" HREF="http:<Protected>:1024/std.css">
 <meta name="description" content="LCS 3042">
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <META http-equiv="Pragma" CONTENT="no-cache">
 <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
 <meta HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT">
 <script language="JavaScript" type="text/javascript" src="http:<Protected>:1024/stdlib.js"></script>
 <script language="JavaScript" type="text/javascript" src="http:<Protected>:1024/message.js"></script>
 <script language="JavaScript" type="text/javascript">
 <!-- Start Script
 // =================================  Player ===========================
 function isIE()
  {
   if(navigator.appName.indexOf("Microsoft") != -1)
    return true;
   else return false;
   // test navigator.platform for Win32
   // if(navigator.platform.indexOf("Win32") != -1)
  }
  var run_flag = false;
  var intervalID = null;
 function doPlay()
  {
  //var serverAddress = "http://"  +   self.location.host  + "/img/video.asf";
  var serverAddress = "http:<Protected>";
  var itimer = 1000 ;  // msecs
  if(isIE() && document.all)
  {
   if(document.all('NetCamPlayerWeb1'))
   {
    document.all('NetCamPlayerWeb1').SetSource(serverAddress, "", "");
    document.all('NetCamPlayerWeb1').StartPlay(0,'');  
    //intervalID = setInterval("document.all('NetCamPlayerWeb1').StartPlay(0,'')",itimer);
    run_flag = true;
   }
  }
 }
 function doStop()
  {
  if(isIE() && document.all)
   if(document.all('NetCamPlayerWeb1'))
    {
     //clearInterval(intervalID);
     document.all('NetCamPlayerWeb1').StopPlay();
    }
   }
 function showHelp()
  {
   var cf = document.forms[0];
   if (cf.adminlogin.value == "true")
    window.open("http:<Protected>:1024/adm/file.cgi?next_file=help.htm","help_win");
   else
    window.open("http:<Protected>:1024/hlp_client.htm","help_win");
   }
   // End Script -->
 </script>
</head>
<body bgcolor="" marginheight="0" marginwidth="0" leftmargin="0" topmargin="0" onLoad="doPlay();" onUnload="doStop();">
 <form name="dummy" method="get" action="" onSubmit="return false;">
  <div align="center">
    <table bgcolor="" border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>
     <td align="right"><a href="javascript:parent.close()">Exit</a></td>
    </tr>
    <tr>
     <td bgcolor="">
      <object classid="clsid:1D9EFA3B-4E85-41A8-9092-14012CD447C9" CODEBASE="http:<Protected>:1024/img/NetCamPlayerWeb.ocx" id="NetCamPlayerWeb1" WIDTH="320" HEIGHT="240">
       <param name="_Version" value="65536">
       <param name="_ExtentX" value="11774">
       <param name="_ExtentY" value="6562">
       <param name="_StockProps" value="0">
      </object>
     </td>
    </tr>
    </table>
  </div>
  <input type="hidden" name="message" value="">
  <input type="hidden" name="adminlogin" value="">
  <input type="hidden" name="todo" value="connect">
 </form>
</body>
</html>
0
 

Author Comment

by:JOE-BULLITT
ID: 11856864
WOW!!!  This is excellent!!!

Avidya, you are my hero!!!

Thank you very very much!!!

I wish I could grade an A+; a simple A is not high enough.  Your assistance was awesome!!!

Have an excellent weekend!

Cheers!

- Joe

p.s. the fish say hello  :-)
0
 
LVL 10

Expert Comment

by:avidya
ID: 11856878
Hi Joe,
Thanks for the compliment and have fun making your own layout!
(i know the fish sad hello, i just waved to them from my local webpage, *grin*)
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Read about why website design really matters in today's demanding market.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

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