46 users online (0 members and 46 guests)  


  Results 1 to 9 of 9

Related

  1. Videos streaming    Forum: Website Scripts Forum
    Replies: 3
  2. Replies: 2
  1. #1
    mustangmaddi's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    2

    Question need to add streaming video

    I just created my first webcam website in HTML using a Videum capture software, and WS_FTP to upload my puppies to my Comcast webpage. There has GOT TO be a way to stream the video instead of just FTPing individual webshots of the dogs. When I do this, sometimes the pics are out of synch and I get a partial picture. So... first off..can anyone offer a snippet of HTML code that will automatically synch my webcamera to the refresh rate on my website...or ...better still...can anyone offer HTML code that will allow streaming video of the little critters? I'm going away next month and would like to keep an eye on the puppies (and make sure they are being fed by the dog sitters). I'd greatly appreciate this!!!
    Thanks!
    maddi g

  2. #2
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: need to add streaming video

    it is not as eassy as it sounds... to get a web cam to work with a webpage, it requires software...

    the eassiest way to get a webcam on the net, is to:

    get some software that automatically ftps to your domain, then uploads the new pic...
    then just have the html page display the pic.

    to actually streme it, you would have to get a java applet or flash or something to keep retrieving the data from the server.

    it is not as eassy as it sounds...

    one other option you have is to:

    make perl/php/asp/python/exc... page that when you go to that page the script automatically goes to your computer and asks for the picture, but then you have to still have some softare to give the pic when it is asked for.

    -ALL

  3. #3
    mustangmaddi's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2005
    Posts
    2

    Question Re: need to add streaming video

    Thanks...but I already have the software and the website is working...but the pics are sent one at a time rather than 'streaming' and I'd like a 'snippet' to help me. Any other ideas?

  4. #4
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: need to add streaming video

    to get a service like that you will mostlikely have to pay for it:

    here is a link i found:
    http://www.cambrosia.com/

  5. #5
    C.Whyte's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Oct 2005
    Location
    Santa Cruz, CA
    Posts
    64

    Re: need to add streaming video

    yeah, streaming is tough... i tried just last week and settled for an auto refresh every second. Here's the code on my page... it's really annoying and kind of lame (the refreshing) but hey, it gets the job done. PM me if you ever get the code working for streaming, but here is the code I used for the "every-second-refresh" [my camera is the webcam32.jpg]

    Code:
    <title>C.Whyte For President - Webcam</title>
      <script LANGUAGE="JavaScript">
      <!-- HIDING
       function caminawin()
       { window.open('REMOTEFILENAME', 'popwin', 'scrollbars=0,status=0,toolbar=0,resizable=0,width=346,height=305,top=150,left=185'); }
      // END HIDING -->
      </script>
     </head>
     <body bgcolor="white">
    <center>
      <font face="Arial,Helvetica,Verdana" size=-1> 
      <h1>C.Whyte For President Live Webcam</h1>
      <h2>www.CwhyteForPresident.com</h2>
      <p><br>
        <img src="webcam32.jpg" border=1 width=320 height=240 alt="C.Whyte Webcam"><br>
        <br>
        [ <a href="javascript:caminawin();">OPEN IN FLOATING WINDOW</a> ]</form> 
      <p> Please DO NOT hit RELOAD on your browser suckaz. 
      <p><br>
        <br>
        <a href="index.html">Go Back To The Main Site</a><br>
      <h3>Check me out SUCKAZ.</h3>
      <p><br>
        <br>
        <br>
      <hr width=225>
      <font size=-2> Courtesy of C.Whyte</font> 
      <p><br>
      </font> 
    </center>
     </body>
    </html>     
    
    
    <html>
     <head>
      <META HTTP-EQUIV=REFRESH CONTENT="1"> 
      <META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
      <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
      <title>C.Whyte For President</title>
      <script LANGUAGE="JavaScript">
      <!-- HIDING
      var x = 1
      var y = 1
    
      function StartClock(){
       x = x-y
       if (x > -1) document.form1.clock.value = x
       timerID = setTimeout("StartClock()", 1000)}
      // END HIDING -->
      </script>
     </head>
     <body bgcolor="white" onLoad="StartClock()">
      <center>
       <font face="Arial,Helvetica,Verdana" size=-1>
        <img src="webcam32.jpg" border=1 width=320 height=240 alt="C.Whyte"><br>
        <form NAME="form1"><b><font size="-1" face="Arial">AutoReload in ~ </font>
        <input TYPE="text" NAME="clock" SIZE="2" VALUE> <font size="-1" face="Arial">seconds.</font></b><br>
       </font>
      </center>
     </body>
    </html>
    It's definitely not the cleanest thing in the world, but whatever. Again, let me know if you find a streaming alternative.

    You can see what this looks like here: www.cwhyteforpresident.com/webcam.html

    Good Luck!

  6. #6
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: need to add streaming video

    c.whyte you gave me an idea... you may beable to use code like this:
    HTML Code:
    <html>
    <head>
    <script language="javascript">
    function RefreshImage(){
    document.webcam.src="path_to_image.jpg?a=" + String(Math.random()*99999999)
    setTimeout('RefreshImage()',1000);
    }
    </script>
    </head>
    <body onload="RefreshImage()">
    <img name="webcam" src="path_to_image.jpg"></body>
    </html>
    which only refreshes the image, but if you server does not like the "?" then try a "#" insted (but i dont know if it will be a cacheing problem with the "#"

    try that,
    -ALL

  7. #7
    C.Whyte's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Oct 2005
    Location
    Santa Cruz, CA
    Posts
    64

    Re: need to add streaming video

    Didn't work : (

    Just had a still from the webcam... it only changes when you manually hit refresh

  8. #8
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: need to add streaming video

    after tweeking for a while, i finally got it! and i made it much better! now it doesnt have a timelimit, it starts updating once it gets the last one!

    anyway, here it is:
    HTML Code:
    <html>
    
    <head>
    </head>
    <body>
    <img src="http://cwhyteforpresident.com/webcam32.jpg" name="webcam">
    </body>
    <script language="javascript">
    RefreshImage();
    var img = new Image();
    
    function RefreshImage(){
    img = null;
    img = new Image();
    var now = new Date();
    if(webcam.complete){
    img.src="http://cwhyteforpresident.com/webcam32.jpg?"+now.getDay()+now.getDate()+now.getFullYear()+now.getHours()+now.getMinutes()+now.getSeconds();
    img.load=ApplyImage();
    }else{
    setTimeout("RefreshImage()", 1)
    }
    }
    
    function ApplyImage(){
    if(img.complete){
    webcam.src=img.src;
    setTimeout("RefreshImage()",1);
    }else{
    setTimeout("ApplyImage()",1);
    }
    }
    </script>
    </html>
    PS: CWhyte... i used your webcam as the sample (i hope that is ok with you!)

  9. #9
    C.Whyte's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Oct 2005
    Location
    Santa Cruz, CA
    Posts
    64

    Re: need to add streaming video

    Yeah, it's fine. Code looks good and functions well too. Nice work (as always).



Tags for this Thread