-->

Support


Subscribe to Axis Network Video eNews

Enter your E-mail:


Axis enews | Archive

Search

Technical Note: Live Video on a high hit rate site


The information in this article applies to:

  • AXIS 2100/2120/2400/2401/2420 from F/W version 2.12 and AXIS 2400+/2401+ from F/W version 3.01.

Summary

This article shows how to include a live video from an Axis network video product on a Microsoft IIS Web server page using an intermediate FTP server.

More information

This is how the Goldie demo is implemented!! If a site has many simultaneous connections, you must "protect" the Axis network video product from overload. Do this by buffering the images on a high performance Web server. The Axis network camera has built-in functionality that enables it to upload images automatically to the "buffer server".

A high hit-rate Internet site may overload the Axis network camera since the maximum number of users who can receive live images simultaneously is 10. Below we explain how you can set this up on a Microsoft IIS Web server.

 

General system description (See picture above)
Configure the Axis network camera to deliver images sequentially to an FTP server. This is done using the set-up wizard in the product. The Web server (in most cases the same computer as the FTP server) will, from these images, generate an image stream to all users who access the Web page.

Set up an intermediate Microsoft IIS/PWS

Use LiveImg.dll when you want to deliver motion jpeg images from your Windows NT based Web server. LiveImg reads jpeg images from the hard disk and adds the HTTP headers required for motion jpeg before the images are pushed to the client.
LiveImg is a Windows ISA (ISAPI Extension DLL). You must use an ISAPI-compliant Web server like the Microsoft IIS/PWS 4.0 to run LiveImg.dll.
The LiveImg.dll is called the same way as any other CGI program within your HTML page with image path, fps, duration etc as parameters. 

Preparing the FTP and Web server

  1. Create the image directory on the FTP server.
    Example: c:\inetpub\ftproot\live
    Create a Web Server alias (virtual directory) and use this as the image path in the Web page
    Example: http://[WebServer]/live/
  2. Set up the Camera to continuously store images in this FTP directory.
  3. Get the LiveImg.dll here and copy it to the "execute" directory in your Web server file tree (typically c:\inetpub\wwwroot\cgi-bin if you are using Microsoft IIS/PWS).
    Important: If you need to reinstall LiveImg.dll, you have to stop the WWW service, install the LiveImg.dll and then start the service again. Microsoft IIS/PWS loads the ISA when it is called the first time and it is not unloaded until the service is stopped.
  4. Copy the Axis viewing ActiveX component available here to your CODEBASE directory and name it AxisCamControl.ocx.
  5. Create a Web page that contains the HTML code in the example. Change the BaseUrl, File and OcxFile.

 

CGI syntax and parameters in the HTML page
Syntax:
http://<web_server>/<cgidirectory>/liveimg.dll?[push?]path=<imagepath>
[&<parameter>=<value>...]
(all in one line)
Note: The CGI command push can be omitted because push is the default command handler in LiveImg.dll. The parameter names can be omitted if they are written in the correct order.

Parameters and Description:

path: The image path (i.e. /live/image.jpg).
fps | fpm: Frames/second or frames/minute.
duration: For how many seconds the images should be pushed to the client.
timeout: The image feed stops after timeout seconds if the image has not been updated.

Examples:
Deliver 3 images/second during 60 seconds. Stop after 30 seconds if the image has not been updated (default parameter values):
http://<web_server>/cgi-bin/liveimg.dll?path=/live/image.jpg

Deliver 10 images/second during 3 minutes. Use default timeout:
http://<web_server>/cgi-bin/liveimg.dll?path=/live/image.jpg
&fps=10&duration=180
(all in one line)

Deliver 1 image every 10 seconds during 1 hour. Timeout 60 seconds:
http://<web_server>/cgi-bin/liveimg.dll?path=/live/image.jpg
&fpm=6&duration=3600&timeout=60
(all in one line)

Example

<html>
<head>
<title>MJPG Live Demo</title>
</head>
<body>
<center>
<h2>Motion JPEG image on a MS IIS web server via an intermediate FTP server</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 Web server
// Example: var BaseURL = "http://www.axis.com/";
var BaseURL = "http://[WebServer]/";

// DisplayWidth & DisplayHeight specifies the displayed width & height of the image.
// The values depend on what Network Camera and resolution are used.
// Select the Network Camera and resolution by removing the "//" at  the beginning 
// of the applicable line.
// Note that only one can be enabled.

// AXIS 2100
// var DisplayWidth = "320";var DisplayHeight = "240";// Resolution 320x240:
// var DisplayWidth = "640";var DisplayHeight = "480";// Resolution 640x480:

// AXIS 2120/2400/2400+/2401/2401+/2420 PAL
// var DisplayWidth = "352";var DisplayHeight = "288";// Resolution 352x288:
// var DisplayWidth = "704";var DisplayHeight = "576";// Resolution 704x576:

// AXIS 2120/2400/2400+/2401/2401+/2420 NTSC
// var DisplayWidth = "352";var DisplayHeight = "240";// Resolution 352x240:
// var DisplayWidth = "704";var DisplayHeight = "480";// Resolution 704x480:

// This is the filepath to the LiveImg ISA, updated image and the CGI parameters
// Example: var File =  "cgi-bin/liveimg.dll?path=/live/image.jpg&fps=1&duration=360&timeout=60";
var File = "[path]/liveimg.dll?path=/[path/image.jpg]&fps=x&duration=y&timeout=z";

// This is the filepath to the ActiveX ocx needed by Internet Explorer
// note the version number that is needed.
// Example: var OcxFile = "activex/AxisCamControl.ocx#Version=1,0,1,42";
var OcxFile = "[path]/AxisCamControl.ocx#Version=1,0,1,42";

// 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=\"CamImage\" WIDTH="
output += DisplayWidth;
output += " HEIGHT=";
output += DisplayHeight;
output += " CLASSID=CLSID:917623D1-D8E5-11D2-BE8B-00104B06BDE3 ";
output += "CODEBASE=\"";
output += BaseURL;
output += OcxFile;
output += "\">";
output += "<PARAM NAME=\"URL\" VALUE=\"";
output += BaseURL;
output += File;
output += "\"> <BR><B>Axis ActiveX Camera Control</B><BR>";
output += "The AXIS ActiveX Camera 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
output = "<IMG SRC=\"";
output += BaseURL;
output += File;
output += "?dummy=garb\" HEIGHT=\"";
// The above dummy cgi-parameter helps some versions of NS
output += DisplayHeight;
output += "\" WIDTH=\"";
output += DisplayWidth;
output += "\" ALT=\"Moving Image Stream\">";
}
document.write(output);
</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