D-Link Forums

The Graveyard - Products No Longer Supported => IP Cameras => DCS-942L => Topic started by: Darkbob on September 06, 2013, 11:19:03 AM

Title: Embed Video
Post by: Darkbob on September 06, 2013, 11:19:03 AM
Ok... I've seen this topic posted and read all the answers but I just can't get it working the way I want.

I'd like to make a simple web page that allows visitors to view out through my web cam without entering user names and passwords and downloading stuff.  Just can't make it work.

I've got a guest account (non-admin) set up here as guest/guest.  Feel free to take a look if you like.  It's boring.  :)

http://216.xx.xxx.24/eng/liveView.cgi

Problem is it shows all that Dlink stuff around it and it also requires user name and password.  I'm just looking for the video without the dlink stuff and no user name/password.

When I try something like:

http://216.xx.xxx.24/mjpeg.cgi   or anything like that it fails.  I get various plug errors and such-like when I try any of the other existing solutions posted here.  

I've tried every thread on this board that I could find.  Believe me, I've tried them all.  Just need something brain dead simple.  Any ideas?

Many thanks in advance.
Title: Re: Embed Video
Post by: RYAT3 on September 06, 2013, 07:33:27 PM
nothing is working as you say.
 ??? ???
Title: Re: Embed Video
Post by: Darkbob on September 06, 2013, 08:49:35 PM
nothing is working as you say.
 ??? ???

Well thanks for trying!  Anybody else with a great idea?  Maybe some setting on my end is wrong?
Title: Re: Embed Video
Post by: RYAT3 on September 07, 2013, 06:34:03 AM
Well thanks for trying!  Anybody else with a great idea?  Maybe some setting on my end is wrong?

I got in as guest/guest.

it should be something closer to:

http://216.65.178.24/video/mjpg.cgi?profileid=1

http://216.65.178.24/image/jpeg.cgi


Title: Re: Embed Video
Post by: Darkbob on September 09, 2013, 08:52:56 AM
Thanks!  I can get in as guest too.  I just want a way to pass the guest info to the camera from a web page to bypass the log-in and make it public.
Title: Re: Embed Video
Post by: Peter von Frosta on September 09, 2013, 11:19:49 AM
just uncheck the "HTTP Authentication"  under "maintenance -> admin"

If you want the livestream in your webpage-design you have to do a browser-Switch.
example in php:
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "msie")) {
<iframe src="http://216.65.178.24/vaview.htm" width="640" height="480" frameborder="0" scrolling="no"></iframe>}
else {
<img src="http://216.65.178.24/video/mjpg.cgi" alt="Livestream" style="width:640px; height:480px;" />
}

I know - an iframe is not really up to date but it works (not for Opera because he canŽt handle mjpg)

cheers
Title: Re: Embed Video
Post by: Darkbob on September 10, 2013, 08:53:11 AM
First, thanks very much for all the help!  Awesome tip on turning off that http authentication.  Is that a security risk by any chance?  They can't get into admin can they?

Anyway I think I have done something wrong but we are getting close.  Can anybody spot my error?

So this is my code:

Code: [Select]
<html>
     <head>
     <title>LiveVideo123x</title>
     <META content="text/html"; charset="UTF-8"; http-equiv=Content-Type>
     <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
     <META HTTP-EQUIV="Expires" CONTENT="-1">
     </head>
     <body>

if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "msie")) {
<iframe src="http://216.65.178.24/vaview.htm" width="640" height="480" frameborder="0" scrolling="no"></iframe>}
else {
<img src="http://216.65.178.24/video/mjpg.cgi" alt="Livestream" style="width:640px; height:480px;" />
}

     </body>
     <HEAD>
     <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
     <META HTTP-EQUIV="Expires" CONTENT="-1">
     </HEAD>
</html>

And this is how the screen renders:

(http://s22.postimg.org/4g9pouen5/screen.jpg) (http://postimg.org/image/nlcyyltb1/full/)
Title: Re: Embed Video
Post by: JavaLawyer on September 10, 2013, 09:12:32 AM
DCS-9XXL - Embed Live Video Display on a User Created Website (Using iframes) (http://forums.dlink.com/index.php?topic=52483.0)
Title: Re: Embed Video
Post by: Darkbob on September 10, 2013, 09:24:37 AM
Code: [Select]
<html>
     <head>
     <title>LiveVideo123x</title>
     <META content="text/html"; charset="UTF-8"; http-equiv=Content-Type>
     <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
     <META HTTP-EQUIV="Expires" CONTENT="-1">
     </head>
     <body>
     <a href="http://http://216.65.178.24/mjpeg.cgi" rel="self" title="http://216.65.178.24/mjpeg.cgi"> Cam1,
     </a>
     <BR>


     // Note that the video frame size can be arbitrarily configured using the width and
     // height variables located in bold in the HTML code below

     <tr>
        <div class="box">
           <iframe src="http://216.65.178.24/mjpeg.cgi"
           width="460" height="345" class="smart_sizing_iframe noresize"
             frameborder="0" scrolling="no" >
           </iframe>
         </div>
     </tr>

     </body>
     <HEAD>
     <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
     <META HTTP-EQUIV="Expires" CONTENT="-1">
     </HEAD>
     </html>

And here's my screen rendering:

(http://s15.postimg.org/qjp70gnez/screen2.jpg) (http://postimg.org/image/96ewlls3r/full/)
Title: Re: Embed Video
Post by: JavaLawyer on September 10, 2013, 09:26:59 AM
Thanks for posting another copy of that link.  Seen it a mountain of times.  Messed with it at least 20 times.  Just doesn't even come close to working no matter what I do.  Maybe if I went out and bought two more cameras or something...

Perhaps the contributor for that post (member acellier) will see this thread and help troubleshoot. Alternatively, you can also try sending acellier a PM.
Title: Re: Embed Video
Post by: Darkbob on September 10, 2013, 09:33:48 AM
For sure!!  PM him.  I'm dying here.  :)
Title: Re: Embed Video
Post by: JavaLawyer on September 10, 2013, 09:36:51 AM
For sure!!  PM him.  I'm dying here.  :)

I just shot him a PM, we'll see what happens!
Title: Re: Embed Video
Post by: Peter von Frosta on September 10, 2013, 09:52:44 AM
This example is only working if all of your guests uses Firefox and no IE.
I donŽt understand why there are two <head>-declarations in this example. It doesnŽt make any sense and is against all rules to build a html-webpage
And the Port addet to the camera-IP is not necessary if you are using only one Camera.
you have two adresses for the Live view.

1. for IE = http://your_camera_ip/vaview.htm
2. for non IE (eg. Firefox) = http://your_camera_ip/video/mjpg.cgi

you have to build a Switch, so the guest with an IE sees "http://your_camera_ip/vaview.htm" and the other guests are seeing "http://your_camera_ip/video/mjpg.cgi".
That coud be easily done with "php" but you have to save your side with the ending *.php and mark your coding as follows:
Code: [Select]
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<?php
if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "msie")) { 
echo 
'
<iframe src="http://your_camera_ip/vaview.htm" width="640" height="480" frameborder="0" scrolling="no"></iframe>'
;

else

echo 
'
<img src="http://your_camera_ip/video/mjpg.cgi" alt="Livestream" style="width:640px; height:480px;" />'
;
}
?>

</body>
</html>
Title: Re: Embed Video
Post by: Darkbob on September 10, 2013, 10:04:02 AM
Ah!  I think I get it a bit.  I can't just make up an HTML document and save it to my desktop for testing.  I have to make a PHP document and save it to a web server and have the web server run the PHP document or something?

Anyway here's a very simple HTML document that actually does work on all browsers.  It's not exactly live streaming but it reloads every 5 seconds and does more or less what I need with no need to download or install plug-in's or whatever.  Hopefully it will help someone else.

<html>
<head>
<title>CAMERA</title>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<META HTTP-EQUIV="refresh" CONTENT="5">
</head>
<body>
   <img src="http://216.65.178.24/image/jpeg.cgi" alt="Beach Cam">
</body>
</html>

Replace 216.65.178.24 with your own IP address.

Here's the actual web site:

http://mainstayinn.ca

And here's the page (under gallery) with the camera snapshot picture - refresh every 30 sec:

http://mainstayinn.ca/beachcam.html
Title: Re: Embed Video
Post by: Peter von Frosta on September 10, 2013, 10:21:20 AM
do you have a static IP? If not, youŽll face another Problem...
Title: Re: Embed Video
Post by: JavaLawyer on September 10, 2013, 10:29:56 AM
do you have a static IP? If not, youŽll face another Problem...

Good point! You should reserve the IP address of your DCS-942L through your router (preferred approach) or alternatively set the DCS-942L with a static IP address -- otherwise you may find yourself editing your HTML page each time the camera or router is rebooted.
Title: Re: Embed Video
Post by: Darkbob on September 10, 2013, 10:35:07 AM
Good point! You should reserve the IP address of your DCS-942L through your router (preferred approach) or alternatively set the DCS-942L with a static IP address -- otherwise you may find yourself editing your HTML page each time the camera or router is rebooted.

I have a reserved IP for my web site and my router points to my camera.  The IP is reserved so all is well on that front but very good advice.
Title: Re: Embed Video
Post by: acellier on September 10, 2013, 10:46:29 AM
@DarkBob -
Glad to see that you got it working!
Title: Re: Embed Video
Post by: JavaLawyer on September 10, 2013, 10:53:23 AM
@DarkBob -
Glad to see that you got it working!


Looks like I PM'd a bit too late!
Thanks for dropping by!  ;)
Title: Re: Embed Video
Post by: Darkbob on September 10, 2013, 10:57:22 AM
Well some day I probably will want to get a true live streaming image off the camera and I also plan to learn more about PHP too so it wasn't a waste.  For now I've got an image that refreshes every X seconds so I'm happy.  That HTTP authentication issue was huge so that helped too.  

By the way, if you turn off HTTP authentication people who know a bit about the camera can go right into your admin page and mess up your camera (now who would do that!!!). 

The trick was to leave HTTP authentication turned on but uncheck the Snapshot Authentication.

Thanks everybody!
Title: Re: Embed Video
Post by: Peter von Frosta on September 10, 2013, 12:20:19 PM
By the way, if you turn off HTTP authentication people who know a bit about the camera can go right into your admin page and mess up your camera (now who would do that!!!). 
Only when you logged in as an Admin before and the sessionID or Cookie did not expired