Foscam IPCamera HD H264 CGI User Guide v1.0.5
Foscam IPCamera HD H264 CGI User Guide v1.0.5
Contents
General description.......................................................................................................................... 1
AV Function........................................................................................................................................2
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
setSubStreamFormat...............................................................................................................7
GetMJStream............................................................................................................................ 7
getOSDSetting.......................................................................................................................... 8
setOSDSetting.......................................................................................................................... 9
getOsdMaskArea...................................................................................................................... 9
setOsdMaskArea...................................................................................................................... 9
getOSDMask........................................................................................................................... 10
setOSDMask........................................................................................................................... 10
getMotionDetectConfig.......................................................................................................... 10
setMotionDetectConfig.......................................................................................................... 11
setLocalAlarmRecordConfig.................................................................................................13
getLocalAlarmRecordConfig.................................................................................................13
getSnapConfig........................................................................................................................ 13
setSnapConfig.........................................................................................................................14
getScheduleSnapConfig........................................................................................................14
setScheduleSnapConfig........................................................................................................15
snapPicture..............................................................................................................................15
snapPicture2............................................................................................................................16
getRecordList.......................................................................................................................... 16
getAlarmRecordConfig.......................................................................................................... 16
setAlarmRecordConfig...........................................................................................................17
setIOAlarmConfig................................................................................................................... 17
getIOAlarmConfig................................................................................................................... 18
clearIOAlarmOutput............................................................................................................... 18
getMultiDevList........................................................................................................................19
getMultiDevDetailInfo.............................................................................................................19
addMultiDev.............................................................................................................................19
delMultiDev.............................................................................................................................. 20
User account................................................................................................................................... 20
addAccount..............................................................................................................................20
delAccount............................................................................................................................... 21
changePassword.................................................................................................................... 21
changeUserName...................................................................................................................21
logIn.......................................................................................................................................... 22
logOut....................................................................................................................................... 22
getSessionList.........................................................................................................................23
getUserList...............................................................................................................................23
usrBeatHeart..............................................................................................................................23
PTZ Control..................................................................................................................................... 24
ptzMoveUp...............................................................................................................................24
ptzMoveDown..........................................................................................................................24
ptzMoveLeft............................................................................................................................. 24
ptzMoveRight.......................................................................................................................... 25
ptzMoveTopLeft.......................................................................................................................25
ptzMoveTopRight....................................................................................................................25
ptzMoveBottomLeft................................................................................................................ 25
ptzMoveBottomRight..............................................................................................................26
ptzStopRun.............................................................................................................................. 26
ptzReset................................................................................................................................... 26
getPTZSpeed.......................................................................................................................... 26
setPTZSpeed.......................................................................................................................... 27
getPTZPresetPointList...........................................................................................................27
ptzAddPresetPoint..................................................................................................................28
ptzDeletePresetPoint............................................................................................................. 28
ptzGotoPresetPoint................................................................................................................ 28
ptzGetCruiseMapList............................................................................................................. 29
ptzGetCruiseMapInfo............................................................................................................. 29
ptzSetCruiseMap.................................................................................................................... 29
ptzDelCruiseMap.................................................................................................................... 30
ptzStartCruise..........................................................................................................................30
ptzStopCruise..........................................................................................................................30
zoomIn......................................................................................................................................30
zoomOut...................................................................................................................................31
zoomStop................................................................................................................................. 31
getZoomSpeed........................................................................................................................31
setZoomSpeed........................................................................................................................32
setPTZSelfTestMode..............................................................................................................32
getPTZSelfTestMode............................................................................................................. 32
setPTZPrePointForSelfTest.................................................................................................. 33
getPTZPrePointForSelfTest.................................................................................................. 33
set485Info................................................................................................................................ 33
get485Info................................................................................................................................ 34
Network............................................................................................................................................ 34
getIPInfo................................................................................................................................... 34
setIpInfo....................................................................................................................................35
refreshWifiList..........................................................................................................................35
getWifiList.................................................................................................................................35
setWifiSetting.......................................................................................................................... 36
getWifiConfig........................................................................................................................... 37
getPortInfo............................................................................................................................... 38
setPortInfo................................................................................................................................38
getUPnPConfig....................................................................................................................... 39
setUPnPConfig........................................................................................................................39
getDDNSConfig...................................................................................................................... 39
setDDNSConfig.......................................................................................................................40
setFtpConfig............................................................................................................................ 40
getFtpConfig............................................................................................................................ 41
testFtpServer...........................................................................................................................41
getSMTPConfig.......................................................................................................................42
setSMTPConfig.......................................................................................................................42
smtpTest................................................................................................................................... 43
setP2PEnable..........................................................................................................................43
getP2PEnable......................................................................................................................... 44
setP2PPort...............................................................................................................................44
getP2PPort.............................................................................................................................. 44
Device manage............................................................................................................................... 45
setSystemTime....................................................................................................................... 45
getSystemTime....................................................................................................................... 46
openInfraLed........................................................................................................................... 46
closeInfraLed...........................................................................................................................47
getInfraLedConfig................................................................................................................... 47
setInfraLedConfig................................................................................................................... 47
getDevState.............................................................................................................................48
getDevName............................................................................................................................49
setDevName............................................................................................................................49
getDevInfo................................................................................................................................49
System..............................................................................................................................................50
rebootSystem.......................................................................................................................... 50
restoreToFactorySetting........................................................................................................ 50
exportConfig............................................................................................................................ 50
ImportConfig............................................................................................................................ 51
FwUpgrade.............................................................................................................................. 51
MISC................................................................................................................................................. 52
getFirewallConfig....................................................................................................................52
setFirewallConfig.................................................................................................................... 52
getLog.......................................................................................................................................53
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
1.0.5 Houzhen 2013-9-25 1.Add note for GetMJStream, defects of
Firefox;
2.Modify Command:
setContrast、mirrorVideo、flipVideo、logIn、
setSnapConfig 、 setPTZSpeed 、
setInfraLedConfig 、 setSubStreamFormat 、
setPortInfo、getPortInfo;
3.Add command:
getLocalAlarmRecordConfig ;
setLocalAlarmRecordConfig;
getP2PEnable ; setP2PEnable ; getP2PPort ;
setP2PPort ; setOSDMask ; getOSDMask ;
getScheduleSnapConfig ;
setScheduleSnapConfig;
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
AV Function
getImageSetting
setBrightness
setContrast
Example /cgi-bin/CGIProxy.fcgi?cmd=setContrast&constrast=50&usr=admin&pw
d=
setHue
setSaturation
setSharpness
resetImageSetting
getMirrorAndFlipSetting
mirrorVideo
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=mirrorVideo&isMirror=1&usr=admin&pwd=
flipVideo
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=flipVideo&isFlip=1&usr=admin&pwd=
setPwrFreq
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=setPwrFreq&freq=0&usr=admin&pwd=
getVideoStreamParam
setVideoStreamParam
getMainVideoStreamType
getSubVideoStreamType
Param None
Return streamType The stream type 0~3
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamType&usr=admin&pwd
=
setMainVideoStreamType
setSubStreamFormat
GetMJStream
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
3) For some version of Firefox browse, the Firefox will crash when use
“GetMJStream” CGI to get mjstream long time. This problem is due to the
browse has some defects, it can not parse data correctly and directly. In order
to fix this problem, we should as follows:
A. Create a .txt empty document, such as “MJ.txt”.
B.Input the content into you .txt document, as follows:
<html>
<body>
<img
src="http://192.168.1.102:99/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=admi
n&pwd="/>
</body>
</html>
Note: please change the ip\port\usr\pwd to youself;
C. Rename your .txt to .html, such as “MJ.html”.
D. Open you r.html by Firefox, and enjoy your MJStream-video;
Example /cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=admin&pwd=
getOSDSetting
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=getOSDSetting&usr=admin&pwd=
setOSDSetting
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=setOSDSetting&isEnableTimeStamp=1&isEnable
DevName=1&dispPos=0&isEnableOSDMask=0&usr=admin&pwd=
getOsdMaskArea
setOsdMaskArea
Resturn None
getOSDMask
setOSDMask
getMotionDetectConfig
setMotionDetectConfig
*1 schedule bitmap
0 1 2 3 4 5 6 7 40 41 42 43 44 45 46 47 Monday
Tuesday
Wednesday
… Thursday
Wednesday
Tuesday
Friday
Saturday
Sunday
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
bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7 bit8 bit9 area0
area1
area2
area3
area4
area5
area6
area7
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.
setLocalAlarmRecordConfig
getLocalAlarmRecordConfig
getSnapConfig
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=
setSnapConfig
getScheduleSnapConfig
setScheduleSnapConfig
*1 schedule bitmap
0 1 2 3 4 5 6 7 40 41 42 43 44 45 46 47 Monday
Tuesday
Wednesday
… Thursday
Wednesday
Tuesday
Friday
Saturday
Sunday
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 snap is effective between 20:00 to 20:30
snapPicture
<html><body><img src="../snapPic/20121121-215939.jpg"/></body></html>
snapPicture2
getRecordList
getAlarmRecordConfig
setAlarmRecordConfig
setIOAlarmConfig
Example /cgi-bin/CGIProxy.fcgi?cmd=setIOAlarmConfig&usr=admin&pwd=&isEnable=1
&linkage=16&snapInterval=2&alarmLevel=1&triggerInterval=5&schedule0=10
24&schedule1=1024&schedule2=1024&schedule3=1024&schedule4=1024&s
chedule5=1024&schedule6=1024
getIOAlarmConfig
clearIOAlarmOutput
getMultiDevList
privilege admin
Usage /cgi-bin/CGIProxy.fcgi?cmd=getMultiDevList
Param None
Return devN N(0-8), device information
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=getMultiDevList&usr=admin&pwd=
getMultiDevDetailInfo
addMultiDev
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=addMultiDev&usr=admin&pwd=&chnnl=2&product
Type=H264&ip=192.168.1.3&port=88&mediaPort=88&userName=admin&pass
Word=&devName=FI9805W
delMultiDev
User account
addAccount
privilege 0 Visitor
1 Operator
2 Administrator
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=addAccount&usrName=test&usrPwd=test&privile
ge=0& usr=admin&pwd=
delAccount
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=delAccount&usrName=test&usr=admin&pwd=
changePassword
Return None
Note Admin can change every user’s password, visitor and operator can only
change their own password
Example /cgi-bin/CGIProxy.fcgi?cmd=changePassword&usrName=admin&oldPwd=&ne
wPwd=test&usr=admin&pwd=
changeUserName
Return None
Note Admin can change every user’s name, visitor and operator can only change
their own name
Example /cgi-bin/CGIProxy.fcgi?cmd=changeUserName&usrName=admin&
newUsrName=newname&usr=admin&pwd=
logIn
remoteIp Access IP
logOut
ip Access IP
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=logOut&usrName=admin&ip=192.168.1.12&grou
pId=673982479&usr=admin&pwd=
getSessionList
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=getSessionList&usr=admin&pwd=
getUserList
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=getUserList&usr=admin&pwd=
usrBeatHeart
remoteIp Access IP
Example /cgi-bin/CGIProxy.fcgi?cmd=usrBeatHeart&usrName=admin&ip=192.168.1.13
&groupId=673982479&usr=admin&pwd=
PTZ Control
ptzMoveUp
Function Move up
privilege operator
Usage /cgi-bin/CGIProxy.fcgi?cmd=ptzMoveUp
Param None
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=ptzMoveUp&usr=admin&pwd=
ptzMoveDown
ptzMoveLeft
ptzMoveRight
ptzMoveTopLeft
ptzMoveTopRight
ptzMoveBottomLeft
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=ptzMoveBottomLeft&usr=admin&pwd=
ptzMoveBottomRight
ptzStopRun
ptzReset
getPTZSpeed
setPTZSpeed
getPTZPresetPointList
ptzAddPresetPoint
Return None
Note The preset point position is current PT position
Example /cgi-bin/CGIProxy.fcgi?cmd=ptzAddPresetPoint&name=test&usr=admin&pwd
=
ptzDeletePresetPoint
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=ptzDeletePresetPoint&name=test&usr=admin&p
wd=
ptzGotoPresetPoint
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=ptzGotoPresetPoint&name=test&usr=admin&pwd
=
ptzGetCruiseMapList
ptzGetCruiseMapInfo
-1 Fail
pointN The preset point name of this cruise map
Note Our device can support at most 8 preset point one cruise map
Example /cgi-bin/CGIProxy.fcgi?cmd=ptzGetCruiseMapInfo&name=Horizental&usr=ad
min&pwd=
ptzSetCruiseMap
t7=&usr=admin&pwd=
ptzDelCruiseMap
ptzStartCruise
ptzStopCruise
zoomIn
Function Zoom in
privilege operator
Usage /cgi-bin/CGIProxy.fcgi?cmd=zoomIn
Param None
Return None
Note Only supported by the device has zoom lens
Example /cgi-bin/CGIProxy.fcgi?cmd=zoomIn&usr=admin&pwd=
zoomOut
zoomStop
getZoomSpeed
setZoomSpeed
setPTZSelfTestMode
getPTZSelfTestMode
setPTZPrePointForSelfTest
getPTZPrePointForSelfTest
set485Info
get485Info
Network
getIPInfo
Function Get IP Info
privilege visitor
Usage /cgi-bin/CGIProxy.fcgi?cmd=getIPInfo
Param None
Return isDHCP Obtain ip from dhcp server or not
ip ip address(Can only support ipv4 yet)
gate gateway(“0.0.0.0” when use dhcp)
mask subnet mask
dns1 The first dns server addr(“0.0.0.0” when use dhcp)
dns2 The second dns server addr(“0.0.0.0” when use dhcp)
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=getIPInfo&usr=admin&pwd=
setIpInfo
refreshWifiList
Note This operation may takes a while, about 20 seconds or above, the other
operation on this device will be blocked during the period.
Example /cgi-bin/CGIProxy.fcgi?cmd=refreshWifiList&usr=admin&pwd=
getWifiList
setWifiSetting
key3
key4
key1Len 64 or 128
key2Len 64 or 128
key3Len 64 or 128
key4Len 64 or 128
Return None
Note Camera will not connect to AP unless you enject your cable
Example /cgi-bin/CGIProxy.fcgi?cmd=setWifiSetting&isEnable=1&isUseWifi=1&ssid=fosta
r_soft&netType=0&encryptType=4&psk=software&authMode=0&keyFormat=0&d
efaultKey=1&key1=&key2=&key3=&key4=&key1Len=64&key2Len=64&key3Len
=64&key4Len=64&usr=admin&pwd=
getWifiConfig
defaultKey 1~4
key1
key2
key3
key4
key1Len 64 or 128
key2Len 64 or 128
key3Len 64 or 128
key4Len 64 or 128
Return None
Note Camera will not connect to AP unless you enject your cable
Example /cgi-bin/CGIProxy.fcgi?cmd=getWifiConfig&usr=admin&pwd=
getPortInfo
setPortInfo
Return None
Note .Re login is needed after call this CGI command
.onvifPort param only for onvif camera, the camra which does not has onvif
function does not have this param
Example /cgi-bin/CGIProxy.fcgi?cmd=setPortInfo&webPort=88&mediaPort=88&httpsPo
rt=443&onvifPort=888&usr=admin&pwd=
getUPnPConfig
setUPnPConfig
getDDNSConfig
2 3322
3 no-ip
4 dyndns
user user name
password password
factoryDDNS factory ddns
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=getDDNSConfig&usr=admin&pwd=
setDDNSConfig
setFtpConfig
getFtpConfig
testFtpServer
tpPort=21&mode=0&userName=test&password=test&usr=admin&pwd=
getSMTPConfig
setSMTPConfig
sender
reciever Use “,” between 2 senders, for exapler:
aaa@123.com,bbb@456.com
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=setSMTPConfig&isEnable=1&server=smtp.gmail.
com&port=587&isNeedAuth=1&user=test&password=test&send=test@gmail.c
om&reciever=aa@123.com,bb@456.com&usr=admin&pwd=
smtpTest
setP2PEnable
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=setP2PEnable&enable=1&usr=admin&pwd=
getP2PEnable
setP2PPort
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=setP2PPort&port=12345&usr=admin&pwd=
getP2PPort
Device manage
setSystemTime
getSystemTime
openInfraLed
closeInfraLed
getInfraLedConfig
setInfraLedConfig
Example /cgi-bin/CGIProxy.fcgi?cmd=setInfraLedConfig&mode=&usr=admin&pwd=
getDevState
infraLedState 0 OFF
1 ON
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=getDevState&usr=admin&pwd=
getDevName
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=getDevName&usr=admin&pwd=
setDevName
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=setDevName&devName=test&usr=admin&pwd=
getDevInfo
year
mon
day
hour
min
sec
timeZone Time zone
firmwareVer Firmware version
hardwareVer Hardware version
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=getDevInfo&usr=admin&pwd=
System
rebootSystem
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=rebootSystem&usr=admin&pwd=
restoreToFactorySetting
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd= restoreToFactorySetting&usr=admin&pwd=
exportConfig
Note After call this command, you can get the config file by visit the following addr:
/configs/export/configs.bin
Example /cgi-bin/CGIProxy.fcgi?cmd=exportConfig&usr=admin&pwd=
ImportConfig
Return None
FwUpgrade
MISC
getFirewallConfig
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=getFirewallConfig&usr=admin&pwd=
setFirewallConfig
Return None
Note
Example /cgi-bin/CGIProxy.fcgi?cmd=setFirewallConfig&isEnable=1&rule=0&ipList0=0
&ipList1=0&ipList2=0&ipList3=0&ipList4=0&ipList5=0&ipList6=0&ipList7=0&us
r=admin&pwd=
getLog