Foscam IP Camera User Manual

Foscam IPCamera CGI User Guide
1
Foscam IPCamera CGI User Guide
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
2
Contents
getImageSetting...................................................................................................................... 2
setBrightness .......................................................................................................................... 2
setContrast .............................................................................................................................. 2
setHue ...................................................................................................................................... 3
setSaturation ........................................................................................................................... 3
setSharpness .......................................................................................................................... 3
resetImageSetting .................................................................................................................. 4
getMirrorAndFlipSetting ......................................................................................................... 4
mirrorVideo .............................................................................................................................. 4
flipVideo ................................................................................................................................... 5
setPwrFreq .............................................................................................................................. 5
getVideoStreamParam........................................................................................................... 5
setVideoStreamParam ........................................................................................................... 6
getMainVideoStreamType ..................................................................................................... 6
getSubVideoStreamType....................................................................................................... 6
setMainVideoStreamType ..................................................................................................... 7
setSubVideoStreamType ....................................................................................................... 7
GetMJStream .......................................................................................................................... 8
getOSDSetting ........................................................................................................................ 8
setOSDSetting ........................................................................................................................ 8
getOsdMaskArea .................................................................................................................... 9
setOsdMaskArea .................................................................................................................... 9
getMotionDetectConfig .......................................................................................................... 9
setMotionDetectConfig ........................................................................................................ 10
getSnapConfig ...................................................................................................................... 12
setSnapConfig ...................................................................................................................... 12
snapPicture ........................................................................................................................... 13
snapPicture2 ......................................................................................................................... 13
getRecordList ........................................................................................................................ 13
getAlarmRecordConfig ........................................................................................................ 14
setAlarmRecordConfig ........................................................................................................ 14
setIOAlarmConfig ................................................................................................................. 14
getIOAlarmConfig ................................................................................................................. 15
clearIOAlarmOutput ............................................................................................................. 15
getMultiDevList ..................................................................................................................... 16
getMultiDevDetailInfo ........................................................................................................... 16
addMultiDev .......................................................................................................................... 16
delMultiDev ............................................................................................................................ 17
addAccount ........................................................................................................................... 17
delAccount ............................................................................................................................. 18
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
3
changePassword .................................................................................................................. 18
changeUserName ................................................................................................................ 18
logIn ........................................................................................................................................ 19
logOut ..................................................................................................................................... 19
getSessionList ....................................................................................................................... 20
getUserList ............................................................................................................................ 20
usrBeatHeart ........................................................................................................................... 20
ptzMoveUp ............................................................................................................................ 21
ptzMoveDown ....................................................................................................................... 21
ptzMoveLeft ........................................................................................................................... 21
ptzMoveRight ........................................................................................................................ 22
ptzMoveTopLeft .................................................................................................................... 22
ptzMoveTopRight .................................................................................................................. 22
ptzMoveBottomLeft .............................................................................................................. 22
ptzMoveBottomRight ............................................................................................................ 23
ptzStopRun ............................................................................................................................ 23
ptzReset ................................................................................................................................. 23
getPTZSpeed ........................................................................................................................ 24
setPTZSpeed ........................................................................................................................ 24
getPTZPresetPointList ......................................................................................................... 24
ptzAddPresetPoint................................................................................................................ 25
ptzDeletePresetPoint ........................................................................................................... 25
ptzGotoPresetPoint .............................................................................................................. 25
ptzGetCruiseMapList ........................................................................................................... 26
ptzGetCruiseMapInfo ........................................................................................................... 26
ptzSetCruiseMap .................................................................................................................. 26
ptzDelCruiseMap .................................................................................................................. 27
ptzStartCruise........................................................................................................................ 27
ptzStopCruise ........................................................................................................................ 27
zoomIn ................................................................................................................................... 27
zoomOut ................................................................................................................................ 28
zoomStop ............................................................................................................................... 28
getZoomSpeed ..................................................................................................................... 28
setZoomSpeed ...................................................................................................................... 29
setPTZSelfTestMode ............................................................................................................ 29
getPTZSelfTestMode ........................................................................................................... 29
setPTZPrePointForSelfTest ................................................................................................ 30
getPTZPrePointForSelfTest ................................................................................................ 30
set485Info .............................................................................................................................. 30
get485Info .............................................................................................................................. 31
getIPInfo ................................................................................................................................. 31
setIpInfo ................................................................................................................................. 32
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
4
refreshWifiList ....................................................................................................................... 32
getWifiList .............................................................................................................................. 32
setWifiSetting ........................................................................................................................ 33
getWifiConfig ......................................................................................................................... 34
getPortInfo ............................................................................................................................. 35
setPortInfo ............................................................................................................................. 35
getUPnPConfig ..................................................................................................................... 36
setUPnPConfig ..................................................................................................................... 36
getDDNSConfig .................................................................................................................... 36
setDDNSConfig .................................................................................................................... 37
setFtpConfig .......................................................................................................................... 37
getFtpConfig .......................................................................................................................... 38
testFtpServer ......................................................................................................................... 38
getSMTPConfig .................................................................................................................... 38
setSMTPConfig ..................................................................................................................... 39
smtpTest ................................................................................................................................. 40
setSystemTime ..................................................................................................................... 40
getSystemTime ..................................................................................................................... 41
openInfraLed ......................................................................................................................... 42
closeInfraLed ......................................................................................................................... 42
getInfraLedConfig ................................................................................................................. 43
setInfraLedConfig ................................................................................................................. 43
getDevState ........................................................................................................................... 43
getDevName ......................................................................................................................... 44
setDevName ......................................................................................................................... 45
getDevInfo ............................................................................................................................. 45
rebootSystem ........................................................................................................................ 46
restoreToFactorySetting ...................................................................................................... 46
exportConfig .......................................................................................................................... 46
ImportConfig .......................................................................................................................... 47
FwUpgrade ............................................................................................................................ 47
getFirewallConfig .................................................................................................................. 48
setFirewallConfig .................................................................................................................. 48
getLog .................................................................................................................................... 48
Copyright@ Shenzhen Foscam Intelligent Technology Limited
5
History
Ver
Auth
Edit date
Changes
1.0.0
XiaoJinsheng
2012-11-21
V1.0.0
1.0.1
Houzhen
2012-12-09
Add the following CGI command to set PT startup position:
1) setPTZSelfTestMode
2) getPTZSelfTestMode
3) setPTZPrePointForSelfTest
4) getPTZPrePointForSelfTest
1.0.2
XiaoJinsheng
2013-01-29
1. Add a snap CGI(snapPicture2) which retrun jpeg image data directly but a image url
2. Add MotionJpeg stream support
1.0.3
Houzhen
2013-6-5
Check and Modify CGI command document
1.0.4
Limaike
2013-6-8
CGI command check
Foscam IPCamera CGI User Guide
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
1
value
mean
0
Success
-1
CGI request string format error
-2
Username or password error
-3
Access deny
-4
CGI execute fail
-5
Timeout
-6
Reserve
-7
Unknown error
-8
Reserve
General description
Our device can only support authentication by pass user name or password attached
at CGI request string currentlly. For example: http://192.168.1.2/cgi-bin/CGIProxy.fcgi&usr=admin&pwd=123&cmd=ABC
We only support GET and POST method. Only importConfig and fwUpgrade can
support POST method.
The cgi request string must be encode in url format. URL encode rule:
The following chars will not be encoded: [A~Z] [a~z] [0~9] + @ * / The other chars will be encoded into hex format. For example:
http://192.168.1.6:88/cgi-bin/CGIProxy.fcgi?usr=admin&pwd=&cmd=getIPInfo
will be encode to:
http://192.168.1.6:88/cgi-bin/CGIProxy.fcgi?usr%3Dadmin%26pwd%3D%26cmd%3DgetIPInfo
cgi execute result
1) We orgnize the cgi execute result as xml format, for example: <CGI_Result> <result>0</result> <isDHCP>1</isDHCP> <ip>192.168.1.8</ip> <gate>0.0.0.0</gate> <mask>255.255.255.0</mask> <dns1>0.0.0.0</dns1> <dns2>0.0.0.0</dns2> </CGI_Result>
<result></result> means the common execute result
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
2
Function
Get color attribute of video
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getImageSetting
Param
None
Return
brightness
0~100
contrast
0~100
hue
0~100
saturation
0~100
sharpness
0~100
denoiseLevel
Not use
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getImageSetting&usr=admin&pwd=
Function
Set brightness of video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setBrightness
Param
brightness
0~100
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setBrightness&brightness=50&usr=admin& pwd=
Function
Set contrast of video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setContrast
Param
contrast
0~100
Return
None
Note
AV Function
getImageSetting
setBrightness
setContrast
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
3
Example
/cgi-bin/CGIProxy.fcgi?cmd=setContrast&contrast=50&usr=admin&pwd =
Function
Set hue of video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setHue
Param
hue
0~100
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setHue&hue=50&usr=admin&pwd=
Function
Set saturation of video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSaturation
Param
saturation
0~100
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setSaturation&saturation=50&usr=admin& pwd=
Function
Set sharpness of video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSharpness
Param
sharpness
0~100
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setSharpness&sharpness=50&usr=admin& pwd=
setHue
setSaturation
setSharpness
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
4
Function
Reset color parameters to default value
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=resetImageSetting
Param
None
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=resetImageSetting&usr=admin&pwd=
Function
Get mirror and flip attribute of video
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getMirrorAndFlipSetting
Param
None
Return
isMirror
0 Not mirred
1 Mirred
isFlip 0 Not filpped
1 Flipped
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getMirrorAndFlipSetting&usr=admin&pwd=
Function
Mirror video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=mirrorVideo
Param
isMirror 0 Not mirror
1 Mirror
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=mirrorVideo&usr=admin&pwd=
resetImageSetting
getMirrorAndFlipSetting
mirrorVideo
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
5
Function
Flip video
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=flipVideo
Param
isFlip 0 Not flip
1 Flip
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=flipVideo&usr=admin&pwd=
Function
Set power freq of sensor
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setPwrFreq
Param
freq 0 60HZ
1 50HZ
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setPwrFreq&freq=0&usr=admin&pwd=
Function
Get video stream param
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getVideoStreamParam
Param
None
Return
resolutionN
Resolution of stream type N
bitRateN
Bit rate of stream type N (20480~2097152)
frameRateN
Frame rate of stream type N
GOPN
P frames between I frame of stream type N
isVBRN
Not in use currentlly
Note
N means streamType [0~3]
Example
/cgi-bin/CGIProxy.fcgi?cmd=getVideoStreamParam&usr=admin&pwd=
flipVideo
setPwrFreq
getVideoStreamParam
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
6
Function
Set the video stream param of stream N
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setVideoStreamParam
Param
streamTyp e
0~3
resolutio n
Resolution of stream type N
bitRate
Bit rate of stream type N (20480~2097152)
frameRat e
Frame rate of stream type N
GOP
P frames between I frame of stream type N The suggest value is: X * frameRate
isVBR
Not in use currentlly
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setVideoStreamParam&streamType=0&res olution=0&bitRate=2097152&frameRate=30&GOP=30&isVBR=0&usr=a dmin&pwd=
Function
Get the stream type of main stream
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getMainVideoStreamType
Param
None
Return
streamType
The stream type 0~3
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getMainVideoStreamType&usr=admin&pw d=
Function
Get the stream type of sub stream
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamType
setVideoStreamParam
getMainVideoStreamType
getSubVideoStreamType
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
7
Param
None
Return
streamType
The stream type 0~3
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamType&usr=admin&pwd =
Functio n
Set the stream type of main stream
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setMainVideoStreamType
Param
streamType
The stream type 0~3
Return
None
Note
Exampl e
/cgi-bin/CGIProxy.fcgi?cmd=setMainVideoStreamType&streamType=0&usr=admi n&pwd=
Function
Set the stream format of sub stream
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSubVideoStream 统一
Param
format
0
H264
1
MotionJpeg
Return
None
Note
Our device can only support 2 streams:Main stream for PC access and Sub stream for mobile access, but someone need a MJ stream to embed their camera into a webpage, in this case, we should set sub stream format to Motion Jpeg, and then you can get MJ stream by command: /cgi-bin/CGIStream.cgi?cmd=GetMJStream, but when you login as a sub stream user, the stream data will be same as main stream.
Example
/cgi-bin/CGIProxy.fcgi?cmd=setSubVideoStreamType&format=0&usr=admin&pw d=
setMainVideoStreamType
setSubVideoStreamType
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
8
Function
Get motion jpeg stream
privilege
visitor
Usage
/cgi-bin/CGIStream.cgi?cmd=GetMJStream
Param
None
Return
Motion jpeg stream data
Note
1) Motion jpeg stream data is returned from http server by a serverpush mode
2) MJ stream is VGA resolution @ 15fps
Example
/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=admin&pwd=
Function
Get OSD config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getOSDSetting
Param
None
Return
isEnableTimeStamp
Time stamp will display on screen or not
isEnableDevName
Camera name will display on screen or not
dispPos
OSD display position, currently can only be 0
isEnableOSDMask
Is OSD mask effective
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getOSDSetting&usr=admin&pwd=
Function
Set OSD config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setOSDSetting
Param
isEnableTimeStamp
Time stamp will display on screen or not
isEnableDevName
Camera name will display on screen or not
dispPos
OSD display position, currently can only be 0
isEnableOSDMask
Is OSD mask effective
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setOSDSetting&isEnableTimeStamp=1&isEnable DevName=1&dispPos=0&isEnableOSDMask=0&usr=admin&pwd=
GetMJStream
getOSDSetting
setOSDSetting
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
9
Function
Get OSD mask area info
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getOsdMaskArea
Param
None
Return
x1_N
The top left X position of mask N
y1_N
The top left Y position of mask N
x2_N
The bottom right X position of mask N
y2_N
The bottom right Y position of mask N
Note
Our device can only support 4 mask areas
Example
/cgi-bin/CGIProxy.fcgi?cmd=getOsdMaskArea&usr=admin&pwd=
Function
Set OSD mask area info
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setOsdMaskArea
param
x1_N
The top left X position of mask N
y1_N
The top left Y position of mask N
x2_N
The bottom right X position of mask N
y2_N
The bottom right Y position of mask N
Resturn
None
Note
Our device can only support 4 mask areas
Example
/cgi-bin/CGIProxy.fcgi?cmd=setOsdMaskArea&x1_0=100&y1_0=100&x2_0=2 00&y2_0=200&x1_1=0&y1_1=0&x2_1=0&y2_1=0&x1_2=0&y1_2=0&x2_2=0 &y2_2=0&x1_3=0&y1_3=0&x2_3=0&y2_3=0&usr=admin&pwd=
Function
Get motion detect config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig
Param
None
Return
isEnable
Is enable motion detect alarm
linkage
Motion alarm linkage ( bit3 | bit2 | bit1 | bit0 )
bit0:Ring
bit1:Send mail
getOsdMaskArea
setOsdMaskArea
getMotionDetectConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
10
bit2:Snap picture
bit3:Record
snapInterval
The interval time to snap picture again
sensitivity
Motion detect sensitivity
0 : Low
1: Normal
2: High
3: Lower
4: Lowest
triggerInterval
The time of which motion detect alaram can trigger again when a motion detection has happened.
scheduleN
The motion alaram schedule of one week, N = 0(Monday) ~6(Sunday) For detail, see *1 bellow
areaN
The area info of row N For detail, see *2 bellow
Note
·Video region is divided into 10*10 sub areasideo region is divided into 10*10 sub areas
·The min unit of schedule is half an hour
Example
/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=
Function
Set motion detect config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig
Param
isEnable
Is enable motion detect alarm
linkage
Motion alarm linkage ( bit3 | bit2 | bit1 | bit0 )
bit0:Ring
bit1:Send mail
bit2:Snap picture
bit3:Record
snapInterval
The interval time to snap picture again
sensitivity
Motion detect sensitivity
0 : Low
1: Normal
2: High
3: Lower
4: Lowest
triggerInterval
The time of which motion detect alaram
setMotionDetectConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
11
can trigger again when a motion detection has happened.
scheduleN
The motion alaram schedule of one week, N = 0(Monday) ~6(Sunday) For detail, see *1 bellow
areaN
The area info of row N For detail, see *2 bellow
Return
None
Note
·Video region is divided into 10*10 sub areasideo region is divided into 10*10 sub areas
·The min unit of schedule is half an hour
Example
/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&linkage=16&
snapInterval=2&sensitivity=1&triggerInterval=5&schedule0=1024&schedule1
=1024&schedule2=1024&schedule3=1024&schedule4=1024&schedule5=102 4&schedule6=1024&area0=1024&area1=1024&area2=1024&area3=1024&ar ea4=1024&area5=1024&area6=1024&area7=1024&area7=1024&area8=1024 &area9=1024&usr=admin&pwd=
0 1 2 3 4 5 6 7
bit0
bit1
bit2
bit3
bit4
bit5
bit6
bit7
bit8
bit9
40
41
42
43
44
45
46
47
Monday
Tuesday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
Wednesday
area0
area1
area2
area3
area4
area5
area6
area7
*1 schedule bitmap
Each grid of a row presents half of an hour of one day. For example, 40 presents 20:00 ~20:30. The bit 40 set to “1” means the motion detection is effective between 20:00 to 20:30
*2 area bitmap
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
12
Function
Get snap config
privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getSnapSetting
Param
None
Return
snapPicQuality
0
Low quality
1
Normal quality
2
High quality
saveLocation
0
Save to sd card
1
Not in use now
2
Upload to FTP
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getSnapConfig&usr=admin&pwd=
Function
Set snap config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSnapSetting
Param
snapPicQuality
0
Low quality
1
Normal quality
2
High quality
saveLocation
0
Save to sd card
1
Not in use now
2
Upload to FTP
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setSnapConfig&usr=admin&pwd=&snapPicQuali
ty=1&saveLocation=2
area8
area9
The video region is divided into 10*10 sub areas, bit0 above present the first area, when this bit is set to “1”, it means motion detection is effective on this area.
getSnapConfig
setSnapConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Loading...
+ 37 hidden pages