Start

How to change the settings of Web Camera?

User should send the predefined HTTP requests to Web Camera. After camera receives the requests, it changes the corresponding settings.
For example, if user want to add another user named "camuser", whose password is success, he/she should send HTTP request as below:
http://192.168.1.100/SetUser.cgi?User=root&Pass=pass
(suppose that the IP of camera is 192.168.1.100)

Web Camera would send the response to the client, which is probably not what the html makers require. "RedirectUrl" is supported in some HTTP request, and the responsing web page can be redirected to the address specified by "RedirectUrl". Suppose that browser should be switch to "http://192.168.1.100/Show.htm" after a user was added, the HTTP request should be:
http://192.168.1.100/SetUser.cgi?User=camuser&Pass=success&RedirectUrl=Show.htm
in HTML£º

<form action="/SetUser.cgi">
 <input name=User>
 <input name=Pass>
 <input type=hidden name=RedirectUrl value="/Show.htm">
 <input type=submit value=OK>
</form>

How to get the settings of Web Camera?

User can get current camera status by calling /GetImgSetting.cgi. To get other status or settings, the corresonding requests can be send to the camera HTTP server. For example, if user want to get the users list of Web Camera, he can visit:
http://192.168.1.100/GetUser.cgi
A character string of users list will be returned.
Is it urgy? Yes, the users list should be decorated, and be shown more beautifully. Considering this feature, a JavaScript text so that HTML can show the text in various way is also supported. Visit:
http://192.168.1.100/GetUser.cgi?JsVar=sUserList
(here sUserList can be replaced by other value). The JavaScript text returned is as the below:
sUserList=root\npass\n';
in HTML:

<html>
<head>
<script src="/GetUser.cgi?JsVar=sUserList"></script>
</head>
<body>
<script>
alert(sUserList);
</script>
</body>
</html>

Further more, a feature named "OnJs" is aslo support, eg: http://192.168.1.100/GetUser.cgi?JsVar=sUserList&OnJs=MyFun
The JavaScript text returned is as the below:
sUserList=root\pass\n';
MyFun(this);
It's maybe helpful in case that user want call a function immediately after he get the settings .


CmdList

All CGIs supported:

Camera Control

ChangeResolution.cgi
Change resolution of camera's images.
ChangeCompressRatio.cgi
Change quality of camera's images.
ChangeBrightness.cgi
Change brightness of camera's images.
ChangeContrast.cgi
Change contrast of camera's images.
ChangeSaturation.cgi
Change saturation of camera's images.
ChangeHue.cgi
Change hue of camera's images.
ChangeSharpness.cgi
Change sharpness of camera's images.
SetMotionDetect.cgi
Enable or disable motion detect.
SetMonitorRect.cgi
Set the rectangle for motion detect.

User management

GetMyself.cgi
Get the username who sent this HTTP request.
SetUser.cgi
Add a user or change the password for existed user.
DelUser.cgi
Delete a user account.
GetUser.cgi
Get the users list of IP Camera.
SetUserCheck.cgi
Enable or disable user authorization check.

Email

SetMail.cgi
Configure email for sending motion-detected images.
GetMail.cgi
Get email setting for send motion-detected images.

Ftp

SetFtp.cgi
Configure FTP for sending motion-detected images.
GetFtp.cgi
Get ftp setting for send motion-detected images.

Time

SetTime.cgi
Set time zone and time.
GetTime.cgi
Get current IP Camera's time zone and time.

Network

SetIP.cgi
Tell IP Camera how to set an initial IP.
GetIP.cgi
Get IP settings.

Http Server

SetHttp.cgi
Set the parameters for HTTP server (Currently only tcp port).
GetHttp.cgi
Get HTTP server's settings.

PTZ

PTZ.cgi
Pan/Tile/Zoom control command set
PTZPreset.cgi
Preset control command set.

Event

GetEvent.cgi
Getting Event status
SetEvent.cgi
Setting Event status and related Action.

GPIO

GetDIType.cgi
Getting GPIO input port Configuration
SetDIType.cgi
Setting GPIO input port Configuration
GetGpioOutput.cgi
Getting Digital output status
SetGpioOutput.cgi
Getting Digital Input status from channel 0 to channel 1

Other

SetName.cgi
Set camera's name.
GetName.cgi
Get camera's name.
GetStatus.cgi
Get run-time status of IP Camera.
GetLog.cgi
Get IP Camera's system logs information.
GetVer.cgi
Get IP Camera's version.
SetFactoryDefault.cgi
Change all settings to factory-default.
Reboot.cgi
Reboot IP Camera.
GetData.cgi
Get images/status with "multipart/x-mixed-replace" mime-type.
Cmd.cgi
Use this command to combine several commands to a single http request, that is, user can call two or more commands through Cmd.cgi.


PTZ

GetEvent.cgi

Description

Getting Event status

Grammar

/GetEvent.cgi?

Remark

Return Event status of the video server

Example

Get All Event Status

<html>
<script src="/ GetEvent.cgi
</script>
</html>


PTZ

SetEvent.cgi

Description

Setting Event status and related Action.

Grammar

/SetEvent.cgi?Reset=<FALSE|TRUE>&Index=<Value>&Input_Type=<0|1>&Enable_Flag=<FALSE|TRUE>&Action_FTP=<ON|OFF>&Action_MAIL=<ON|OFF>&Action_DO=<ON|OFF>&Action_MSG=<ON|OFF>&Action_PRESET=<ON|OFF>&EventFrameRate=(1-100)&Cam_index=<0|1> &Input_index=<Value>&Output_index=<Value>

Remark

IP Camera can work in authorization mode .
Index=0~2  provide 3 event index for user to setup event.

Input_Type: 0 = Digital Input 0, 1 = Digital Input 1, ……. 100 = Motion detection

Enable_Flag:FALSE|TRUE, TRUE=ENABLE, FALSE=DISABLE

Action_FTP=<ON|OFF>  Trigger FTP Service when Event happens

Action_MAIL=<ON|OFF>  Trigger MAIL Service when Event happens

Action_DO=<ON|OFF>  Trigger DO Service when Event happens

Action_MSG=<ON|OFF>  Trigger MSG Service when Event happens

Action_PRESET=<ON|OFF>  Trigger PRESET Service when Event happens

Input_index=<Value>

Output_index=<Value>

Reset=<FALSE|TRUE> Clear all Event status.

EventFrameRate=(1-30)  Time Delay for next event by seconds.

Example

Setup first Event=> DI trigger "DO" and "MAIL"

<html>
<script src="/ SetEvent.cgi?Index=0&Input_Type=0&Enable_Flag=TRUE&Action_FTP=ON&Action_DO=ON
</script>


PTZ

SetGpioOutput.cgi?

Description

Getting Digital output status

Grammar

/ SetGpioOutput.cgi? <Channel=0>&Value=<ON|OFF>

Remark

IP Camera can work in authorization mode .

Channel Only 0 for this version
Value ON to turn on Output, OFF to turn off

Example

Turn On/Off Output

<html>
<script src="/ SetGpioOutput.cgi?Value=ON
</script>


PTZ

GetGpioOutput.cgi?

Description

Getting Digital output status

Grammar

/ GetGpioOutput.cgi?

Remark

IP Camera can work in authorization mode .

Example

Check status of Digital Output

<html>
<script src="/ GetGpioOutput.cgi?
</script>


PTZ

GetDIType.cgi

Description

Getting GPIO input port Configuration

Grammar

/ GetDIType.cgi?

Remark

IP Camera can work in authorization mode.

Example

Get All DI Type setting

<html>
<script src="/ GetDIType.cgi
</script>


PTZ

SetDIType.cgi?

Description

Setting GPIO input port Configuration

Grammar

/ SetDIType.cgi?Channel=<0|1>&Enable=<FALSE|TRUE>&Type=<NC|NO>

Remark

IP Camera can work in authorization mode.
Channel=<0|1> For different DI

Enable=<FALSE|TRUE> Accept signal from DI

Type=<NC|NO> NC = Normal Close and NO = Normal Open

Example

Set DI 0 to Normal Close and Enable the function

<html>
<script src="/ SetDIType.cgi?Channel=0&Enable=TRUE&Type=NC
</script>


PTZ

GetVideoMode.cgi

Description

Getting Video Mode for NTSC or PAL

Grammar

/GetVideo.cgi[?Camera=<0~3>]

Remark

IP Camera can work in authrozation mode .

Camera: Channel Number is from 0 to 3. The Default value is 0. This option is for 4 ports device.

Return Value

VideoMode = <0|1>

(refer to SetVideoMode.cgi)

Example

<html>
<script src="/GetvideoMode.cgi">
</script>


PTZ

SetVideoMode.cgi

Description

Setting Video Mode for NTSC or PAL

Grammar

/SetVideo.cgi?Mode=<0|1>[&Camera=<0~3>]

Remark

IP Camera can work in authrozation mode .

Camera: Channel Number is from 0 to 3. The Default value is 0. This option is for 4 ports device.

Mode :
0: NTSC mode
1: PAL mde

Example

<html>
<script src="/SetVideoMode.cgi?Camera=0&Mode=1">
</script>


ChangeResolution

 ChangeResolution.cgi

Description

Change resolution of camera's images. (administrator privilege required)

Grammar

/ChangeResolution.cgi?ResType=value[&Camera=<0~3>[&RedirectUrl=sUrl]]

Remark

Camera : Channel Number is from 0 to 3. The default value is 0. This option is for 4 ports device.

Now camera supports 4 types of resolution:

For NTSC Mode:
0 - {160,120}<{176, 144}
1 - {320,240}<{352, 288}
2 - {640, 480}

For PAL Mode:
0 - {176, 144}
1 - {352, 288}
2 - {640, 480}

Example

<html>
<form action=/ChangeResolution.cgi>
Resolution:
<select name=ResType>
 <option value=0>176 * 144</option>
 <option value=1>352 * 288</option>
 <option value=2>320 * 240</option>
 <option value=3>640 * 480</option>
</select><br>
<input type=submit value=OK>
</form>


ChangeCompressRatio

 ChangeCompressRatio.cgi

Description

Change quality of camera's images. (administrator privilege required)

Grammar

/ChangeCompressRatio.cgi?Camera=<0~3>[&Ratio=value[&RedirectUrl=sUrl] ]

Remark

Camera:
You can set "Channel Number" by this parameter. This parameter is for 4 Ports device.

Ratio:
0 - poor quality
1 - low quality
2 - medium quality
3 - high quality
4 - excellent quality

Example

<html>
<form action=/ChangeCompressRatio.cgi>
Quality:
<select name=Ratio>
 <option value=0>Poor</option>
 <option value=1>Low</option>
 <option value=2>Medium</option>
 <option value=3>High</option>
 <option value=4>Excellent</option>
</select><br>
<input type=submit value=OK>
</form>


ChangeBrightness

 ChangeBrightness.cgi

Description

Change brightness of camera's images. (administrator privilege required)

Grammar

/ChangeBrightness.cgi?Camera=<0~3>[&Brightness=value[&RedirectUrl=sUrl] ]

Remark

Camera : Channel Number (0~3). default value is 0. (This parameter is for 4 ports device.)
Now camera supports 256 level of brightness, and the corresponding value of Brightness is from 0 to 255.

Example

<html>
<form action=/ChangeBrightness.cgi>
Brightness(0-255):
<input name=Brightness><br>
<input type=submit value=OK>
</form>


ChangeContrast

 ChangeContrast.cgi

Description

Change contrast of camera's images. (administrator privilege required)

Grammar

/ChangeContrast.cgi?Camera=<0~3>[&Contrast=value[&RedirectUrl=sUrl]

Remark

Camera: Channel Number is from 0 to 3. This parameter is for 4 ports device.

Now camera supports 5 level of contrast, and the value of Contrast is from 0 to 255, which is mapped linearly to 5 level.

Example

<html>
<form action=/ChangeContrast.cgi>
Contrast(0-255):
<input name=Contrast><br>
<input type=submit value=OK>
</form>


ChangeSaturation

 ChangeSaturation.cgi

Description

Change saturation of camera's images. (administrator privilege required)

Grammar

/ChangeSaturation.cgi?Saturation=value[&Camera=<0~3>[&RedirectUrl=sUrl]]

Remark

Camera : Channel Number is from 0 to 3. The default value is 0. This option is for 4 ports device.

Now camera supports 11 level of saturation, and the value of Saturation is from 0 to 255, which is mapped linearly to 11 level.

Remark

<html>
<form action=/ChangeSaturation.cgi>
Saturation(0-255):
<input name=Saturation><br>
<input type=submit value=OK>
</form>


ChangeHue

 ChangeHue.cgi

Description

Change hue of camera's images. (administrator privilege required)

Grammar

/ChangeHue.cgi?Camera=<0~3>&Hue=value[&RedirectUrl=sUrl]

Remark

Camera: Channel number is from 0 to 3. This parameter is for 4 ports device. The default value is 0.

Now camera supports 11 level of hue, and the value of Hue is from 0 to 255, which is mapped linearly to 11 level.

Example

<html>
<form action=/ChangeHue.cgi>
Hue(0-255):
<input name=Hue><br>
<input type=submit value=OK>
</form>


SetMotionDetect

 SetMotionDetect.cgi

Description

Enable or disable motion detect. (administrator privilege required)

Grammar

/SetMotionDetect.cgi?Camera=<0~3>&Enable=<true|false>[&RedirectUrl=sUrl]

Remark

Camera : Channel Nubmer is from 0 to 3. The default value is 0. This option is for 4 ports device.

In the text that GetStatus.cgi returns, bytes 60 ~ 65 (total 6 bytes) shows the defferent images found by motion-detect program. Check these bytes, and compare with the previous value, and if thest bytes have changed, motion detected. When system bootup, the initial value is 999999, and after motion detected, the value increases from 0 to 800000. If it is up to 800000, returns to 0.

Example

<html>
<form action=/SetMotionDetect.cgi>
<input name=Enable type=checkbox>Enable motion detect<br>
<input type=submit value=OK>
</form>


GetName

 GetRotation.cgi

Description

Get camera's Rotation flag. (no privilege required)

Grammar

/GetRotation.cgi[?JsVar=variable[&OnJs=function]]

Remark

Each line represent an item, and every item is in the format as Name = Value.

Rotation:
0 - 0 degree
1 - 180 degree

Example

<html>
<script>
function ShowRotationValue(o)
{
 alert(sName);
}
</script>
<script src="/GetRotation.cgi?JsVar=sName&OnJs=ShowResult">
</script>


SetRotation

 SetRotation.cgi

Description

Change rotation flag of camera's images. (administrator privilege required)

Grammar

/SetRotation.cgi?Camera=<0~3>&Rotation=value

Remark

Camera : Channel Nubmer is from 0 to 3. The default value is 0. This option is for 4 ports device.

Rotation:
0 - 0 degree
1 - 180 degree

Example

<html>
<form action=/SetRotation.cgi>
<input name=Rotation>
<input type=submit value=OK>
</form>


GetData

 GetData.cgi

Description

Get images/status with "multipart/x-mixed-replace" mime-type. (no privilege required)

Grammar

/GetData.cgi?[Camera=value]

Remark

GetData.cgi is designed for "server-push". "Server-push" means that user need not always detect camera's state, and the camera server transfer the camera data on its own.

You can request the camera image data for specific channel by assigning the value of "Camera". The default value of "Camera" parameter is zero. It means that the default channel is channel one.

GetData.cgireturns:

HTTP/1.0 200 OK
Date: Wed, 19 Feb 2003 03:40:16 GMT
Server: WYM/1.0
Connection: close
Content-Type: multipart/x-mixed-replace;boundary=MYBONDBOUDARY
Last-Modified: Wed, 19 Feb 2003 03:40:16 GMT
Pragma: no-cache
Cache-Control: no-cache
Expires: 01 Jan 1970 00:00:00 GMT

--MYBONDBOUDARY
Content-Type: image/jpeg
Content-Length: 78900
Trigger_Flag: 1
<content of jpeg file>

--MYBONDBOUDARY
Content-Type: image/jpeg
Content-Length: 78900
Trigger_Flag: 1
<content of jpeg file>

--MYBONDBOUDARY
...

"Content_Lenght" expresses the data length of Jpeg image.
"Trigger_Flag" expresses whether motion detection was triggered or not. "1" means motion detection was triggered for this frame.

Example

You want to request image data from channel two.

<!--
In mozilla, you can view active image through tag "<img>".
-->
<img src=/GetData.cgi?Camera=1 >


GetImgSetting

 GetImgSetting.cgi

Description

Get camera's image setting. (no privilege required)

Grammar

/GetImgSetting.cgi[?Camera=<0~3>&sVar=variable[&OnJs=function]]

Remark

Camera : Channel Nubmer is from 0 to 3. The default value is 0. This option is for 4 ports device.

Each line represent an item, and every item is in the format as Name = Value.
(Refer to GetImgSetting.cgi)

Example

<html>
<script>
function ShowResult(o)
{
 alert(sName);
}
</script>
<scriptsrc="/GetImgSetting.cgi?JsVar=sName&OnJs=ShowResult">
</script>


GetMyself

 GetMyself.cgi

Description

Get the username who sent this HTTP request. (no privilege required)

Grammar

/GetMyself.cgi[?ShowPrivilege=<true|false>][&JsVar=variable[&OnJs=function]]

Remark

IP Camera can work in authrozation mode or non-authrozation mode (SetUserCheck.cgi). In non-authrozation mode, everyone is supposed as administrator and "administrator" is returned by "GetMyself.cgi".
If "ShowPrivilege=true", GetMyselft.cgi returns:
0 - super user;
1 - common user.

Example

<html>
<script>
function ShowResult(o)
{
 alert(sMyName);
}
</script>
<script src="/GetMyself.cgi?JsVar=sMyName&OnJs=ShowResult">
</script>


SetUser

 SetUser.cgi

Description

Add a user or change the password for existed user. (administrator privilege required)

Grammar

/SetUser.cgi?User=sUserName&Pass=sPassword [&RedirectUrl=sUrl]

Example

<html>
<form action=/SetUser.cgi>
Username:<input name=User><br>
Password:<input name=Pass type=password><br>
<input type=submit value=OK>
</form>


DelUser

 DelUser.cgi

Description

Delete a user account. (administrator privilege required)

Grammar

/DelUser.cgi?User=sUserName[&RedirectUrl=sUrl]

Example

<html>
<form action=/DelUser.cgi method=get>
User name:<input name=User><br>
<input type=submit value=OK>
</form>


GetUser

 GetUser.cgi

Descrition

Get the users list of IP Camera. (administrator privilege required)

Grammar

/GetUser.cgi[?ShowPrivilege=<true|false>][&JsVar=variable[&OnJs=function]]

Remark

Format of returned text:
If ShowPrivilege=false, Each line represent a user name.
Otherwise, Every two lines represent a user, and first line is user name, the second is privilege.

Example

<html>
<script>
function ShowResult(o)
{
 alert(sUserList);
}
</script>
<script src="/GetUser.cgi?JsVar=sUserList&OnJs=ShowResult">
</script>


SetUserCheck

 SetUserCheck.cgi

Description

Enable or disable user authorization check. (administrator privilege required)

Grammar

/SetUserCheck.cgi?Check=<true|false>[&RedirectUrl=sUrl]

Example

<html>
<form action=/SetUserCheck.cgi>
<input name=Check type=checkbox>enable user authorization
<input type=submit value=OK>
</form>


SetMail

 SetMail.cgi

Description

Configure email for sending motion-detected images. (administrator privilege required)

Grammer

/SetMail.cgi?Enable=<true|false>[&MailServer=sServer][&Sender=sSenderName][&Receiver=sReceiverAddress][&Subject=sSubject][&User=sUserName][&PassWord=sPassword][&CheckFlag=CHECK][&RedirectUrl=sUrl]

Remark

Parameters:
Enable - true, send motion-detected images, false, do not send motion-detected images;
MailServer - mail server address;
Sender - sender's email address;
Receiver - receiver's email address, multi-receivers seperated by ';';
Subject - subject of email;
User - user name for loginging MailServer;
PassWord - password for logining MailServer;
CheckFlag - CHECK, the MailServer need check password;

When calling SetMail.cgi, the omitted parameters keep the last value, expect that omitting "Enbale" means "Enable=false", and omitting "CheckFlag" means that MailServer do not need a password.
Visit /GetMail.cgi to get the current settings.

Example

<html>
<form action="/SetMail.cgi">
<table>
<tr><td>Mail Server</td><td><input name=MailServer size=32></td></tr>
<tr><td>Username</td><td><input name=User size=32></td></tr>
<tr>
 <td><input name=CheckFlag value=CHECK type=checkbox>Password</td>
 <td><input name=PassWord type=password size=32></td>
</tr>
<tr><td>Sender Address</td><td><input name=Sender size=32></td></tr>
<tr><td>Receiver Address</td><td><input name=Receiver size=32></td></tr>
<tr>
 <td>Send mail when motion detected</td>
 <td>
  <input name=Enable type=radio value=true>Yes
  <input name=Enable type=radio value=false>No
 </td>
</tr>
</table>
<input type=submit value=OK>
</form>


GetMail

 GetMail.cgi

Description

Get email setting for send motion-detected images. (administrator privilege required)

Grammar

/GetMail.cgi[?JsVar=variable[&OnJs=function]]

Remark

Each line represent an item, and every item is in the format as Name = Value.
(Refer to SetMail.cgi)

Example

<html>
<script>
function ShowResult(o)
{
 alert(sMailSetting);
}
</script>
<script src="/GetMail.cgi?JsVar=sMailSetting&OnJs=ShowResult">
</script>


SetFtp

 SetFtp.cgi

Description

Configure FTP for sending motion-detected images. (administrator privilege required)

Grammar

/SetFtp.cgi?Enable=<true|false>[&FtpServer=sServer][&User=sUserName][&Pass=sPassword][&Account=sAccount][&UploadPath=sPathName][&RedirectUrl=sUrl][&FtpRTVideo=TRUE|FALSE][&FtpFrameRate=1-100]

Remark

Parameters:
Enable - true, upload motion-detected images, false, do not upload motion-detected images;
FtpServer - ftp server address;
User - user name on ftp server;
Pass - password for logining FtpServer;
Account - account for logining FtpServer (few ftp servers require this infomation);
UploadPath - | path in which images saved on FtpServer;
FtpRTVideo - | flag to enable real-time ftp service
FtpFrameRate- | Duration to upload one image by second

When calling SetFtp.cgi, the omitted parameters keep the last value, expect that omitting "Enbale" means "Enable=false".
Visit /GetFtp.cgi to get the current settings.

Example

<html>
<form action=/SetFtp.cgi>
<table>
<tr><td>Ftp Server</td><td><input name=FtpServer size=32></td></tr>
<tr><td>User</td><td><input name=User size=32></td></tr>
<tr><td>Password</td><td><input type=password name=Pass size=32></td></tr>
<tr><td>Account</td><td><input name=Account size=32></td></tr>
<tr><td>Upload Path</td><td><input name=UploadPath size=32></td></tr>
<tr>
 <td>Upload when motion detected</td>
 <td>
  <input name=Enable type=radio value=true>Yes
  <input name=Enable type=radio value=false>No
 </td>
</tr>
</table>
<p><p>
<input type=submit value=OK>
</form>


GetFtp

 GetFtp.cgi

Description

Get ftp setting for send motion-detected images. (administrator privilege required)

Grammar

/GetFtp.cgi[?JsVar=variable[&OnJs=function]]

Remark

Each line represent an item, and every item is in the format as Name = Value.
(Refer to SetFtp.cgi)

Example

<html>
<script>
function ShowResult(o)
{
 alert(sFtpSetting);
}
</script>
<scriptsrc="/GetFtp.cgi?JsVar=sFtpSetting&OnJs=ShowResult">
</script>


PTZ

SetTimeZone.cgi

Description

Setting Time Zone for device

Grammar

/SetTimeZone.cgi?TimeZone=<szTimeString>&DST=<0|1>&Index=<0~>

Remark

IP Camera can work in authrozation mode .

TimeZone : the string means differential time relative Greenwich, England.
for example, the szTimeString is "+08:00" for Taipei.
DST : DST means "Daylight saving Time". It will enable DST, if DST is 1.
Index : It means the index of array of TimeZone.

Example

<html>
<script src="/SetTimeZone.cgi?TimeZone=+08:00&DST=0&Index=59">
</script>


PTZ

GetTimeZone.cgi

Description

Get Time Zone for device

Grammar

/GetTimeZone.cgi?[sVar=variable[&OnJs=function]]

Remark

IP Camera can work in authrozation mode .

This CGI will return the value of parameter setting of TimeZone.
TimeZone : the string means differential time relative Greenwich, England.
for example, the szTimeString is "+08:00" for Taipei.
DST : DST means "Daylight saving Time". It will enable DST, if DST is 1.
Index : It means the index of array of TimeZone.

Example

<html>
<script src="/SetTimeZone.cgi?">
</script>


SetIP

 SetIP.cgi

Description

Tell IP Camera how to set an initial IP. (administrator privilege required)

Grammar

/SetIP.cgi?IPWay=<manually|dhcp>[&CameraName=sName][&IP=sIP][&Netmask=sNetmask][&Gateway=sGateway][&DNS0=sDNS0][&DNS1=sDNS1][&DNS2=sDNS2][&RedirectUrl=sUrl][&Port=nHttpPort] Remark

If IPWay=manually, IP, Netmask, Gateway, DNS0 ( DNS1, DNS2 ), Http Port should also be specified.
Visit /GetIP.cgi to get the current setting.

Example

<html>
<form action=/SetIP.cgi>
<input type=radio name=IPWay value=manually>Manually
<table>
<td>IP Address</td><td><input name=IP></td></tr>
<tr><td>Subnet mask</td><td><input name=Netmask></td></tr>
<tr><td>Default gateway</td><td><input name=Gateway></td></tr>
<tr><td>DNS 1</td><td><input name=DNS0></td></tr>
<tr><td>DNS 2</td><td><input name=DNS1></td></tr>
<tr><td>DNS 3</td><td><input name=DNS2></td></tr>
</table>
<input type=radio name=IPWay value=dhcp>Automatically by DHCP<br>
<input type=submit value=OK>
</form>


GetIP

 GetIP.cgi

Description

Get IP settings. (no privilege required)

Grammar

/GetIP.cgi[?JsVar=variable[&OnJs=function]]

Remark

Each line represent an item, and every item is in the format as Name = Value.
(Refer to SetIP.cgi)

Example

<html>
<script>
function ShowResult(o)
{
 alert(sIPSetting);
}
</script>
<script src="/GetIP.cgi?JsVar=sIPSetting&OnJs=ShowResult">
</script>


GetName

 GetMac.cgi

Description

Get device's address. (no privilege required)

Grammar

/GetMac.cgi[?JsVar=variable[&OnJs=function]]

Remark

¡@

Example

<html>
<script>
function ShowMacAddress(o)
{
 alert(sMac);
}
</script>
<script src="/GetMac.cgi?JsVar=sMac&OnJs=ShowMacAddress">
</script>


CmdList

 SetHttp.cgi

Description

Set the parameters for HTTP server (Currently only tcp port). (administrator privilege required)

Grammar

/SetHttp.cgi?Port=iPort[&RedirectUrl=sUrl]

Remark

Parameters:

Port - the listening port of http server.

User can use one or two listening ports. To use only one port, send request as "SetHttp.cgi?Port=...".
No difference with these two requests:
SetHttp.cgi?Port=8080

Visit /GetHttp.cgi to get the current setting.

Example

<html>
<form action=/SetHttp.cgi>
<input name=Port>
<input type=submit value=OK>
</form>


GetHttp

 GetHttp.cgi

Description

Get HTTP server's settings. (no privilege required)

Grammar

/GetHttp.cgi[?JsVar=variable[&OnJs=function]]

Remark

Each line represent an item, and every item is in the format as Name = Value.
(Refer to SetHttp.cgi)

Example

<html>
<script>
function ShowResult(o)
{
 alert(sHttpSetting);
}
</script>
<scriptsrc="/GetHttp.cgi?JsVar=sHttpSetting&OnJs=ShowResult">
</script>


 GetPTZ.cgi

Description

Get PTZ Confiuration

Grammar

/GetPTZ.cgi[?Camera=<0~3>][&Config]

/GetPTZ.cgi[?Camera=<0~3>][&Preset][&ALL]

Remark

Refer to SetPTZ.cgi to set PTZ

Example

<html>
<script src= "/GetPTZ.cgi?Camera=2&Config">
</script>
</html>

¡@

<html>
 <script src= "/GetPTZ.cgi?Camera=0&Preset">
</script>
</html>

¡@

<html>
 <script src= "/GetPTZ.cgi?Preset&ALL">
 </script>
</html>

¡@

¡@


PTZConfig

 SetPTZ.cgi

Description

Set PTZ Configuration

Grammar

/SetPTZ.cgi[?Camera=<0~3>][&Model=<PTZ Model>][&Speed=<PTZ Speed>][&Address=<PTZ RS485ID>]

[&AutoPan=<PTZ Autopan>]

/SetPTZ.cgi[?Camera=<0~3>][&Calibrate]

/SetPTZ.cgi[?Camera=<0~3>][&Preset=<PTZ PresetNo>][&PresetName=<PTZ PresetName>]

/SetPTZ.cgi[?Camera=<0~3>][&RemovePreset=<PTZ PresetNo>]

Grammar
 Calibrate is for AcutVista Dome Reset use. This command will reset dome and clear all preset points.

Remark

Refer to GetPTZ.cgi to get PTZ configuration

Model

0: Lilin PIH 7000 Speed Dome

1: Pelco D and compatible

2: AcutVista KD Series

3: IND_7000EM_PT

4: IND_7000EM_PTZ

100: IND_8000EM

¡@

Example

<html>
<script src= "/SetPTZ.cgi?Camera=0&Model=2&Speed=5&Adress=0">
</script>
</html>

¡@

<html>
<script src= "/SetPTZ.cgi?Camera=1&Preset=2&PresetName=MachineRoom">
</script>
</html>

¡@

¡@


 CtlPTZ.cgi

Description

PTZ Control (Pan/Tile/Zoom)

Grammar

/CtlPTZ.cgi[?Camera=<0~3>][&Speed=<0~7>]

[&Dir=<Left|Right|Up|Down|LeftUp|LeftDown|RightUp|RightDown|FocusNear|FocusFar|AutoFocus

|RightDown|ZoomIn|ZoomOut|Stop|AutoPan>]

/CtlPTZ.cgi[?Camera=<0~3>][&GotoPreset=PresetNo][&Calibrate]

/CtlPTZ.cgi[?Camera=<0~3>][&Calibrate]

Grammar
 Calibrate is for AcutVista Reset use. This command will reset dome and clear all preset points.

Example

<html>
<script src= "/CtlPTZ.cgi?Camera=0&Dir=Left</script>
 <script src= "/CtlPTZ.cgi?Camera=0&Dir=Up</script>
 <script src= "/CtlPTZ.cgi?Camera=1&Dir=AutoPan</script>
 <script src= "/CtlPTZ.cgi?Camera=2&Dir=AutoFocus</script>
 <script src= "/CtlPTZ.cgi?Camera=0&GotoPreset=2</script>
 <script src= "/CtlPTZ.cgi?Camera=0&Calibrate</script>


GetCOM

 GetCOM.cgi

Description

Get COM port setting. (no privilege required)

Grammar

/GetCOM.cgi[?JsVar=variable[&OnJs=function]]

Remark

Each line represent an item, and every item is in the format as Name = Value.
(Refer to SetCOM.cgi to set COM port)

Example

<html>
<script>
function ShowCOMPortsetting(o)
{
 alert(sName);
}
</script>
<script src="/GetCOM.cgi?JsVar=sName&OnJs=ShowResult">
</script>


SetCOM

 SetCOM.cgi

Description

Set COM port. (administrator privilege required)

Grammar

/SetCOM.cgi?ComMode=<sName[&BaudRate=sBaudrate][&Parity=sParity][&DataBits=sDataBits][&StopBits=sStopBits]

Remark

[ComMode]: 232|485

[BaudRate]: 300|600|1200|2400|4800|9600|19200|38400|57600|115200

[Parity]: 0: none | 1:odd | 2: even

[DataBits]: 5 | 6 | 7 | 8

[StopBits]: 1| 2

Example

<html>
<form action=/SetCOM.cgi>
COM Mode: <input name=ComMode>
BaudRate: <input name=BaudRate>
Parity: <input name=Parity>
DataBits: <input name=DataBits>
StopBits: <input name=StopBits>
<input type=submit value=OK>
</form>


PTZ

Serial.cgi

Description

This CGI is supported to implement a Generic driver to control device through serial port

Grammar

/Serial.cgi[?DataOut=<command string>][&Bytes=<sendbyts : 1~128>]

Remark

command string : This command string will be sended to serial port. This command string is
hex coded bytes with values of {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}.
Max. command string length is 128 Bytes.
sendbytes : 1~128

IP Camera can work in authrozation mode or non-authrozation mode.

Example

<html>
<script src="/Serial.cgi?DataOut=AB123FC4&Bytes=4
</script>


PTZ

AlertMsg.cgi

Description

Setting Alert Message and Server info.

Grammar

http:\\ServerIP\AlertMsg.cgi?IP=<xxx.xxx.xxx.xxx>&Port=<3000~7000>&Message=<this is message>

Remark

IP Camera can send a string to remote server.
IP =<xxx.xxx.xxx.xxx> IP address of remote server.

Port: Server side connection port

Message: text string.

Example

Send to 192.168.2.37

Port=1024

Message = ok

<html>
<script src="/ AlertMsg.cgi?IP=192.168.2.37&Port=1024&Message=ok
</script>


SetName

 SetName.cgi

Description

Set device's name. (administrator privilege required)

Grammar

/SetName.cgi?CameraName=<sName[&RedirectUrl=sUrl]

Remark

SetCameraName.cgi can set camera name(channel) of this device.
Visit /GetCameraName.cgi to get camera name(channel) of this device.

Example

<html>
<form action=/SetName.cgi>
Camera name: <input name=CameraName>
<input type=submit value=OK>
</form>


GetName

 GetName.cgi

Description

Get camera's name. (no privilege required)

Grammar

/GetName.cgi[?JsVar=variable[&OnJs=function]]

Remark

Each line represent an item, and every item is in the format as Name = Value.

GetCameraName.cgi can get camera name(channel) of this device.
Visit /SetCameraName.cgi to set camera name(channel) of this device.

Example

<html>
<script>
function ShowResult(o)
{
 alert(sName);
}
</script>
<script src="/GetName.cgi?JsVar=sName&OnJs=ShowResult">
</script>


SetCameraName

 SetCameraName.cgi

Description

Set camera's name(channel) of device. (administrator privilege required)

Grammar

/SetCameraName.cgi?CameraName=<sName>[&Camera=<0~3>[&RedirectUrl=sUrl]]

Remark

Camera : Channel Number is from 0 to 3. The default value is 0. This option is for 4 ports device.

SetName.cgi can change device's name.
Visit /GetName.cgi to get the current device setting.

Example

<html>
<form action=/SetCameraName.cgi>
Camera name: <input name=CameraName>
<input type=submit value=OK>
</form>


GetCameraName

 GetCameraName.cgi

Description

Get camera's(channel's) name of device. (no privilege required)

Grammar

/GetCameraName.cgi?Camera=<0~3>[&sVar=variable[&OnJs=function]]

Remark

Camera: Channel Number is from 0 to 3. The default value is 0. This option is for 4 ports device.

Each line represent an item, and every item is in the format as CameraName = Value.

GetName.cgi can get device's name.
Visit /SetName.cgi to set the device name.

Example

<html>
<script>
function ShowCameraName(o)
{
 alert(sName);
}
</script>
<scriptsrc="/GetCameraName.cgi?JsVar=sName&OnJs=ShowResult">
</script>


GetLog

 GetLog.cgi

Remark

Get IP Camera's system logs information. (no privilege required)

Grammar

/GetLog.cgi[?JsVar=variable[&OnJs=function]]

Remark

Administrator and common user may receive different system logs information.
Refer to Log

Example

<html>
<head>
<script>
var sLogConst = [
"Information", 0,
"Error", 1,
"Set user", 11,
"Del user", 12,
"Set user check", 13,
"Open camera", 14,
"Close camera", 15,
"Change resolution", 16,
"Change quality",17,
"Change brightness", 18,
"Change contrast", 19,
"Change saturation", 20,
"Change hue", 21,
"Change Sharpness", 22,
"Set email", 23,
"Set ftp server", 24,
"Dial (pppoe)", 25,
"Dial (modem)", 26,
"New client", 27,
"Set Motion Detect", 28,
"Set Monite Area", 29,
"Set Server Time", 30,
"Set Server IP", 31,
"Set Http Port", 32,
""];

function Hex2IP(s)
{
 var sRt = "";
 var sSuc = false;
 var iDec;
 for (var i = 0; i < 4; i++)
 {
  if (i > 0) sRt += ".";
  iDec = parseInt(s.substr(i * 2, 2), 16);
  if (iDec != 0) sSuc = true;
  sRt += iDec;
 }
 return (sSuc?sRt:"");
}

function Hex2MAC(s)
{
 var sRt = "";
 var sSuc = false;
 var iDec;
 for (var i = 0; i < 6; i++)
 {
  if (i > 0) sRt += ":";
  iDec = parseInt(s.substr(i * 2, 2), 16);
  if (iDec != 0) sSuc = true;
  sRt += s.substr(i * 2, 2);
 }
 return (sSuc?sRt:"");
}

function ShowLog(s)
{
 var sLine, sRes, iType, iTime;
 var iTimeAdjust = parseInt(s.substr(0, 10), 10);
 var dTimeAdjust = new Date();

 sRes = "";
 dTime = new Date(dTimeAdjust - 1000 * iTimeAdjust);
 sRes += "<tr><td colspan=4>System Boot</td><td>"
  + (dTime.getMonth()+1)
  + "/" + dTime.getDate()
  + "/" + dTime.getYear()
  + " " + dTime.getHours()
  + ":" + dTime.getMinutes()
  + "</td></tr>";
 delete dTime;

 for (var i = 10; i < s.length; i += 36)
 {
  sLine = s.substr(i, 36);
  iType = parseInt(sLine.substr(0, 2), 10);
  for (var j = 0; j < sLogConst.length - 1; j += 2)
  {
   if (iType == sLogConst[j + 1])
   {
    sRes += "<tr><td>" + sLogConst[j];
    break;
   }
  }
  if (j >= sLogConst.length - 1)
   sRes += "<tr><td colspan=4>Unknown log info (" + iType + ")\n";

  sRes += "</td><td>" + sLine.substr(2, 4);
  sRes += "</td><td>" + Hex2IP(sLine.substr(6, 8));
  sRes += "</td><td>" + Hex2MAC(sLine.substr(14, 12))
  iTime = parseInt(sLine.substr(26, 10), 10);

  dTime = new Date(dTimeAdjust - 1000 * (iTimeAdjust - iTime));
  sRes += "</td><td>"
   + (dTime.getMonth()+1)
   + "/" + dTime.getDate()
   + "/" + dTime.getYear()
   + " " + dTime.getHours()
   + ":" + dTime.getMinutes()
   + "</td></tr>";
  delete dTime;
 }
 sRes += "</table>"

 document.write(sRes);
}

</script>

<script src="/GetLog.cgi?JsVar=sLog">
</script>

</head>

<body>

<table border=1>
 <tr>
  <td>Main Info</td>
  <td>Append Info</td>
  <td>Operator IP</td>
  <td>Operator MAC</td>
  <td>Time</td>
 </tr>
 <script>ShowLog(sLog);</script>
</table>

</body>


SetFactoryDefault

 SetFactoryDefault.cgi

Description

Restore all settings to factory-default. (administrator privilege required)

Grammar

/SetFactoryDefault.cgi

Remark

System would reboot immediately after the request be called, no response sent to client!
This command can not be combinated with other commands. (Refer to Cmd.cgi)


Reboot

 Reboot.cgi

Description

Reboot IP Camera. (administrator privilege required)

Grammar

/Reboot.cgi


GetVersion

 GetVersion.cgi

Description

Get the version & build infomation of firmware. (no privilege required)

Grammar

/GetVersion.cgi[?JsVar=variable[&OnJs=function]]

Remark

Each line represent an item, and every item is in the format as Name = Value.

Name= CameraVersion
Name= Build

Example

<html>
<script>
function ShowVersion(o)
{
 alert(sName);
}
</script>
<script src="/GetVersion.cgi?JsVar=sName&OnJs=ShowResult">
</script>


SetName

 SetOEM.cgi

Description

Set user-defined banner. (administrator privilege required)

Grammar

/SetOEM.cgi?LOGO=<bValue>

Remark

User-defined banner will be on duty once your logo is uploaded. You can enable or disable it using the above CGI command..

Example

Http://192.168.1.100/SetOEM.cgi?LOGO=0 to disable user-defined banner

Http://192.168.1.100/SetOEM.cgi?LOGO=1 to enable user-defined banner

<html>
<script src= "/SetOEM.cgi?LOGO=0">
</script>
</html>

¡@


Cmd

 Cmd.cgi

Description

Use this command to combine several commands to a single http request, that is, user can call two or more commands through Cmd.cgi.

Grammar

/Cmd.cgi?Cmd=sCommandName1
[&ParamName1=sParamValue1]
[&ParamName2=sParamValue2][...]
[Cmd=sCommandName2
[&ParamName1=sParamValue1]
[&ParamName2=sParamValue2][...]]
[Cmd=sCommandName3...]
[JsVar=variable[&OnJs=function]]
[&RedirectUrl=sUrl]

Remark

Some commands may use the same parameter's name, so the parameter's position should be in correct order. If you place parameters of sCommandName1 after sCommandName2, the behaviour of IP Camera is unexpectable.
If there are sub-commands that get information from IP Camera, (such as GetUser.cgi, PPPoE.cgi?Action=GetInfo), "RedirectUrl" should not be specified, otherwise the browser will be redirected to the address specified by "RedirectUrl", and certainly not what you want.

List of commands that can be combined with Cmd.cgi:

Example

1. Add user abc(password 123), and delete user cba:
/Cmd.cgi?Cmd=SetUser.cgi&User=abc&Pass=123&Cmd=DelUser.cgi&User=cba

<html>
<form action=/Cmd.cgi>
<input type=hidden name=Cmd value=SetUser.cgi>
<input name=User value=abc><br>
<input name=Pass value=123><br>
<br>
<input type=hidden name=Cmd value=DelUser.cgi><br>
<input name=User value=cba>
<input type=submit value=OK>
</form>
</html>

2. get the settings of ftp and email:
/Cmd.cgi?Cmd=GetFtp.cgi&Cmd=GetMail.cgi

<html>
<script>
function ShowResult(o)
{
 alert(s);
}
</script>
<script src="/Cmd.cgi?Cmd=GetFtp.cgi&Cmd=GetMail.cgi?JsVar=s&OnJs=ShowResult"></script>


Status

Remark

/GetStatus.cgi returns a pure text with 73 bytes

Byte 0, 1
Camera State(2)
00 - off
01 - on

Byte 2, 3
Modem State(2)
00 - off
01 - on line(common mode)
02 - connecting(common mode)

Byte 4, 5
PPPoE State(2)
same as Modem State

Byte 6, 7, 8
x-direction(3)
reserved

Byte 9, 10, 11
 y-direction(3)
reserved

Byte 12, 13, 14
focus(3)
reserved

Byte 15, 16, 17
bright(3)
0 - 255

Byte 18, 19, 20
contrast(3)
0 - 255

Byte 21
resolution(1)
00 - {176, 144},
01 - {352, 288},
02 - {320, 240},
03 - {640, 480},
04 - {800, 600},
05 - {1280, 960}

Byte 22
compression ratio(1)
reserved

Byte 23
 privilege(1)
0 - super user(administrator)
1 - common user

Byte 24, 25, .., 29
picture index(6)
(999999 - invalid picture)

Byte 30
email state(1)
0 - do not send motion-detected pictures
1 - send motion-detected pictures, success
2 - send motion-detected pictures, fail (wrong ip, user or password?)

Byte 31
user check(1)
 0 - do not check user, any user can connect and act as a super user
1 - username and password required, only username is "administrator" has
the super privilege.

Byte 32, 34, .., 39
image file length(8)
length in bytes

Byte 40, 42, .., 55
 monite rect(16)
4 - left(0-9999)
4 - top(0-9999)
4 - right(0-9999)
4 - bottom(0-9999)

Byte 56
 ftp state(1)
0 - disable ftp upload
1 - enable ftp upload, and upload success
2 - enable fpt upload, but fail(wrong ip, user or password?)

Byte 57, 58, 59
 saturation(1)
0 - 255

Byte 60, 61, ..., 65
 motion detected index
(999999 - init value)

Byte 66, 67, 68
 hue
0 - 255

Byte 69, 70, 71
 sharpness
0 - 255

Byte 72
 motion detect way
0 - no motion detect
non-zero - motion detect


 Log

Decription

IP Camera records user's operations and other important information, some of which is only visible to administrator. User can call /GetLog.cgi to get the logs.

Remark

As a example, below is the text returned by /GetLog.cgi:

000005398427    0A820B570000E8E26A8800000000022410.10A820B570000E8E26A8800000000082334230A820B570000E8E26A880000000012

The very beginning of the text(blue) is the relative-time when IP Camera returned this text, where relative-time is the seconds since IP Camera booting. The benefit using relative-time is that the correct time can be shown even though server's time is not set. (Refer to SetTime.cgi)
after the 10 blue bytes, every 36 bytes represent a piece of log infomation. So 3 logs exist totally on the above.

The structure of every log information:
byte 0, 1 - reason for recording this log, refer to Table 1. eg: 27 is shown that new client connect to IP Camera.
byte 2 ~ 5 - reserved.
byte 6 ~ 13 - operator's IP. eg: 0A820B57 is 10.130.11.87.
byte 14 ~ 25 - operator's MAC. eg: 0000E8E26A88 is 00:00:E8:E2:6A:88.
byte 26 ~ 35 - time of this log.

Table 1 (reason for logs)
0 | Information
1 | Error
11 | Set user
12 | Del user
13 | Set user check
14 | Open camera
15 | Close camera
16 | Change resolution
17 | Change quality
18 | Change brightness
19 | Change contrast
20 | Change saturation
21 | Change hue
22 | Change Sharpness
23 | Set email
24 | Set ftp server
25 | Dial (pppoe)
26 | Dial (modem)
27 | New client
28 | Set Motion Detect
29 | Set Monite Area
30 | Set Server Time
31 | Set Server IP
32 | Set Http Port

Example

Refer to GetLog.cgi


About

Version 3.x March, 2004


ChangeSharpness

 ChangeSharpness.cgi

Description

Change sharpness of camera's images. (administrator privilege required)

Grammar

/ChangeSharpness.cgi?Sharpness=value[&Camera=<0~3>[&RedirectUrl=sUrl]]

Remark

Camera : Channel Number is from 0 to 3. The defualt value is 0. This option is for 4 ports device.

Now camera supports 5 level of sharpness, and the value of Sharpness is from 0 to 255, which is mapped linearly to 5 level.

Example

<html>
<form action=/ChangeSharpness.cgi>
Sharpness(0-255):
<input name=Sharpness><br>
<input type=submit value=OK>
</form>


GetStatus

 GetStatus.cgi

Description

Get run-time status of IP Camera. (no privilege required)

Grammar

/GetStatus.cgi[?JsVar=variable[&OnJs=function]]

Remark

"GetStauts.cgi" returns a text whose length is 73, see Camera stauts for more information.

Example

<html>
<script>
function ShowResult(o)
{
 alert(str);
}
</script>
<script src="/GetStatus.cgi?JsVar=str&OnJs=ShowResult">
</script>


GetTime

 GetTime.cgi

Description

Get current IP Camera's time zone and time. (no privilege required)

Grammar

/GetTime.cgi[?sVar=variable[&OnJs=function]]

Remark

Each line represent an item, and every item is in the format as Name = Value.
(Refer to SetTime.cgi)

Example

<html>
<script>
function ShowResult(o)
{
 var nSecFrom1970 = 0;
 var nTimeZone = 0;

 sTime = sTime.split('\n');
 for (var i = 0; i < sTime.length; i++)
  sTime[i] = sTime[i].split(" = ");
 for (var i = 0; i < sTime.length; i++)
 {
  if (sTime[i].length == 2)
  {
   if (sTime[i][0] == "Sec1970") nSecFrom1970 = parseInt(sTime[i][1], 10);
   else if (sTime[i][0] == "TimeZone") nTimeZone = parseInt(sTime[i][1], 10);
  }
 }

 var dUTC = new Date(1000 * (nSecFrom1970 - nTimeZone * 60));
 var sShow = "Server Time: "
  + (dUTC.getUTCMonth() + 1) + "/"
  + dUTC.getUTCDate() + "/"
  + dUTC.getUTCFullYear() + " "
  + dUTC.getUTCHours() + ":"
  + dUTC.getUTCMinutes() + ":"
  + dUTC.getUTCSeconds() + '\n';
 sShow += "Server Time Zone: " + nTimeZone + " minutes.";
 alert(sShow);
}
</script>
<scriptsrc="/GetTime.cgi?JsVar=sTime&OnJs=ShowResult">
</script>


Reboot

 PTZ.cgi

Description

Control Pan/Tile/Zoom

Grammar

/PTZ.cgi[?Dir=<Left|Right|Up|Down|LeftUp|LeftDown|RightUp|RightDown>][&Address=<RS485_Address:0~20>][&Speed=<0~7>]

Example

<html>
<script src= "/PTZ.cgi?Dir=Left&Address=1
</script>


PTZPreset

 PTZPreset.cgi

Description

PTZ Preset operations

Grammar

/PTZPreset.cgi[?Model=<PTZ Model>][&GotoPreset=<Preset:1~20>]

/PTZPreset.cgi[?Model=<PTZ Model>][&SetPreset=<Preset:1~20>][&SetPresetName=<str>]

/PTZPreset.cgi[?Model=<PTZ Model>][&RemovePreset=<Preset:1~20>]

Model :

0: Lilin PIH 7000 Speed Dome

1: Pelco D compatible

2: AcutVista KD Series

3: IND_7000EM_PT

4: IND_7000EM_PTZ

100: DVR_SD1004

¡@

Example

<html>
<script src= "/PTZPreset.cgi?Model=2&GotoPreset=1">
</script>
</html>

¡@

<html>
<script src= "/PTZPreset.cgi?Model=2&SetPreset=1&SetPresetname='Loc001'">
</script>
</html>

¡@

<html>
<script src= "/PTZPreset.cgi?Model=2&RemovePreset=1">
</script>
</html>

¡@

¡@


SetMonitorRect

 SetMonitorRect.cgi

Description

Set the rectangle for motion detect. (administrator privilege required)

Grammar

/SetMonitorRect.cgi?Camera=<0~3>&Rect=left,top,right,bottom[&RedirectUrl=sUrl]

Remark

Camera : Channel Number is from 0 to 3. The default value is 0. This option is for 4 ports device.

left, top, right, bottom are all in the range: >=0 && <10000.
The actual resolution of images should be mapped to (0, 10000).
eg: To set the 1/4 of the total visual rectangle on the top-left, user should call request as:
/SetMonitorRect.cgi?Rect=0,0,5000,5000
To cancel this feature, call /SetMonitorRect.cgi?Rect=0,0,0,0
In the text returned by GetStatus.cgi, bytes 40 ~ 55 shows the monitor rectangle.

Example

<html>
<table>
<form name=f>
<tr><td>Left:</td><td><input id=oLeft></td></tr>
<tr><td>Top:</td><td><input id=oTop></td></tr>
<tr><td>Right:</td><td><input id=oRight></td></tr>
<tr><td>Buttom:</td><td><input id=oBottom></td></tr>
</form>
</table>
<script>
function OK(o)
{
 o.Rect.value = document.f.oLeft.value
   + ',' + document.f.oTop.value
   + ',' + document.f.oRight.value
   + ',' + document.f.oBottom.value;
 return true;
}
</script>
<form action=/SetMonitorRect.cgi onsubmit="return OK(this);">
<input name=Rect type=hidden>
<input type=submit value=OK>
</form>


SetTime

 SetTime.cgi

Description

Set time zone and time. (administrator privilege required)

Grammar

/SetTime.cgi?Sec1970=value1&TimeZone=value2[&RedirectUrl=sUrl]

Remark

Parameters:
Sec1970 - seconds since "00:00:00 1/1/1970";
TimeZone - time zone in minutes, eg: for Beijing(GMT+08:00), this parameters should be -480.

Visit /GetTime.cgi to get the time information on IP Camera.

Example

<html>
<form name=f>
<table>
<tr><td>Date(mm/dd/yyyy)</td><td><input name=oDate size=32></td></tr>
<tr><td>Time(hh:mm:ss)</td><td><input name=oTime size=32></td></tr>
<tr><td>Time Zone(minutes)</td><td><input name=oTimeZone size=32></td></tr>
</table>
</form>

<script>
var iTimeZone;
function GetTimeInSec1970()
{
 var asDate = document.f.oDate.value.split('/');
 var asTime = document.f.oTime.value.split(':');
 iTimeZone = parseInt(document.f.oTimeZone.value, 10);
 if (asDate.length != 3 || asTime.length != 3)
  return null;
 for (var i=0; i<3; i++)
 {
  asDate[i] = parseInt(asDate[i], 10);
  if (isNaN(asDate[i])) return null;
  asTime[i] = parseInt(asTime[i], 10);
  if (isNaN(asTime[i])) return null;
 }
 asDate[0]--;
 if (asDate[0] < 0 || asDate[0] > 11) return null;
 if (asDate[1] < 0 || asDate[1] > 31) return null;
 if (asTime[0] < 0 || asTime[0] >= 24) return null;
 if (asTime[1] < 0 || asTime[1] >= 60) return null;
 if (asTime[2] < 0 || asTime[2] >= 60) return null;
 if (iTimeZone <= -720 || iTimeZone >= 720) return null;

 var oAdjustDate = new Date(asDate[2], asDate[0], asDate[1], asTime[0], asTime[1], asTime[2]);
 return oAdjustDate;
}

function OK(o)
{
 var oAdjustDate = GetTimeInSec1970();
 if (oAdjustDate == null)
 {
  alert("Error date and time format.\n\n"
   + "Example:\n"
   + " Date: 11/20/2002\n
   + " Time: 14:23:32\n
   + " TimeZone:-480");
  return false;
 }

 o.Sec1970.value = Math.floor(oAdjustDate.valueOf() / 1000);
 delete oAdjustDate;
 o.TimeZone.value = iTimeZone;
 return true;
}
</script>

<form action="/SetTime.cgi" onsubmit="return OK(this);">
<input name=Sec1970 type=hidden>
<input name=TimeZone type=hidden>
<input type=submit value=OK>
</form>