![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg1.png)
Foscam IPCamera CGI User Guide
Foscam IPCamera CGI User Guide
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg2.png)
Foscam IPCamera CGI User Guide
1. General description....................................................................................................................14
2. All Platform CGI.......................................................................................................................... 15
AV Function...............................................................................................................................15
getImageSetting.................................................................................................................15
setBrightness..................................................................................................................... 15
setContrast.........................................................................................................................15
setHue................................................................................................................................16
setSaturation......................................................................................................................16
setSharpness...................................................................................................................... 16
setDenoiseLevel (not use).................................................................................................16
resetImageSetting..............................................................................................................17
getMirrorAndFlipSetting.................................................................................................. 17
mirrorVideo....................................................................................................................... 17
flipVideo............................................................................................................................18
getRatio............................................................................................................................. 18
setRatio..............................................................................................................................18
getH264FrmRefMode....................................................................................................... 19
setH264FrmRefMode........................................................................................................19
getScheduleRecordStreamChn......................................................................................... 19
setScheduleRecordStreamChn..........................................................................................20
setPwrFreq.........................................................................................................................20
getVideoStreamParam.......................................................................................................20
setVideoStreamParam.......................................................................................................21
getSubVideoStreamParam................................................................................................ 21
setSubVideoStreamParam.................................................................................................22
getMainVideoStreamType.................................................................................................22
getSubVideoStreamType...................................................................................................22
setMainVideoStreamType.................................................................................................23
setSubStreamFormat......................................................................................................... 23
GetMJStream.....................................................................................................................23
getOSDSetting...................................................................................................................24
setOSDSetting...................................................................................................................24
getOsdMaskArea...............................................................................................................25
setOsdMaskArea............................................................................................................... 25
getOSDMask.....................................................................................................................26
setOSDMask......................................................................................................................26
getMotionDetectConfig.................................................................................................... 26
setMotionDetectConfig.....................................................................................................27
setLocalAlarmRecordConfig............................................................................................ 29
getLocalAlarmRecordConfig............................................................................................29
getSnapConfig...................................................................................................................30
setSnapConfig................................................................................................................... 30
getScheduleSnapConfig.................................................................................................... 31
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg3.png)
Foscam IPCamera CGI User Guide
setScheduleSnapConfig.................................................................................................... 31
snapPicture........................................................................................................................ 32
snapPicture2...................................................................................................................... 32
getRecordList.................................................................................................................... 32
getRecordList2.................................................................................................................. 33
reloadRecordindex............................................................................................................ 33
getAlarmRecordConfig.....................................................................................................34
setAlarmRecordConfig..................................................................................................... 34
getRecordPath................................................................................................................... 34
setRecordPath....................................................................................................................35
getScheduleRecordConfig................................................................................................ 35
setScheduleRecordConfig.................................................................................................36
setIOAlarmConfig.............................................................................................................37
getIOAlarmConfig............................................................................................................ 37
clearIOAlarmOutput......................................................................................................... 38
setAudioAlarmConfig.......................................................................................................38
getAudioAlarmConfig...................................................................................................... 39
setPCAudioAlarmCfg....................................................................................................... 39
getPCAudioAlarmCfg.......................................................................................................39
getMultiDevList................................................................................................................ 40
getMultiDevDetailInfo......................................................................................................40
addMultiDev......................................................................................................................40
delMultiDev...................................................................................................................... 41
setDeFrameLevel.............................................................................................................. 41
getDeFrameLevel..............................................................................................................41
getNetworkAutoAdaptability............................................................................................42
setNetworkAutoAdaptability............................................................................................ 42
getMainStreamCapabilities...............................................................................................42
getSubStreamCapabilities................................................................................................. 43
getAudioSendMethod....................................................................................................... 43
User account..............................................................................................................................44
addAccount........................................................................................................................44
delAccount........................................................................................................................ 44
getPassword.......................................................................................................................44
changePassword................................................................................................................ 45
changeUserName.............................................................................................................. 45
changeUserNameAndPwdTogether..................................................................................45
logIn...................................................................................................................................46
logOut................................................................................................................................47
getSessionList................................................................................................................... 47
getUserList........................................................................................................................ 47
usrBeatHeart......................................................................................................................48
PTZ Control...............................................................................................................................48
ptzMoveUp........................................................................................................................48
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg4.png)
Foscam IPCamera CGI User Guide
ptzMoveDown...................................................................................................................48
ptzMoveLeft......................................................................................................................49
ptzMoveRight....................................................................................................................49
ptzMoveTopLeft................................................................................................................49
ptzMoveTopRight..............................................................................................................49
ptzMoveBottomLeft..........................................................................................................50
ptzMoveBottomRight........................................................................................................50
ptzStopRun........................................................................................................................50
ptzReset.............................................................................................................................50
getPTZSpeed.....................................................................................................................51
setPTZSpeed......................................................................................................................51
getPTZPresetPointList...................................................................................................... 52
ptzAddPresetPoint.............................................................................................................52
ptzDeletePresetPoint......................................................................................................... 52
ptzGotoPresetPoint............................................................................................................53
ptzGetCruiseMapList........................................................................................................ 53
ptzGetCruiseMapInfo........................................................................................................53
ptzSetCruiseMap...............................................................................................................54
ptzDelCruiseMap.............................................................................................................. 54
ptzStartCruise....................................................................................................................54
ptzStopCruise.................................................................................................................... 54
setCruiseTime....................................................................................................................55
getCruiseTime...................................................................................................................55
setCruiseTimeCustomed................................................................................................... 55
getCruiseTimeCustomed...................................................................................................56
setCruiseLoopCnt..............................................................................................................56
getCruiseLoopCnt............................................................................................................. 56
setCruiseCtrlMode............................................................................................................ 56
getCruiseCtrlMode............................................................................................................57
setCruisePrePointLingerTime...........................................................................................57
getCruisePrePointLingerTime...........................................................................................57
zoomIn...............................................................................................................................58
zoomOut............................................................................................................................58
zoomStop...........................................................................................................................58
getZoomSpeed...................................................................................................................58
setZoomSpeed...................................................................................................................59
setPTZSelfTestMode.........................................................................................................59
getPTZSelfTestMode........................................................................................................ 59
setPTZPrePointForSelfTest...............................................................................................60
getPTZPrePointForSelfTest.............................................................................................. 60
set485Info..........................................................................................................................60
get485Info......................................................................................................................... 61
Network.....................................................................................................................................61
getIPInfo............................................................................................................................61
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg5.png)
Foscam IPCamera CGI User Guide
setIpInfo............................................................................................................................ 62
refreshWifiList.................................................................................................................. 62
getWifiList.........................................................................................................................63
setWifiSetting....................................................................................................................63
setWifiSettingNew............................................................................................................ 64
getWifiConfig....................................................................................................................65
getPortInfo.........................................................................................................................66
setPortInfo.........................................................................................................................67
getUPnPConfig................................................................................................................. 67
setUPnPConfig..................................................................................................................67
getDDNSConfig................................................................................................................68
setDDNSConfig................................................................................................................ 68
setFtpConfig......................................................................................................................69
setFtpConfigNew.............................................................................................................. 69
getFtpConfig......................................................................................................................70
testFtpServer......................................................................................................................70
testFtpServerNew..............................................................................................................71
getSMTPConfig................................................................................................................ 71
setSMTPConfig.................................................................................................................72
setSMTPConfigNew......................................................................................................... 72
smtpTest.............................................................................................................................73
smtpTestNew.....................................................................................................................74
setP2PEnable.....................................................................................................................74
getP2PEnable.................................................................................................................... 75
setP2PPort......................................................................................................................... 75
getP2PPort.........................................................................................................................75
getP2PInfo.........................................................................................................................76
getPPPoEConfig................................................................................................................76
setPPPoEConfig................................................................................................................ 76
EnableOnvifAgent.............................................................................................................77
DisableOnvifAgent........................................................................................................... 77
GetOnvifAgentStat............................................................................................................77
getNetMode.....................................................................................................................77
wifiTest..............................................................................................................................78
Device manage..........................................................................................................................79
setSystemTime.................................................................................................................. 79
getSystemTime..................................................................................................................80
openInfraLed.....................................................................................................................81
closeInfraLed.....................................................................................................................81
getInfraLedConfig.............................................................................................................81
setInfraLedConfig............................................................................................................. 82
getScheduleInfraLedConfig..............................................................................................82
setScheduleInfraLedConfig.............................................................................................. 82
getDevState....................................................................................................................... 83
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg6.png)
Foscam IPCamera CGI User Guide
getDevName......................................................................................................................84
setDevName...................................................................................................................... 84
getDevInfo.........................................................................................................................84
getDevAttr.........................................................................................................................85
getProductModel...............................................................................................................85
getProductModelName..................................................................................................... 85
getProductLanguage..........................................................................................................86
getProductSensorType.......................................................................................................86
getProductWifiType.......................................................................................................... 86
getProductSdFlag.............................................................................................................. 87
getProductOutdoorFlag.....................................................................................................87
getProductPtFlag...............................................................................................................87
getProductZoomFlag.........................................................................................................87
getProductRs485Flag........................................................................................................ 88
getProductIoAlarmFlag.....................................................................................................88
getProductOnvifFlag.........................................................................................................88
getProductP2pFlag............................................................................................................ 89
getProductWpsFlag...........................................................................................................89
getProductAudioFlag........................................................................................................ 89
getProductTalkFlag........................................................................................................... 89
getProductAppVer.............................................................................................................90
getProductAllInfo..............................................................................................................90
setProductAllInfo.............................................................................................................. 91
getNVRApSigQuality....................................................................................................... 92
getVoiceEnableState..........................................................................................................92
setVoiceEnableState..........................................................................................................92
getGeneratePubKey...........................................................................................................93
toolRestoreToFactory........................................................................................................93
System....................................................................................................................................... 93
rebootSystem.....................................................................................................................93
restoreToFactorySetting....................................................................................................94
exportConfig......................................................................................................................94
ImportConfig.....................................................................................................................94
FwUpgrade........................................................................................................................95
removePatch......................................................................................................................95
MISC......................................................................................................................................... 96
getFirewallConfig............................................................................................................. 96
setFirewallConfig..............................................................................................................96
getLog................................................................................................................................96
3. All platform except 3518A add cgi............................................................................................... 97
getAudioVolume................................................................................................................97
setAudioVolume................................................................................................................ 97
getWifiMode..................................................................................................................... 97
getTemperatureAlarmConfig............................................................................................ 98
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg7.png)
Foscam IPCamera CGI User Guide
setTemperatureAlarmConfig.............................................................................................98
getTemperatureState..........................................................................................................99
Music......................................................................................................................................... 99
setMusicDefaultListRefresh..............................................................................................99
getMusicListsName.........................................................................................................100
getMusicsNameOfList.................................................................................................... 100
addMusicList...................................................................................................................101
delMusicList....................................................................................................................102
setMusicPlayMode..........................................................................................................103
getMusicPlayMode......................................................................................................... 103
setMusicPlayNext........................................................................................................... 103
setMusicPlayPre..............................................................................................................104
getMusicPlayState...........................................................................................................104
setMusicPlayStart............................................................................................................104
setMusicPlayStop............................................................................................................105
setMusicDormantTime....................................................................................................105
getMusicDormantTime................................................................................................... 105
Cloud....................................................................................................................................... 106
getCloudConfig...............................................................................................................106
setCloudConfig............................................................................................................... 106
selectCloudServer........................................................................................................... 107
getCloudToken................................................................................................................ 107
getCloudQuota................................................................................................................ 108
testCloudServer...............................................................................................................108
getPushConfig.................................................................................................................108
setPushConfig................................................................................................................. 109
testPushServer.................................................................................................................109
setRichMediaPushConfig................................................................................................110
setFosPushConfig............................................................................................................110
setFosPushServer............................................................................................................ 110
pushOperate.....................................................................................................................111
SetOnlineUpgrade........................................................................................................... 111
setCloudStreamLevel...................................................................................................... 112
getCloudStreamLevel......................................................................................................112
4. FosBaby_Baidu CGI(Only).........................................................................................................112
getBaiduRtmp..................................................................................................................112
setBaiduRtmp.................................................................................................................. 113
GetOnlineUpgradeState.................................................................................................. 114
5. FosBaby_P1 CGI(Only)..............................................................................................................114
getHumidityAlarmConfig............................................................................................... 114
setHumidityAlarmConfig................................................................................................115
getHumidityState.............................................................................................................116
setNightLightState...........................................................................................................116
getNightLightState.......................................................................................................... 116
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg8.png)
Foscam IPCamera CGI User Guide
setOneKeyAlarmConfig..................................................................................................116
getOneKeyAlarmConfig................................................................................................. 117
getTimingRebootConfig..................................................................................................117
SetTimingRebootConfig................................................................................................. 118
6. 3518E+Fosbaby+Fosbaby_P1+Fosbaby_Baidu.........................................................................118
getSoftApConfig............................................................................................................. 118
setSoftApConfig..............................................................................................................119
setSoftApConfigNew...................................................................................................... 119
changeNetMode.............................................................................................................. 120
setFoscamRtmp...............................................................................................................120
getFoscamRtmp...............................................................................................................121
setSnapToFtpFilenameConfig.........................................................................................122
getSnapToFtpFilenameConfig........................................................................................ 122
7. Fosbaby_P1+3518E.................................................................................................................... 122
setLedEnableState........................................................................................................... 122
getLedEnableState...........................................................................................................123
8. Amba S2L(Only).........................................................................................................................123
getHdrMode.................................................................................................................... 123
setHdrMode.....................................................................................................................124
getWdrMode....................................................................................................................124
setWdrMode....................................................................................................................124
getVideoStreamParam.....................................................................................................124
setVideoStreamParam..................................................................................................... 125
getSubVideoStreamParam.............................................................................................. 125
setSubVideoStreamParam...............................................................................................126
getMotionDetectConfig1................................................................................................ 126
setMotionDetectConfig1.................................................................................................128
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg9.png)
Foscam IPCamera CGI User Guide
Add the following CGI command to set PT
startup position:
3) setPTZPrePointForSelfTest
4) getPTZPrePointForSelfTest
1. Add a snap CGI(snapPicture2) which
retrun jpeg image data directly but a
image url
2. Add MotionJpeg stream support
Check and Modify CGI command
document
1.Add note for GetMJStream, defects of
setContrast、mirrorVideo、flipVideo、logIn、
setSnapConfig 、 setPTZSpeed 、
setInfraLedConfig 、 setSubStreamFormat 、
setPortInfo、getPortInfo;
getLocalAlarmRecordConfig ;
setLocalAlarmRecordConfig;
getP2PEnable ; setP2PEnable ; getP2PPort;
setP2PPort ; setOSDMask ; getOSDMask ;
getScheduleSnapConfig ;
setScheduleSnapConfig;
-changeUserNameAndPwdTogether;
-getPCAudioAlarmCfg;
-setPCAudioAlarmCfg;
-setH264FrmRefMode;
-getH264FrmRefMode;
-setCruiseTime;
-getCruiseTime;
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bga.png)
-setSubVideoStreamParam;
-getSubVideoStreamParam;
-setCruiseTimeCustomed;
-getCruiseTimeCustomed;
-setCruiseLoopCnt;
-getCruiseLoopCnt;
-setCruiseCtrlMode;
-getCruiseCtrlMode;
-setCruisePrePointLingerTime;
-getCruisePrePointLingerTime;
-getScheduleRecordStreamChn;
-setScheduleRecordStreamChn;
-getProductModel;
-getProductModelName;
-getProductLanguage;
-getProductSensorType;
-getProductWifiType;
-getProductSdFlag;
-getProductOutdoorFlag;
-getProductPtFlag;
-getProductZoomFlag;
-getProductRs485Flag;
-getProductIoAlarmFlag;
-getProductOnvifFlag;
-getProductP2pFlag;
-getProductWpsFlag;
-getProductAudioFlag;
-getProductTalkFlag;
-getProductAppVer;
-getProductAllInfo;
-getGeneratePubKey;
-toolResetToFactory;
-setScheduleInfraLedConfig;
-getScheduleInfraLedConfig;
2.Modify Login error code-5、-7;
1.The usage of command-setSubStreamFormat,
getSnapConfig, setSnapConfig.
Foscam IPCamera CGI User Guide
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bgb.png)
Foscam IPCamera CGI User Guide
2.The example and description of
command-setMotionDetectConfig,
setScheduleSnapConfig, setIOAlarmConfig
getRecordList2,reloadRecordindex
1) The example of command:
setCruisePrePointLingerTime,
getCruisePrePointLingerTime.
2) The return discription of command:
getProductWpsFlag.
3)The Param of command:smtpTest.
1.Add commmad:getPPPoEConfig,
setPPPoEConfig,getRecordPath,getScheduleRe
cordConfig,getP2PInfo;
2.Modify the priviage of command for security:
changePassword,changeUserName,changeUser
NameAndPwdTogether,getSessionList,getUser
List,getImageSetting,getMirrorAndFlipSetting,
getMotionDetectConfig,getScheduleSnapConfi
g,getVideoStreamParam,getSubVideoStreamPa
ram,getMainVideoStreamType,getSubVideoStr
eamType,getH264FrmRefMode,getSnapConfig
,getOsdMaskArea,getOSDSetting,getOSDMas
k,getPTZSpeed,get485Info,getPTZPresetPoint
List,ptzGetCruiseMapList,ptzGetCruiseMapInf
o,getPTZSelfTestMode,getPTZPrePointForSelf
Test,getCruiseTime,getCruiseTimeCustomed,g
etCruiseLoopCnt,getCruiseCtrlMode,getCruise
PrePointLingerTime,getZoomSpeed,getSMTP
Config,getIPInfo,getPortInfo,getUPnPConfig,g
etDevInfo,getDevName,getFirewallConfig,getS
ystemTime,getFtpConfig,testFtpServer,getDD
NSConfig,getLog,getRecordList,getRecordList
2,reloadRecordindex,getScheduleRecordStrea
mChn,getAlarmRecordConfig,getLocalAlarmR
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bgc.png)
Foscam IPCamera CGI User Guide
ecordConfig,getPCAudioAlarmCfg,getIOAlar
mConfig,getDevState,getInfraLedConfig,getSc
heduleInfraLedConfig,getP2PEnable,getP2PPo
rt
getDeFrameLevel, setDeFrameLevel
1) The parameter description of command
setContrast.
integrate the CGI on all platforms and add new
command
1)setMusicPlayPath,getMusicPlayPath
1)getMotionDetectConfig,setMotionDetectCon
fig,setIOAlarmConfig,getIOAlarmConfig,getTe
mperatureAlarmConfig.setTemperatureAlarmC
onfig,getHumidityAlarmConfig,setHumidityAl
armConfig,addMusicList,delMusicList
Add command of amba platform:
getHdrMode,setHdrMode,getWdrMode,setWdr
Mode,getVideoStreamParam,setVideoStreamPa
ram,getSubVideoStreamParam,setSubStreamPa
ram,getMotionDetectConfig1,setMotionDetecC
onfig1
Add command:
setFoscamRtmp;getFoscamRtmp;setSnapToFtp
FilenameConfig;getSnapToFtpFilenameConfig;
getCloudStreamLeve;setCloudStreamLevel;s
etWifiSettingNew;
Add command:
setNetworkAutoAdaptability:
getsetNetworkAutoAdaptability;
Add command:
getDevAttr;setRichMediaPushConfig;GetOnv
ifAgentStat;setProductAllInfo;getNVRApSigQ
uality;getVoiceEnableState;setVoiceEnableSt
ate;getNetworkAutoAdaptability;setNetworkA
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bgd.png)
Foscam IPCamera CGI User Guide
utoAdaptability;getAudioSendMethod;getNet
Mode;wifiTest;
Add command:
setFtpConfigNew;testFtpServerNew;setSMT
PConfigNew;smtpTestNew
This document is for latest version.if you use this document for develop, your camera’s
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bge.png)
Foscam IPCamera CGI User Guide
Our device can only support authentication by pass user name or password attached
We only support GET and POST method. Only importConfig and fwUpgrade can
The cgi request string must be encode in url format. URL encode rule:
CGI request string format error
Username or password error
at CGI request string currentlly.
For example:
https://xxxxxx.myfoscam.org:443/cgi-bin/CGIProxy.fcgi&usr=admin&pwd=123&cmd=
ABC
support POST method.
The following chars will not be encoded:
[A~Z] [a~z] [0~9] + @ * /
The other chars will be encoded into hex format.
For example:
https://xxxxxx.myfoscam.org:443/cgi-bin/CGIProxy.fcgi?usr=admin&pwd=&cmd=getIPInfo
will be encode to:
https://xxxxxx.myfoscam.org:443/cgi-bin/CGIProxy.fcgi?usr%3Dadmin%26pwd%3D%26cmd%3DgetIPInfo
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
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bgf.png)
AV Function
Get color attribute of video
/cgi-bin/CGIProxy.fcgi?cmd=getImageSetting
/cgi-bin/CGIProxy.fcgi?cmd=getImageSetting&usr=admin&pwd=
/cgi-bin/CGIProxy.fcgi?cmd=setBrightness
/cgi-bin/CGIProxy.fcgi?cmd=setBrightness&brightness=50&usr=admin&pwd=
/cgi-bin/CGIProxy.fcgi?cmd=setContrast
getImageSetting
Foscam IPCamera CGI User Guide
setBrightness
setContrast
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg10.png)
/cgi-bin/CGIProxy.fcgi?cmd=setContrast&constrast=50&usr=admin&pwd=
setHue
/cgi-bin/CGIProxy.fcgi?cmd=setHue
/cgi-bin/CGIProxy.fcgi?cmd=setHue&hue=50&usr=admin&pwd=
/cgi-bin/CGIProxy.fcgi?cmd=setSaturation
/cgi-bin/CGIProxy.fcgi?cmd=setSaturation&saturation=50&usr=admin&pwd=
/cgi-bin/CGIProxy.fcgi?cmd=setSharpness
/cgi-bin/CGIProxy.fcgi?cmd=setSharpness&sharpness=50&usr=admin&pwd=
Set DenoiseLevel of video
Foscam IPCamera CGI User Guide
setSaturation
setSharpness
setDenoiseLevel (not use)
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg11.png)
/cgi-bin/CGIProxy.fcgi?cmd=setSharpness
/cgi-bin/CGIProxy.fcgi?cmd=setDenoiseLevel&level=50&usr=admin&pwd=
resetImageSetting
Reset color parameters to default value
/cgi-bin/CGIProxy.fcgi?cmd=resetImageSetting
/cgi-bin/CGIProxy.fcgi?cmd=resetImageSetting&usr=admin&pwd=
Get mirror and flip attribute of video
/cgi-bin/CGIProxy.fcgi?cmd=getMirrorAndFlipSetting
/cgi-bin/CGIProxy.fcgi?cmd=getMirrorAndFlipSetting&usr=admin&pwd=
Mirror video
/cgi-bin/CGIProxy.fcgi?cmd=mirrorVideo
Foscam IPCamera CGI User Guide
getMirrorAndFlipSetting
mirrorVideo
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg12.png)
/cgi-bin/CGIProxy.fcgi?cmd=mirrorVideo&
isMirror=1
&usr=admin&pwd=
flipVideo
/cgi-bin/CGIProxy.fcgi?cmd=flipVideo
/cgi-bin/CGIProxy.fcgi?cmd=flipVideo&isFlip=1&usr=admin&pwd=
Get value for image distortion correction
/cgi-bin/CGIProxy.fcgi?cmd=getRatio
Three ranks for image distortion correction
High:150.
Middle:210.
Low:430.
/cgi-bin/CGIProxy.fcgi?cmd=getRatio&usr=admin&pwd=
Set value for image distortion correction
/cgi-bin/CGIProxy.fcgi?cmd=setRatio
1. 0-511,value for image distortion correction.
Foscam IPCamera CGI User Guide
getRatio
setRatio
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg13.png)
High:0-150.
Middle:151-429.
Low:430-511.
3. Default, Middle.
/cgi-bin/CGIProxy.fcgi?cmd=setRatio&
ratio=150
&usr=admin&pwd=
getH264FrmRefMode
Get frame shipping reference mode of H264 encode stream
/cgi-bin/CGIProxy.fcgi?cmd=getH264FrmRefMode
1 Two frames are separated by four skipping
frames
/cgi-bin/CGIProxy.fcgi?cmd=getH264FrmRefMode&usr=admin&pwd=
Set frame shipping reference mode of H264 encode stream
/cgi-bin/CGIProxy.fcgi?cmd=setH264FrmRefMode
1 Two frames are separated by four skipping
frames
/cgi-bin/CGIProxy.fcgi?cmd=setH264FrmRefMode&mode=0&usr=admin&pwd=
Get stream channel for schedule record
Foscam IPCamera CGI User Guide
setH264FrmRefMode
getScheduleRecordStreamChn
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg14.png)
/cgi-bin/CGIProxy.fcgi?cmd=getScheduleRecordStreamChn
/cgi-bin/CGIProxy.fcgi?cmd=getScheduleRecordStreamChn&usr=admin&pwd=
setScheduleRecordStreamChn
Set stream channel for schedule record
/cgi-bin/CGIProxy.fcgi?cmd=setScheduleRecordStreamChn
/cgi-bin/CGIProxy.fcgi?cmd=setScheduleRecordStreamChn&chn=0&usr=admin
&pwd=
/cgi-bin/CGIProxy.fcgi?cmd=setPwrFreq
/cgi-bin/CGIProxy.fcgi?cmd=setPwrFreq&freq=0&usr=admin&pwd=
Get video stream param
/cgi-bin/CGIProxy.fcgi?cmd=getVideoStreamParam
Foscam IPCamera CGI User Guide
setPwrFreq
getVideoStreamParam
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg15.png)
Resolution of stream type N
Bit rate of stream type N (20480~2097152)
Frame rate of stream type N
P frames between I frame of stream type N
Change bit rate of stream 1-yes
0-nosetSubVideoStreamParam
/cgi-bin/CGIProxy.fcgi?cmd=getVideoStreamParam&usr=admin&pwd=
setVideoStreamParam
Set the video stream param of stream N
/cgi-bin/CGIProxy.fcgi?cmd=setVideoStreamParam
Resolution of stream type N
Bit rate of stream type N (20480~2097152)
Frame rate of stream type N
P frames between I frame of stream type N
The suggest value is: X * frameRate
Change bit rate of stream type 1-Yes 0-No
/cgi-bin/CGIProxy.fcgi?cmd=setVideoStreamParam&streamType=0&resolution=
0&bitRate=2097152&frameRate=30&GOP=30&isVBR=0&usr=admin&pwd=
Get sub video stream param
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamParam
Resolution of stream type N
Bit rate of stream type N (20480~2097152)
Frame rate of stream type N
P frames between I frame of stream type N
Foscam IPCamera CGI User Guide
getSubVideoStreamParam
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg16.png)
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamParam&usr=admin&pwd=
setSubVideoStreamParam
Set the sub video stream param of stream N
/cgi-bin/CGIProxy.fcgi?cmd=setSubVideoStreamParam
Resolution of stream type N
Bit rate of stream type N (20480~2097152)
Frame rate of stream type N
P frames between I frame of stream type N
The suggest value is: X * frameRate
/cgi-bin/CGIProxy.fcgi?cmd=setSubVideoStreamParam&streamType=0&resoluti
on=0&bitRate=2097152&frameRate=30&GOP=30&isVBR=0&usr=admin&pwd=
Get the stream type of main stream
/cgi-bin/CGIProxy.fcgi?cmd=getMainVideoStreamType
/cgi-bin/CGIProxy.fcgi?cmd=getMainVideoStreamType&usr=admin&pwd=
Get the stream type of sub stream
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamType
Foscam IPCamera CGI User Guide
getMainVideoStreamType
getSubVideoStreamType
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg17.png)
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamType&usr=admin&pwd=
setMainVideoStreamType
Set the stream type of main stream
/cgi-bin/CGIProxy.fcgi?cmd=setMainVideoStreamType
/cgi-bin/CGIProxy.fcgi?cmd=setMainVideoStreamType&streamType=0&usr=ad
min&pwd=
Set the stream format of sub stream
/cgi-bin/CGIProxy.fcgi?cmd=setSubStreamFormat
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.
/cgi-bin/CGIProxy.fcgi?cmd=setSubStreamFormat&format=0&usr=admin&pwd=
/cgi-bin/CGIStream.cgi?cmd=GetMJStream
Foscam IPCamera CGI User Guide
setSubStreamFormat
GetMJStream
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg18.png)
Foscam IPCamera CGI User Guide
1) Motion jpeg stream data is returned from https 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="https://xxxxxx.myfoscam.org:443/cgi-bin/CGIStream.cgi?cmd=GetMJStream
&usr=admin&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;
/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=admin&pwd=
/cgi-bin/CGIProxy.fcgi?cmd=getOSDSetting
Time stamp will display on screen or not
Camera name will display on screen or not
OSD display position, currently can only be 0
/cgi-bin/CGIProxy.fcgi?cmd=getOSDSetting&usr=admin&pwd=
getOSDSetting
setOSDSetting
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg19.png)
/cgi-bin/CGIProxy.fcgi?cmd=setOSDSetting
Time stamp will display on screen or not
Camera name will display on screen or not
OSD display position, currently can only be 0
/cgi-bin/CGIProxy.fcgi?cmd=setOSDSetting&isEnableTimeStamp=1&isEnableD
evName=1&dispPos=0&isEnableOSDMask=0&usr=admin&pwd=
getOsdMaskArea
/cgi-bin/CGIProxy.fcgi?cmd=getOsdMaskArea
The top left X position of mask N
The top left Y position of mask N
The bottom right X position of mask N
The bottom right Y position of mask N
Our device can only support 4 mask areas
/cgi-bin/CGIProxy.fcgi?cmd=getOsdMaskArea&usr=admin&pwd=
/cgi-bin/CGIProxy.fcgi?cmd=setOsdMaskArea
The top left X position of mask N
The top left Y position of mask N
The bottom right X position of mask N
The bottom right Y position of mask N
Our device can only support 4 mask areas
/cgi-bin/CGIProxy.fcgi?cmd=setOsdMaskArea&x1_0=100&y1_0=100&x2_0=20
0&y2_0=200&x1_1=0&y1_1=0&x2_1=0&y2_1=0&x1_2=0&y1_2=0&x2_2=0&y
2_2=0&x1_3=0&y1_3=0&x2_3=0&y2_3=0&usr=admin&pwd=
Foscam IPCamera CGI User Guide
setOsdMaskArea
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg1a.png)
getOSDMask
/cgi-bin/CGIProxy.fcgi?cmd=getOSDMask
Time stamp will display on screen or not
Camera name will display on screen or not
OSD display position, currently can only be 0
/cgi-bin/CGIProxy.fcgi?cmd=getOSDMask&usr=admin&pwd=
/cgi-bin/CGIProxy.fcgi?cmd=setOSDMask
/cgi-bin/CGIProxy.fcgi?cmd=setOSDMask&isEnableOSDMask=1&usr=admin&p
wd=
Get motion detect config
/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig
Is enable motion detect alarm
Motion alarm linkage
( bit3 | bit2 | bit1 | bit0 )
The interval time to snap picture again
setOSDMask
Foscam IPCamera CGI User Guide
getMotionDetectConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg1b.png)
Foscam IPCamera CGI User Guide
The time of which motion detect alaram can
trigger again when a motion detection has
happened.P.s.The true value of triggerInterval
time is the value of the cgi get add 5s.
Is enable motion alarm detect
Is enable Passive Infrared alarm detect
The motion alaram schedule of one week,
N = 0(Monday) ~6(Sunday)
For detail, see *1 bellow
The area info of row N
For detail, see *2 bellow
·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, scheduleN value range
/cgi-bin/CGIProxy.fcgi?cmd=getMotionDetectConfig&usr=admin&pwd=
Set motion detect config
/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig
Is enable motion detect alarm
Motion alarm linkage
( bit3 | bit2 | bit1 | bit0 )
The interval time to snap picture again
Motion detect
sensitivity
setMotionDetectConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg1c.png)
Foscam IPCamera CGI User Guide
The time of which motion detect alaram can
trigger again when a motion detection has
happened.P.s.The true value of triggerInterval
time is the value of the cgi set add 5s.
The motion alaram schedule of one week,
N = 0(Monday) ~6(Sunday)
For detail, see *1 bellow
The area info of row N
For detail, see *2 bellow
·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, scheduleN value range
/cgi-bin/CGIProxy.fcgi?cmd=setMotionDetectConfig&isEnable=1&linkage=16&s
napInterval=2&sensitivity=1&triggerInterval=5&isMovAlarmEnable=1&isPirAla
rmEnable=1&schedule0=1023&schedule1=1023&schedule2=1023&schedule3
=1023&schedule4=1023&schedule5=1023&schedule6=1023&area0=1023&are
a1=1023&area2=1023&area3=1023&area4=1023&area5=1023&area6=1023&
area7=1023&area7=1023&area8=1023&area9=1023&usr=admin&pwd=
*1 schedule bitmap
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg1d.png)
Foscam IPCamera CGI User Guide
Each grid of a row presents half of an
one day. For example, 40 presents
Set local alarm-record config
/cgi-bin/CGIProxy.fcgi?cmd=setLocalAlarmRecordConfig
isEnableLocalAlar
mRecord
/cgi-bin/CGIProxy.fcgi?cmd=setLocalAlarmRecordConfig&isEnableLocalAlarmR
ecord=1&localAlarmRecordSecs=30&usr=admin&pwd=
Get local alarm-record config
/cgi-bin/CGIProxy.fcgi?cmd=getLocalAlarmRecordConfig
~20:30.
The bit 40 set to “1” means the motion detection is effective between 20:00 to 20:30
*2 area bitmap
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
Copyright@ Shenzhen Foscam Intelligent Technology Limited
![](/html/08/08b6/08b6c65b8c0e235501d05343a77e1930bb271b567f86d2a518945fe8e8739cfc/bg1e.png)
isEnableLocalAlar
mRecord
/cgi-bin/CGIProxy.fcgi?cmd=getLocalAlarmRecordConfig&usr=admin&pwd=
getSnapConfig
/cgi-bin/CGIProxy.fcgi?cmd=getSnapConfig
/cgi-bin/CGIProxy.fcgi?cmd=getSnapConfig&usr=admin&pwd=
Set snap config
/cgi-bin/CGIProxy.fcgi?cmd=setSnapConfig
/cgi-bin/CGIProxy.fcgi?cmd=setSnapConfig&snapQuality=1&saveLocation=2&
usr=admin&pwd=
Foscam IPCamera CGI User Guide
setSnapConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited