Foscam CGI 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
1. General description....................................................................................................................14
2. All Platform CGI.......................................................................................................................... 15
AV Function...............................................................................................................................15
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
3
User account..............................................................................................................................44
PTZ Control...............................................................................................................................48
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
4
Network.....................................................................................................................................61
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
5
Device manage..........................................................................................................................79
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
6
System....................................................................................................................................... 93
MISC......................................................................................................................................... 96
3. All platform except 3518A add cgi............................................................................................... 97
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
7
Music......................................................................................................................................... 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
Foscam IPCamera CGI User Guide
8
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
Foscam IPCamera CGI User Guide
9
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:
setContrastmirrorVideoflipVideologIn
setSnapConfig setPTZSpeed
setInfraLedConfig setSubStreamFormat
setPortInfogetPortInfo
3.Add command:
getLocalAlarmRecordConfig
setLocalAlarmRecordConfig
getP2PEnable setP2PEnable getP2PPort
setP2PPort setOSDMask getOSDMask
getScheduleSnapConfig
setScheduleSnapConfig
1.0.6
Houzhen
2013-12-12
1.Add command:
-changeUserNameAndPwdTogether
-getPCAudioAlarmCfg
-setPCAudioAlarmCfg
-setH264FrmRefMode
-getH264FrmRefMode
-setCruiseTime
-getCruiseTime
Copyright@ Shenzhen Foscam Intelligent Technology Limited
10
-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.0.7
Houzhen
2013-12-14
Modify Command:
1.The usage of command-setSubStreamFormat,
getSnapConfig, setSnapConfig.
Foscam IPCamera CGI User Guide
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
11
2.The example and description of
command-setMotionDetectConfig,
setScheduleSnapConfig, setIOAlarmConfig
1.0.8
Houzhen
2014-1-17
1.Add commmad:
getRecordList2,reloadRecordindex
1.0.9
Houzhen
2014-3-15
1.Add command:
getRatio, setRatio
2.Modify command:
1) The example of command:
setCruisePrePointLingerTime,
getCruisePrePointLingerTime.
2) The return discription of command:
getProductWpsFlag.
3The Param of command:smtpTest.
1.0.10
Houzhen
2014-4-2
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
Foscam IPCamera CGI User Guide
12
ecordConfig,getPCAudioAlarmCfg,getIOAlar
mConfig,getDevState,getInfraLedConfig,getSc
heduleInfraLedConfig,getP2PEnable,getP2PPo
rt
1.0.11
Houzhen
2014-6-27
1.Add command:
getDeFrameLevel, setDeFrameLevel
1.0.12
Houzhen
2014-7-9
1.Modify
1) The parameter description of command
setContrast.
1.0.13
PengMengjia
2014-11-24
integrate the CGI on all platforms and add new
command
1.0.14
LeeJunliang
2015-5-10
1.Del command:
1)setMusicPlayPath,getMusicPlayPath
2.Modify command:
1)getMotionDetectConfig,setMotionDetectCon
fig,setIOAlarmConfig,getIOAlarmConfig,getTe
mperatureAlarmConfig.setTemperatureAlarmC
onfig,getHumidityAlarmConfig,setHumidityAl
armConfig,addMusicList,delMusicList
1.0.15
ZhangWei
2015-6-9
Add command of amba platform:
getHdrMode,setHdrMode,getWdrMode,setWdr
Mode,getVideoStreamParam,setVideoStreamPa
ram,getSubVideoStreamParam,setSubStreamPa
ram,getMotionDetectConfig1,setMotionDetecC
onfig1
1.0.16
PengMengjia
2015-10-12
Add command:
setFoscamRtmp;getFoscamRtmp;setSnapToFtp
FilenameConfig;getSnapToFtpFilenameConfig;
getCloudStreamLeve;setCloudStreamLevel;s
etWifiSettingNew;
1.0.17
QiYongkun
2016-6-2
Add command:
setNetworkAutoAdaptability:
getsetNetworkAutoAdaptability;
1.0.18
LeiZhiPing
2016-11-8
Add command:
getDevAttr;setRichMediaPushConfig;GetOnv
ifAgentStat;setProductAllInfo;getNVRApSigQ
uality;getVoiceEnableState;setVoiceEnableSt
ate;getNetworkAutoAdaptability;setNetworkA
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
13
utoAdaptability;getAudioSendMethod;getNet
Mode;wifiTest;
1.0.19
BaiShiYi
2016-12-08
Add command:
setFtpConfigNew;testFtpServerNew;setSMT
PConfigNew;smtpTestNew
This document is for latest version.if you use this document for develop, your camera’s
version must be latest.
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
14
1. General description
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 execute result
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
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
15
2. All Platform CGI

AV Function

Function
Get color attribute of video
privilege
admin
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
constrast
0~100

getImageSetting

Foscam IPCamera CGI User Guide

setBrightness

setContrast

Copyright@ Shenzhen Foscam Intelligent Technology Limited
16
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setContrast&constrast=50&usr=admin&pwd=

setHue

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=
Function
Set DenoiseLevel of video
Foscam IPCamera CGI User Guide

setSaturation

setSharpness

setDenoiseLevel (not use)

Copyright@ Shenzhen Foscam Intelligent Technology Limited
17
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSharpness
Param
DenoiseLevel
0~100
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setDenoiseLevel&level=50&usr=admin&pwd=

resetImageSetting

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
admin
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
Foscam IPCamera CGI User Guide

getMirrorAndFlipSetting

mirrorVideo
Copyright@ Shenzhen Foscam Intelligent Technology Limited
18
1 Mirror
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=mirrorVideo&
isMirror=1
&usr=admin&pwd=

flipVideo

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&isFlip=1&usr=admin&pwd=
Function
Get value for image distortion correction
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getRatio
Param
None
Return
ratio
Three ranks for image distortion correction
High:150.
Middle:210.
Low:430.
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getRatio&usr=admin&pwd=
Function
Set value for image distortion correction
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setRatio
Param
ratio
1. 0-511value for image distortion correction.
2. Three ranks,
Foscam IPCamera CGI User Guide

getRatio

setRatio

Copyright@ Shenzhen Foscam Intelligent Technology Limited
19
High:0-150.
Middle:151-429.
Low:430-511.
3. Default, Middle.
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setRatio&
ratio=150
&usr=admin&pwd=

getH264FrmRefMode

Function
Get frame shipping reference mode of H264 encode stream
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getH264FrmRefMode
Param
None
Return
mode
0 Normal reference mode
1 Two frames are separated by four skipping
frames
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getH264FrmRefMode&usr=admin&pwd=
Function
Set frame shipping reference mode of H264 encode stream
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setH264FrmRefMode
Param
mode
0 Normal reference mode
1 Two frames are separated by four skipping
frames
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setH264FrmRefMode&mode=0&usr=admin&pwd=
Function
Get stream channel for schedule record
privilege
admin
Foscam IPCamera CGI User Guide

setH264FrmRefMode

getScheduleRecordStreamChn

Copyright@ Shenzhen Foscam Intelligent Technology Limited
20
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getScheduleRecordStreamChn
Param
None
Return
chn
0 main stream
1 sub stream
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getScheduleRecordStreamChn&usr=admin&pwd=

setScheduleRecordStreamChn

Function
Set stream channel for schedule record
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setScheduleRecordStreamChn
Param
chn
0 main stream
1 sub stream
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setScheduleRecordStreamChn&chn=0&usr=admin
&pwd=
Function
Set power freq of sensor
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setPwrFreq
Param
freq
0 60HZ
1 50HZ
2 outdoor mode
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setPwrFreq&freq=0&usr=admin&pwd=
Function

Get video stream param

privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getVideoStreamParam
Foscam IPCamera CGI User Guide

setPwrFreq

getVideoStreamParam
Copyright@ Shenzhen Foscam Intelligent Technology Limited
21
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
Change bit rate of stream 1-yes
0-nosetSubVideoStreamParam
Note
N means streamType [0~3]
Example
/cgi-bin/CGIProxy.fcgi?cmd=getVideoStreamParam&usr=admin&pwd=

setVideoStreamParam

Function
Set the video stream param of stream N
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setVideoStreamParam
Param
streamType
0~3
resolution
Resolution of stream type N
bitRate
Bit rate of stream type N (20480~2097152)
frameRate
Frame rate of stream type N
GOP
P frames between I frame of stream type N
The suggest value is: X * frameRate
isVBR
Change bit rate of stream type 1-Yes 0-No
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setVideoStreamParam&streamType=0&resolution=
0&bitRate=2097152&frameRate=30&GOP=30&isVBR=0&usr=admin&pwd=
Function

Get sub video stream param

privilege
visitor
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamParam
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
Foscam IPCamera CGI User Guide
getSubVideoStreamParam
Copyright@ Shenzhen Foscam Intelligent Technology Limited
22
isVBRN
Not in use currentlly
Note
N means streamType [0~3]
Example
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamParam&usr=admin&pwd=

setSubVideoStreamParam

Function
Set the sub video stream param of stream N
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSubVideoStreamParam
Param
streamType
0~3
resolution
Resolution of stream type N
bitRate
Bit rate of stream type N (20480~2097152)
frameRate
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=setSubVideoStreamParam&streamType=0&resoluti
on=0&bitRate=2097152&frameRate=30&GOP=30&isVBR=0&usr=admin&pwd=
Function
Get the stream type of main stream
privilege
admin
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&pwd=
Function
Get the stream type of sub stream
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamType
Param
None
Foscam IPCamera CGI User Guide

getMainVideoStreamType

getSubVideoStreamType

Copyright@ Shenzhen Foscam Intelligent Technology Limited
23
Return
streamType
The stream type 0~3
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamType&usr=admin&pwd=

setMainVideoStreamType

Function
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
Example
/cgi-bin/CGIProxy.fcgi?cmd=setMainVideoStreamType&streamType=0&usr=ad
min&pwd=
Function
Set the stream format of sub stream
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSubStreamFormat
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=setSubStreamFormat&format=0&usr=admin&pwd=
Function
Get motion jpeg stream
privilege
visitor
Usage
/cgi-bin/CGIStream.cgi?cmd=GetMJStream
Param
None
Foscam IPCamera CGI User Guide

setSubStreamFormat

GetMJStream

Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
24
Return
Motion jpeg stream data
Note
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;
Example
/cgi-bin/CGIStream.cgi?cmd=GetMJStream&usr=admin&pwd=
Function
Get OSD config
privilege
admin
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

getOSDSetting

setOSDSetting

Copyright@ Shenzhen Foscam Intelligent Technology Limited
25
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
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setOSDSetting&isEnableTimeStamp=1&isEnableD
evName=1&dispPos=0&isEnableOSDMask=0&usr=admin&pwd=

getOsdMaskArea

Function
Get OSD mask area info
privilege
admin
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=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
26

getOSDMask

Function
Get OSD mask status
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getOSDMask
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=getOSDMask&usr=admin&pwd=
Function
Set OSD mask status
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setOSDMask
Param
isEnableOSDMask
0-Disable, 1-Enable
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setOSDMask&isEnableOSDMask=1&usr=admin&p
wd=
Function

Get motion detect config

privilege
admin
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
bit2:Snap picture
bit3:Record
snapInterval
The interval time to snap picture again
sensitivity
Motion detect
0 : Low

setOSDMask

Foscam IPCamera CGI User Guide
getMotionDetectConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
27
sensitivity
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.P.s.The true value of triggerInterval
time is the value of the cgi get add 5s.
isMovAlarmEnable
Is enable motion alarm detect
isPirAlarmEnable
Is enable Passive Infrared alarm detect
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, scheduleN value range
1-2
N
(N[0-48])
.areaN value
1-2
N
(N[0-10])
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
setMotionDetectConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
28
triggerInterval
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.
isMovAlarmEnable
0
Disable
1
Enable
isPirAlarmEnable
0
Disable
1
Enable
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, scheduleN value range
1-2
N
(N[0-48])
.areaN value
1-2
N
(N[0-10])
Example
/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=
0123456
7
Monday
Tuesday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday…Wednesday
*1 schedule bitmap
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Foscam IPCamera CGI User Guide
29
Each grid of a row presents half of an
hour of
one day. For example, 40 presents
20:00
bit0
bit1
bit2
bit3
bit4
bit5
bit6
bit7
bit8
bit9
Function
Set local alarm-record config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setLocalAlarmRecordConfig
Param
isEnableLocalAlar mRecord
0
Disable
1
Enable
localAlarmRecordS ecs
Recording time
Return
None
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=setLocalAlarmRecordConfig&isEnableLocalAlarmR
ecord=1&localAlarmRecordSecs=30&usr=admin&pwd=
Function
Get local alarm-record config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getLocalAlarmRecordConfig
Param
None
40414243444546
47
area0
area1
area2
area3
area4
area5
area6
area7
area8
area9
~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
30
Return
isEnableLocalAlar mRecord
0
Disable
1
Enable
localAlarmRecordS ecs
Recording time
Note
Example
/cgi-bin/CGIProxy.fcgi?cmd=getLocalAlarmRecordConfig&usr=admin&pwd=

getSnapConfig

Function
Get snap config
privilege
admin
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getSnapConfig
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=setSnapConfig
Param
snapQuality
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&snapQuality=1&saveLocation=2&
usr=admin&pwd=
Foscam IPCamera CGI User Guide
setSnapConfig
Copyright@ Shenzhen Foscam Intelligent Technology Limited
Loading...
+ 99 hidden pages