Support


Subscribe to Axis Network Video eNews

Enter your E-mail:


Axis enews | Archive

Search

Technical Note: Live Video on a medium hit rate site using an 
AXIS 205 Network Camera


The information in this article applies to:

  • AXIS 205 Network Camera from F/W version 4.04

Summary

This article shows how to include a live video from an AXIS 205 Network Camera on a Web page.

More information

If you have direct Ethernet network connectivity available for the Axis Camera Server, simply connect the Axis Network Camera to your network and start to view images directly from it. The embedded web server handles everything. You are also able to easily configure your own web page inside the product itself. 

You may also want to include live video on your own web page, simply follow the description available here. The Axis Network Camera is able to handle 20 simultaneous connections; this number is more then enough on most medium hit rate sites. 

The code below is slightly more complex but it does work for most browsers. The first time this html page is accessed by Microsoft Internet Explorer (Windows) users will be requested to download an ActiveX component for image viewing. All you have to do is to specify the BaseURL with the IP address of your camera as described in the example. 

Example

<html>
<head>
<title>MJPG Live Demo</title>
</head>
<body>
<center>
<h2>Motion JPEG image</h2>
<!-- Cut from here to the end of image display comment -->
<!-- Note: If you do not see a JavaScript below in the view source window you must -->
<!-- first save the html file from your browser, then open the saved -->
<!-- file in a text editor, for instance Notepad.-->

<SCRIPT LANGUAGE="JavaScript">// Set the BaseURL to the url of your camera
// Example: var BaseURL = "http://172.21.1.122/";
// Since this file is located inside the unit itself, no base url is specified here

var BaseURL = "http://[myCamera]/";

// DisplayWidth & DisplayHeight specifies the displayed width & Height of the image.
// You may change these numbers, the effect will be a stretch or a shrink of the image

var DisplayWidth = "320";
var DisplayHeight = "240";

// This is the filepath to the image generating file inside the camera itself

var File = "axis-cgi/mjpg/video.cgi?resolution=320x240";

// No changes required below this point

var output = "";
if ((navigator.appName == "Microsoft Internet Explorer") &&
(navigator.platform != "MacPPC") && (navigator.platform != "Mac68k"))
{

// If Internet Explorer for Windows then use ActiveX
output = '<OBJECT ID="Player" width='
output += DisplayWidth;
output += ' height=';
output += DisplayHeight;
output += ' CLASSID="CLSID:745395C8-D0E1-4227-8586-624CA9A10A8D" ';
output += 'CODEBASE="';
output += BaseURL;
output += 'activex/AMC.cab#version=2,0,21,0">';
output += '<PARAM NAME="MediaURL" VALUE="';
output += BaseURL;
output += File + '">';
output += '<param name="MediaType" value="mjpeg-unicast">';
output += '<param name="ShowStatusBar" value="0">';
output += '<param name="ShowToolbar" value="0">';
output += '<param name="AutoStart" value="1">';
output += '<param name="StretchToFit" value="1">';
output += '<BR><B>Axis Media Control</B><BR>';
output += 'The AXIS Media Control, which enables you ';
output += 'to view live image streams in Microsoft Internet';
output += ' Explorer, could not be registered on your computer.';
output += '<BR></OBJECT>';
} else {

// If not IE for Windows use the browser itself to display
theDate = new Date();
output = '<IMG SRC="';
output += BaseURL;
output += File;
output += '&dummy=' + theDate.getTime().toString(10);
output += '" HEIGHT="';
output += DisplayHeight;
output += '" WIDTH="';
output += DisplayWidth;
output += '" ALT="Camera Image">';
}
document.write(output);
document.Player.ToolbarConfiguration = "play,+snapshot,+fullscreen"
// document.Player.UIMode = "MDConfig";
// document.Player.MotionConfigURL = "/axis-cgi/operator/param.cgi?ImageSource=0"
// document.Player.MotionDataURL = "/axis-cgi/motion/motiondata.cgi";
</SCRIPT>

<!-- End of image display part -->
</body>
</html>

 

Axis does not take any responsibility for how these configuration changes may affect your system. If the modification fails or if you get other unexpected results, you may have to restore the factory default settings as described in the User’s Manual.


 

 

Axis is the world’s leading expert in network video

    Glossary  |  Contact  |  Sites  |  Privacy Statement