Foscam IPCamera CGI Guide
Foscam IPCamera CGI Guide
Copyright@ Shenzhen Foscam Intelligent Technology Limited
1
Foscam IPCamera CGI Guide
Contents 1. General description....................................................................................................................12 2. All Platform CGI..........................................................................................................................13 AV Function...............................................................................................................................13 getImageSetting.................................................................................................................13 setBrightness..................................................................................................................... 13 setContrast.........................................................................................................................13 setHue................................................................................................................................14 setSaturation...................................................................................................................... 14 setSharpness...................................................................................................................... 14 setDenoiseLevel (not use).................................................................................................14 resetImageSetting..............................................................................................................15 getMirrorAndFlipSetting.................................................................................................. 15 mirrorVideo....................................................................................................................... 15 flipVideo............................................................................................................................16 getRatio............................................................................................................................. 16 setRatio..............................................................................................................................16 getH264FrmRefMode....................................................................................................... 17 setH264FrmRefMode........................................................................................................17 getScheduleRecordStreamChn......................................................................................... 17 setScheduleRecordStreamChn.......................................................................................... 18 setPwrFreq.........................................................................................................................18 getVideoStreamParam.......................................................................................................18 setVideoStreamParam....................................................................................................... 19 getSubVideoStreamParam................................................................................................ 19 setSubVideoStreamParam.................................................................................................20 getMainVideoStreamType.................................................................................................20 getSubVideoStreamType...................................................................................................20 setMainVideoStreamType................................................................................................. 21 setSubStreamFormat......................................................................................................... 21 GetMJStream.....................................................................................................................21 getOSDSetting...................................................................................................................22 setOSDSetting................................................................................................................... 22 getOsdMaskArea...............................................................................................................23 setOsdMaskArea............................................................................................................... 23 getOSDMask..................................................................................................................... 24 setOSDMask......................................................................................................................24 getMotionDetectConfig.................................................................................................... 24 setMotionDetectConfig.....................................................................................................25 setLocalAlarmRecordConfig............................................................................................ 27 getLocalAlarmRecordConfig............................................................................................27 getSnapConfig...................................................................................................................28 setSnapConfig................................................................................................................... 28 getScheduleSnapConfig.................................................................................................... 29 Copyright@ Shenzhen Foscam Intelligent Technology Limited
2
Foscam IPCamera CGI Guide
setScheduleSnapConfig.................................................................................................... 29 snapPicture........................................................................................................................ 30 snapPicture2...................................................................................................................... 30 getRecordList.................................................................................................................... 30 getRecordList2.................................................................................................................. 31 reloadRecordindex............................................................................................................ 31 getAlarmRecordConfig.....................................................................................................32 setAlarmRecordConfig..................................................................................................... 32 getRecordPath................................................................................................................... 32 setRecordPath....................................................................................................................33 getScheduleRecordConfig................................................................................................ 33 setScheduleRecordConfig.................................................................................................34 setIOAlarmConfig.............................................................................................................35 getIOAlarmConfig............................................................................................................ 35 clearIOAlarmOutput......................................................................................................... 36 setAudioAlarmConfig....................................................................................................... 36 getAudioAlarmConfig...................................................................................................... 37 setPCAudioAlarmCfg....................................................................................................... 37 getPCAudioAlarmCfg.......................................................................................................37 getMultiDevList................................................................................................................ 38 getMultiDevDetailInfo......................................................................................................38 addMultiDev......................................................................................................................38 delMultiDev...................................................................................................................... 39 setDeFrameLevel.............................................................................................................. 39 getDeFrameLevel..............................................................................................................39 .............................................................................................................................. 40 add........................................................................................................................40 del........................................................................................................................ 40 get.......................................................................................................................41 change................................................................................................................ 41 changeName.............................................................................................................. 41 changeNameAndPwdTogether.................................................................................. 42 ...................................................................................................................................42 ................................................................................................................................43 getSessionList................................................................................................................... 43 getList........................................................................................................................ 43 usrBeatHeart......................................................................................................................44 PTZ Control...............................................................................................................................44 ptzMoveUp........................................................................................................................44 ptzMoveDown...................................................................................................................44 ptzMoveLeft...................................................................................................................... 45 ptzMoveRight....................................................................................................................45 ptzMoveTopLeft................................................................................................................45 ptzMoveTopRight..............................................................................................................46 Copyright@ Shenzhen Foscam Intelligent Technology Limited
3
Foscam IPCamera CGI Guide
ptzMoveBottomLeft..........................................................................................................46 ptzMoveBottomRight........................................................................................................46 ptzStopRun........................................................................................................................ 46 ptzReset............................................................................................................................. 47 getPTZSpeed..................................................................................................................... 47 setPTZSpeed......................................................................................................................47 getPTZPresetPointList...................................................................................................... 48 ptzAddPresetPoint.............................................................................................................48 ptzDeletePresetPoint......................................................................................................... 48 ptzGotoPresetPoint............................................................................................................49 ptzGetCruiseMapList........................................................................................................ 49 ptzGetCruiseMapInfo........................................................................................................49 ptzSetCruiseMap............................................................................................................... 50 ptzDelCruiseMap.............................................................................................................. 50 ptzStartCruise.................................................................................................................... 50 ptzStopCruise.................................................................................................................... 51 setCruiseTime....................................................................................................................51 getCruiseTime................................................................................................................... 51 setCruiseTimeCustomed................................................................................................... 51 getCruiseTimeCustomed...................................................................................................52 setCruiseLoopCnt..............................................................................................................52 getCruiseLoopCnt............................................................................................................. 52 setCruiseCtrlMode............................................................................................................ 53 getCruiseCtrlMode............................................................................................................53 setCruisePrePointLingerTime........................................................................................... 53 getCruisePrePointLingerTime...........................................................................................53 zoomIn...............................................................................................................................54 zoomOut............................................................................................................................ 54 zoomStop...........................................................................................................................54 getZoomSpeed...................................................................................................................55 setZoomSpeed................................................................................................................... 55 setPTZSelfTestMode.........................................................................................................55 getPTZSelfTestMode........................................................................................................ 56 setPTZPrePointForSelfTest...............................................................................................56 getPTZPrePointForSelfTest.............................................................................................. 56 set485Info..........................................................................................................................57 get485Info......................................................................................................................... 57 Network..................................................................................................................................... 58 getIPInfo............................................................................................................................58 setIpInfo............................................................................................................................ 58 refreshWifiList.................................................................................................................. 59 getWifiList.........................................................................................................................59 setWifiSetting....................................................................................................................59 getWifiConfig....................................................................................................................61 Copyright@ Shenzhen Foscam Intelligent Technology Limited
4
Foscam IPCamera CGI Guide
getPortInfo.........................................................................................................................62 setPortInfo......................................................................................................................... 62 getUPnPConfig................................................................................................................. 62 setUPnPConfig.................................................................................................................. 63 getDDNSConfig................................................................................................................63 setDDNSConfig................................................................................................................ 64 setFtpConfig...................................................................................................................... 64 getFtpConfig......................................................................................................................65 testFtpServer......................................................................................................................65 getSMTPConfig................................................................................................................ 65 setSMTPConfig.................................................................................................................66 smtpTest.............................................................................................................................67 setP2PEnable.....................................................................................................................67 getP2PEnable.................................................................................................................... 68 setP2PPort......................................................................................................................... 68 getP2PPort.........................................................................................................................68 getP2PInfo.........................................................................................................................68 getPPPoEConfig................................................................................................................69 setPPPoEConfig................................................................................................................ 69 Device manage.......................................................................................................................... 69 setSystemTime.................................................................................................................. 69 getSystemTime..................................................................................................................70 openInfraLed..................................................................................................................... 71 closeInfraLed.....................................................................................................................71 getInfraLedConfig.............................................................................................................72 setInfraLedConfig............................................................................................................. 72 getScheduleInfraLedConfig.............................................................................................. 72 setScheduleInfraLedConfig.............................................................................................. 73 getDevState....................................................................................................................... 73 getDevName......................................................................................................................74 setDevName...................................................................................................................... 74 getDevInfo.........................................................................................................................75 getProductModel............................................................................................................... 75 getProductModelName..................................................................................................... 76 getProductLanguage..........................................................................................................76 getProductSensorType.......................................................................................................76 getProductWifiType.......................................................................................................... 76 getProductSdFlag.............................................................................................................. 77 getProductOutdoorFlag.....................................................................................................77 getProductPtFlag............................................................................................................... 77 getProductZoomFlag.........................................................................................................78 getProductRs485Flag........................................................................................................ 78 getProductIoAlarmFlag.....................................................................................................78 getProductOnvifFlag......................................................................................................... 78 Copyright@ Shenzhen Foscam Intelligent Technology Limited
5
Foscam IPCamera CGI Guide
getProductP2pFlag............................................................................................................ 79 getProductWpsFlag........................................................................................................... 79 getProductAudioFlag........................................................................................................ 79 getProductTalkFlag........................................................................................................... 80 getProductAppVer............................................................................................................. 80 getProductAllInfo..............................................................................................................80 getGeneratePubKey...........................................................................................................81 toolRestoreToFactory........................................................................................................81 System....................................................................................................................................... 82 rebootSystem.....................................................................................................................82 restoreToFactorySetting.................................................................................................... 82 exportConfig......................................................................................................................82 ImportConfig.....................................................................................................................83 FwUpgrade........................................................................................................................ 83 removePatch...................................................................................................................... 84 MISC......................................................................................................................................... 84 getFirewallConfig............................................................................................................. 84 setFirewallConfig..............................................................................................................84 getLog................................................................................................................................85 3. FosBaby+FosBaby_P1+Fosbaby_Baidu add cgi......................................................................... 85 getAudioVolume................................................................................................................85 setAudioVolume................................................................................................................ 85 getWifiMode..................................................................................................................... 86 getTemperatureAlarmConfig............................................................................................ 86 setTemperatureAlarmConfig.............................................................................................87 getTemperatureState..........................................................................................................87 Music......................................................................................................................................... 88 setMusicDefaultListRefresh..............................................................................................88 getMusicListsName...........................................................................................................88 getMusicsNameOfList...................................................................................................... 88 addMusicList.....................................................................................................................89 delMusicList......................................................................................................................90 setMusilayMode............................................................................................................91 getMusilayMode........................................................................................................... 91 setMusilayNext............................................................................................................. 91 setMusilayPre................................................................................................................92 getMusilayState.............................................................................................................92 setMusilayStart..............................................................................................................93 setMusilayStop..............................................................................................................93 setMusicDormantTime......................................................................................................93 getMusicDormantTime..................................................................................................... 94 Cloud......................................................................................................................................... 94 getCloudConfig................................................................................................................. 94 setCloudConfig................................................................................................................. 95 Copyright@ Shenzhen Foscam Intelligent Technology Limited
6
Foscam IPCamera CGI Guide
selectCloudServer............................................................................................................. 95 getCloudToken.................................................................................................................. 95 getCloudQuota.................................................................................................................. 96 testCloudServer................................................................................................................. 96 getPushConfig................................................................................................................... 97 setPushConfig................................................................................................................... 97 testPushServer................................................................................................................... 97 pushOperate.......................................................................................................................98 SetOnlineUpgrade............................................................................................................. 98 4. FosBaby_Baidu CGI(Only).......................................................................................................... 99 getBaiduRtmp....................................................................................................................99 setBaiduRtmp.................................................................................................................. 100 GetOnlineUpgradeState.................................................................................................. 101 5. FosBaby_P1 CGI(Only)..............................................................................................................101 getHumidityAlarmConfig............................................................................................... 101 setHumidityAlarmConfig................................................................................................102 getHumidityState.............................................................................................................103 setNightLightState...........................................................................................................103 getNightLightState.......................................................................................................... 103 setOneKeyAlarmConfig..................................................................................................103 getOneKeyAlarmConfig................................................................................................. 104 getTimingRebootConfig................................................................................................. 104 SetTimingRebootConfig................................................................................................. 105 getHumidityAlarmConfig.................................................................错误!未定义书签。 setHumidityAlarmConfig................................................................. 错误!未定义书签。 getHumidityState.............................................................................. 错误!未定义书签。 6. 3518E+Fosbaby+Fosbaby_P1+Fosbaby_Baidu.........................................................................105 getSoftApConfig............................................................................................................. 105 setSoftApConfig..............................................................................................................106 changeNetMode.............................................................................................................. 106 7. Fosbaby_P1+3518E.................................................................................................................... 107 setLedEnableState........................................................................................................... 109 getLedEnableState...........................................................................................................109 8. Amba S2L(Only)......................................................................................................................... 110 getHdrMode.....................................................................................................................110 setHdrMode..................................................................................................................... 110 getWdrMode....................................................................................................................110 setWdrMode.................................................................................................................... 111 getVideoStreamParam..................................................................................................... 111 setVideoStreamParam..................................................................................................... 111 getSubVideoStreamParam...............................................................................................112 setSubVideoStreamParam............................................................................................... 112 getMotionDetectConfig1.................................................................................................113 setMotionDetectConfig1................................................................................................. 114 Copyright@ Shenzhen Foscam Intelligent Technology Limited
7
Foscam IPCamera CGI Guide
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
1.0.3
Houzhen
2013-6-5
Check
and
Modify
CGI
command
document 1.0.4
Limaike
2013-6-8
CGI command check
1.0.5
Houzhen
2013-9-25
1.Add note for GetMJStream, defects of Firefox; 2.Modify Command: setContrast、mirrorVideo、flipVideo、、 setSnapConfig
、
setPTZSpeed
、
setInfraLedConfig 、 setSubStreamFormat 、 setPortInfo、getPortInfo; 3.Add command: getLocalAlarmRecordConfig
;
setLocalAlarmRecordConfig; getP2PEnable ; setP2PEnable ; getP2PPort ; setP2PPort ; setOSDMask ; getOSDMask ; getScheduleSnapConfig
;
setScheduleSnapConfig; 1.0.6
Houzhen
2013-12-12
1.Add command: -changeNameAndPwdTogether; -getPCAudioAlarmCfg; -setPCAudioAlarmCfg; -setH264FrmRefMode; -getH264FrmRefMode; -setCruiseTime; -getCruiseTime;
Copyright@ Shenzhen Foscam Intelligent Technology Limited
8
Foscam IPCamera CGI Guide
-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 error code-5、-7; 1.0.7
Houzhen
2013-12-14
Modify Command: 1.The usage of command-setSubStreamFormat, getSnapConfig, setSnapConfig.
Copyright@ Shenzhen Foscam Intelligent Technology Limited
9
Foscam IPCamera CGI Guide
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. 3)The 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: change,changeName,change NameAndPwdTogether,getSessionList,get 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
10
Foscam IPCamera CGI Guide
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)setMusilayPath,getMusilayPath 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
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
11
Foscam IPCamera CGI Guide
1. General description Our device can only authentication by name or attached at CGI request string currentlly. For example: https://xxxxxx.myfoscam.org:443/cgi-bin/CGIProxy.fcgi&usr=&pwd=123&cmd= ABC We only GET and POST method. Only importConfig and fwUpgrade can POST method. The cgi request string must be encode in url format. URL encode rule: The following chars will not be encoded: [A~Z] [a~z] [0~9] + @ * / The other chars will be encoded into hex format. For example: https://xxxxxx.myfoscam.org:443/cgi-bin/CGIProxy.fcgi?usr=&pwd=&cmd=getIPInfo
will be encode to: https://xxxxxx.myfoscam.org:443/cgi-bin/CGIProxy.fcgi?usr%3D%26pwd%3D%26cmd%3DgetIPInfo
cgi execute result 1) We orgnize the cgi execute result as xml format, for example:
0
1
192.168.1.8
0.0.0.0
<mask>255.255.255.0
0.0.0.0
0.0.0.0
means the common execute result value
mean
0
Success
-1
CGI request string format error
-2
name or error
-3
Access deny
-4
CGI execute fail
-5
Timeout
-6
Reserve
-7
Unknown error
-8
Reserve
Copyright@ Shenzhen Foscam Intelligent Technology Limited
12
Foscam IPCamera CGI Guide
2. All Platform CGI AV Function getImageSetting Function
Get color attribute of video
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getImageSetting
Param
None brightness
0~100
contrast
0~100
hue
0~100
saturation
0~100
sharpness
0~100
denoiseLevel
Not use
Return
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=getImageSetting&usr=&pwd=
setBrightness Function
Set brightness of video
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setBrightness
Param
brightness
Return
None
0~100
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=setBrightness&brightness=50&usr=&pwd=
setContrast Function
Set contrast of video
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setContrast
Param
constrast
0~100
Copyright@ Shenzhen Foscam Intelligent Technology Limited
13
Foscam IPCamera CGI Guide
Return
None
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=setContrast&constrast=50&usr=&pwd=
setHue Function
Set hue of video
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setHue
Param
hue
Return
None
0~100
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=setHue&hue=50&usr=&pwd=
setSaturation Function
Set saturation of video
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSaturation
Param
saturation
Return
None
0~100
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=setSaturation&saturation=50&usr=&pwd=
setSharpness Function
Set sharpness of video
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSharpness
Param
sharpness
Return
None
0~100
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=setSharpness&sharpness=50&usr=&pwd=
setDenoiseLevel (not use) Function
Set DenoiseLevel of video
Copyright@ Shenzhen Foscam Intelligent Technology Limited
14
Foscam IPCamera CGI Guide
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSharpness
Param
DenoiseLevel
Return
None
0~100
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=setDenoiseLevel&level=50&usr=&pwd=
resetImageSetting Function
Reset color parameters to default value
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=resetImageSetting
Param
None
Return
None
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=resetImageSetting&usr=&pwd=
getMirrorAndFlipSetting Function
Get mirror and flip attribute of video
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getMirrorAndFlipSetting
Param
None
Return
isMirror isFlip
0
Not mirred
1
Mirred
0
Not filpped
1
Flipped
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=getMirrorAndFlipSetting&usr=&pwd=
mirrorVideo Function
Mirror video
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=mirrorVideo
Param
isMirror
0
Not mirror
Copyright@ Shenzhen Foscam Intelligent Technology Limited
15
Foscam IPCamera CGI Guide
1 Return
Mirror
None
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=mirrorVideo&isMirror=1&usr=&pwd=
flipVideo Function
Flip video
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=flipVideo
Param
isFlip
Return
0
Not flip
1
Flip
None
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=flipVideo&isFlip=1&usr=&pwd=
getRatio Function
Get value for image distortion correction
privilege
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=&pwd=
setRatio Function
Set value for image distortion correction
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setRatio
Param
ratio
1. 0-511,value for image distortion correction. 2. Three ranks,
Copyright@ Shenzhen Foscam Intelligent Technology Limited
16
Foscam IPCamera CGI Guide 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=&pwd=
getH264FrmRefMode Function
Get frame shipping reference mode of H264 encode stream
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getH264FrmRefMode
Param
None
Return
mode
0 1
Normal reference mode Two frames are separated by four skipping
frames
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=getH264FrmRefMode&usr=&pwd=
setH264FrmRefMode Function
Set frame shipping reference mode of H264 encode stream
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setH264FrmRefMode
Param
mode
0 1
Normal reference mode Two frames are separated by four skipping
frames
Return
None
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=setH264FrmRefMode&mode=0&usr=&pwd=
getScheduleRecordStreamChn Function
Get stream channel for schedule record
privilege
Copyright@ Shenzhen Foscam Intelligent Technology Limited
17
Foscam IPCamera CGI Guide
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=&pwd=
setScheduleRecordStreamChn Function
Set stream channel for schedule record
privilege
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= &pwd=
setPwrFreq Function
Set power freq of sensor
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setPwrFreq
Param
freq
Return
0
60HZ
1
50HZ
2
outdoor mode
None
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=setPwrFreq&freq=0&usr=&pwd=
getVideoStreamParam Function
Get video stream param
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getVideoStreamParam
Copyright@ Shenzhen Foscam Intelligent Technology Limited
18
Foscam IPCamera CGI Guide
Param
None
Return
resolutionN
Resolution of stream type N
bitRateN
Bit rate of stream type N
frameRateN
Frame rate of stream type N
GOPN
P frames between I frame of stream type N
isVBRN
Change
bit
(20480~2097152)
rate
of
stream
1-yes
0-nosetSubVideoStreamParam
Note
N means streamType [0~3]
Example
/cgi-bin/CGIProxy.fcgi?cmd=getVideoStreamParam&usr=&pwd=
setVideoStreamParam Function
Set the video stream param of stream N
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setVideoStreamParam
Param
streamType
0~3
resolution
Resolution of stream type N
bitRate
Bit rate of stream type N
frameRate
Frame rate of stream type N
GOP
P frames between I frame of stream type N
(20480~2097152)
The suggest value is: X * frameRate
isVBR Return
Change bit rate of stream type 1-Yes 0-No
None
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=setVideoStreamParam&streamType=0&resolution= 0&bitRate=2097152&frameRate=30&GOP=30&isVBR=0&usr=&pwd=
getSubVideoStreamParam 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
frameRateN
Frame rate of stream type N
GOPN
P frames between I frame of stream type N
Copyright@ Shenzhen Foscam Intelligent Technology Limited
(20480~2097152)
19
Foscam IPCamera CGI Guide
isVBRN
Not in use currentlly
Note
N means streamType [0~3]
Example
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamParam&usr=&pwd=
setSubVideoStreamParam Function
Set the sub video stream param of stream N
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSubVideoStreamParam
Param
streamType
0~3
resolution
Resolution of stream type N
bitRate
Bit rate of stream type N
frameRate
Frame rate of stream type N
GOP
P frames between I frame of stream type N
(20480~2097152)
The suggest value is: X * frameRate
isVBR Return
Not in use currentlly
None
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=setSubVideoStreamParam&streamType=0&resoluti on=0&bitRate=2097152&frameRate=30&GOP=30&isVBR=0&usr=&pwd=
getMainVideoStreamType Function
Get the stream type of main stream
privilege
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=&pwd=
getSubVideoStreamType Function
Get the stream type of sub stream
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamType
Param
None
Copyright@ Shenzhen Foscam Intelligent Technology Limited
20
Foscam IPCamera CGI Guide
Return
streamType
The stream type
0~3
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=getSubVideoStreamType&usr=&pwd=
setMainVideoStreamType Function
Set the stream type of main stream
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setMainVideoStreamType
Param
streamType
Return
None
The stream type
0~3
Note Example
/cgi-bin/CGIProxy.fcgi?cmd=setMainVideoStreamType&streamType=0&usr=ad min&pwd=
setSubStreamFormat Function
Set the stream format of sub stream
privilege
Usage
/cgi-bin/CGIProxy.fcgi?cmd=setSubStreamFormat
Param
format
0
H264
1
MotionJpeg
Return
None
Note
Our device can only 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 as a sub stream , the stream data will be same as main stream.
Example
/cgi-bin/CGIProxy.fcgi?cmd=setSubStreamFormat&format=0&usr=&pwd=
GetMJStream Function
Get motion jpeg stream
privilege
visitor
Usage
/cgi-bin/CGIStream.cgi?cmd=GetMJStream
Param
None
Copyright@ Shenzhen Foscam Intelligent Technology Limited
21
Foscam IPCamera CGI Guide
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: