DAHUA HTTP API FOR IPC Version 1.40
DAHUA HTTP API FOR IPC Version 1.40
DAHUA HTTP API FOR IPC Version 1.40
Version 1.40
1
Document History
No Release Notes Date Version Author
1 draft 2007-1-18 1.10 Haifeng Wang
2
1.Preface
This document details the API of Dahua video products. Programmers can access and configure Dahua video products follows the API.
This document with version 1.10 is available with firmware version 2.0 and above. This document with version 1.20, 1.21, 1.22, 1.23,
1.24,1,25,1,26,1,27,1,28 is available with firmware 2.210 and above.This document with version 1. 29 , 1.30, 1.31, 1.32, 1.33, 1.34, 1.35,
1.36 is available with firmware 2.210 and above.This document with version 1.37,1.38 is available with firmware 2.212, 2.4 and above.
This document with version 1.39 is available with firmware 2.42 and above.
2.Catalog
Document History ......................................................................................................................................................................................................2
1.Preface ....................................................................................................................................................................................................................3
2.Catalog ....................................................................................................................................................................................................................3
3.HTTP API Transaction ..............................................................................................................................................................................................9
3.1Transaction ...................................................................................................................................................................................................9
3.2Authentication ............................................................................................................................................................................................10
4.Camera..................................................................................................................................................................................................................10
4.1Stream ........................................................................................................................................................................................................11
4.1.1 GetStream .......................................................................................................................................................................................11
4.1.2 GetMaxExtraStreamCounts .............................................................................................................................................................11
4.1.3 GetSnapshot ...................................................................................................................................................................................11
4.1.4 GetVideo .........................................................................................................................................................................................11
4.1.5 PlayBack ..........................................................................................................................................................................................12
4.1.6 LoadFile...........................................................................................................................................................................................12
4.1.7 GetStream By Http ..........................................................................................................................................................................12
4.1.8 Playback By Http .............................................................................................................................................................................12
4.2VideoColor ..................................................................................................................................................................................................13
4.2.1 GetVideoColorConfig ......................................................................................................................................................................13
4.2.2 SetVideoColorConfig .......................................................................................................................................................................14
4.3VideoInOptions ...........................................................................................................................................................................................14
4.3.1 GetVideoInputCaps .........................................................................................................................................................................14
4.3.2 GetVideoInOptionsConfig ...............................................................................................................................................................16
4.3.3 SetVideoInOptionsConfig................................................................................................................................................................19
4.4VideoEncode...............................................................................................................................................................................................23
4.4.1 GetVideoConfigCaps .......................................................................................................................................................................23
4.4.2 Resolution .......................................................................................................................................................................................24
4.4.3 GetVideoEncodeConfig ...................................................................................................................................................................24
4.4.4 SetVideoEncodeConfig ...................................................................................................................................................................25
4.5AudioEncode ...............................................................................................................................................................................................26
4.5.1 GetAudioConfigCaps .......................................................................................................................................................................26
3
4.5.2 GetAudioEncodeConfig ................................................................................................................................................................... 27
4.5.3 SetAudioEncodeConfig.................................................................................................................................................................... 27
4.6 SnapEncode ...............................................................................................................................................................................................28
4.6.1 GetSnapConfigCaps .........................................................................................................................................................................28
4.6.2 GetSnapEncodeConfig ....................................................................................................................................................................29
4.6.3 SetSnapEncodeConfig .....................................................................................................................................................................29
4.7ChannelTitle ...............................................................................................................................................................................................30
4.7.1 GetChannelTitleConfig ....................................................................................................................................................................30
4.7.2 SetChannelTitleConfig ....................................................................................................................................................................31
4.8VideoStandard ............................................................................................................................................................................................31
4.8.1 GetVideoStandardConfig ................................................................................................................................................................31
4.8.2 SetVideoStandardConfig .................................................................................................................................................................31
4.9VideoWidget...............................................................................................................................................................................................31
4.9.1 GetVideoWidgetConfig ...................................................................................................................................................................31
4.9.2 SetVideoWidgetConfig ...................................................................................................................................................................32
4.10VideoOut ..................................................................................................................................................................................................34
4.10.1 GetVideoOutConfig.......................................................................................................................................................................34
4.10.2 SetVideoOutConfig .......................................................................................................................................................................35
4.11FlashLight ..................................................................................................................................................................................................35
4.11.1 GetFlashLightConfig ......................................................................................................................................................................35
4.11.2 SetFlashLightConfig .......................................................................................................................................................................36
5.NetWork ...............................................................................................................................................................................................................36
5.1NetInterfaces ..............................................................................................................................................................................................36
5.1.1 GetInterfaces...................................................................................................................................................................................36
5.2BasicConfig.................................................................................................................................................................................................. 37
5.2.1 GetBasicConfig ................................................................................................................................................................................ 37
5.2.2 SetBasicConfig ................................................................................................................................................................................. 37
5.3PPPoE ..........................................................................................................................................................................................................38
5.3.1 GetPPPoEConfig ..............................................................................................................................................................................38
5.3.2 SetPPPoEConfig ...............................................................................................................................................................................38
5.4DDNS ...........................................................................................................................................................................................................39
5.4.1 GetDDNSConfig ...............................................................................................................................................................................39
5.4.2 SetDDNSConfig................................................................................................................................................................................39
5.5Email ...........................................................................................................................................................................................................40
5.5.1 GetEmailConfig ...............................................................................................................................................................................40
5.5.2 SetEmailConfig ................................................................................................................................................................................40
5.6Wlan ...........................................................................................................................................................................................................41
5.6.1 GetWlanConfig ................................................................................................................................................................................41
5.6.2 SetWlanConfig ................................................................................................................................................................................41
5.6.3 ScanWlanDevices ............................................................................................................................................................................42
5.7UPnP ...........................................................................................................................................................................................................43
5.7.1 GetUPnPConfig ...............................................................................................................................................................................43
5.7.2 SetUPnPConfig ................................................................................................................................................................................43
5.7.3 GetUPnPStatus ................................................................................................................................................................................43
5.8NTP .............................................................................................................................................................................................................44
4
5.8.1 GetNTPConfig..................................................................................................................................................................................44
5.8.2 SetNTPConfig ..................................................................................................................................................................................44
5.9RTSP ............................................................................................................................................................................................................45
5.9.1 GetRTSPConfig ................................................................................................................................................................................45
5.9.2 SetRTSPConfig .................................................................................................................................................................................45
6.Events ...................................................................................................................................................................................................................46
6.1EventHandler ..............................................................................................................................................................................................46
6.1.1 GetEventHandler.............................................................................................................................................................................46
6.1.2 SetEventHandler ............................................................................................................................................................................. 47
6.2Alarm ..........................................................................................................................................................................................................49
6.2.1 GetAlarmConfig ..............................................................................................................................................................................49
6.2.2 SetAlarmConfig ...............................................................................................................................................................................49
6.2.3 GetAlarmOutConfig ........................................................................................................................................................................50
6.2.4 SetAlarmOutConfig .........................................................................................................................................................................50
6.2.5 GetInSlots ........................................................................................................................................................................................50
6.2.6 GetOutSlots .....................................................................................................................................................................................50
6.2.7 GetInState .......................................................................................................................................................................................51
6.2.8 GetOutState ....................................................................................................................................................................................51
6.2.9 GetChannelInState ..........................................................................................................................................................................51
6.2.10 GetChannelOutState .....................................................................................................................................................................51
6.3MotionDetect .............................................................................................................................................................................................51
6.3.1 GetMotionDetectConfig ..................................................................................................................................................................51
6.3.2 SetMotionDetectConfig .................................................................................................................................................................. 52
6.4BlindDetect .................................................................................................................................................................................................53
6.4.1 GetBlindDetectConfig .....................................................................................................................................................................53
6.4.2 SetBlindDetectConfig ......................................................................................................................................................................53
6.5LossDetect ..................................................................................................................................................................................................54
6.5.1 GetLossDetectConfig .......................................................................................................................................................................54
6.5.2 SetLossDetectConfig .......................................................................................................................................................................54
6.6LoginFailureAlarm ....................................................................................................................................................................................... 54
6.6.1 GetLoginFailureAlarmConfig ...........................................................................................................................................................54
6.6.2 SetLoginFailureAlarmConfig ............................................................................................................................................................55
6.7 StorageAbnormal ....................................................................................................................................................................................... 55
6.7.1 GetStorageNotExistConfig ...............................................................................................................................................................55
6.7.2 SetStorageNotExistConfig ...............................................................................................................................................................55
6.7.3 Get StorageFailureConfig ................................................................................................................................................................55
6.7.4 Set StorageFailureConfig .................................................................................................................................................................56
6.7.5 GetStorageLowSpaceConfig ............................................................................................................................................................56
6.7.6 SetStorageLowSpaceConfig .............................................................................................................................................................56
6.8 NetAbnormal .............................................................................................................................................................................................56
6.8.1 GetNetAbortConfig .........................................................................................................................................................................56
6.8.2 SetNetAbortConfig .......................................................................................................................................................................... 57
6.8.3 GetIPConflictConfig ......................................................................................................................................................................... 57
6.8.4 SetIPConflictConfig ......................................................................................................................................................................... 57
6.9 GetEventIndexes ........................................................................................................................................................................................ 57
5
6.10 Attach.......................................................................................................................................................................................................58
7.PTZ ........................................................................................................................................................................................................................59
7.1PTZConfig ....................................................................................................................................................................................................59
7.1.1 GetPTZConfig ..................................................................................................................................................................................59
7.1.2 SetPTZConfig ...................................................................................................................................................................................59
7.2PTZControl ..................................................................................................................................................................................................60
7.2.1 GetProtocolList................................................................................................................................................................................60
7.2.2 GetCurrentProtocolCaps .................................................................................................................................................................60
7.2.3 PTZ control commands ................................................................................................................................................................... 62
7.3PTZStatus ....................................................................................................................................................................................................64
7.3.1 PTZ GetStatus ..................................................................................................................................................................................64
8.Record&Snap ........................................................................................................................................................................................................65
8.1Record .........................................................................................................................................................................................................65
8.1.1 GetRecordConfig .............................................................................................................................................................................65
8.1.2 SetRecordConfig..............................................................................................................................................................................65
8.1.3 GetRecordModeConfig ...................................................................................................................................................................66
8.1.4 SetRecordModeConfig ....................................................................................................................................................................66
8.2Snap ............................................................................................................................................................................................................66
8.2.1 GetSnapConfig ................................................................................................................................................................................66
8.2.2 SetSnapConfig ................................................................................................................................................................................. 67
8.3MediaGlobal ............................................................................................................................................................................................... 67
8.3.1 GetMediaGlobalConfig.................................................................................................................................................................... 67
8.3.2 SetMediaGlobalConfig .................................................................................................................................................................... 67
8.4Holiday ........................................................................................................................................................................................................68
8.4.1 GetHolidayConfig ............................................................................................................................................................................68
8.4.2 SetHolidayConfig .............................................................................................................................................................................68
9.System ..................................................................................................................................................................................................................69
9.1General .......................................................................................................................................................................................................69
9.1.1 GetGeneralConfig............................................................................................................................................................................69
9.1.2 SetGeneralConfig ............................................................................................................................................................................69
9.2SystemTime ................................................................................................................................................................................................ 70
9.2.1 GetCurrentTime .............................................................................................................................................................................. 70
9.2.2 SetCurrentTime............................................................................................................................................................................... 70
9.3Locales ........................................................................................................................................................................................................ 70
9.3.1 GetLocalesConfig ............................................................................................................................................................................ 70
9.3.2 SetLocalesConfig .............................................................................................................................................................................71
9.4Language ..................................................................................................................................................................................................... 72
9.4.1 GetLanguageCaps ........................................................................................................................................................................... 72
9.4.2 GetLanguageConfig ......................................................................................................................................................................... 72
9.4.3 SetLanguageConfig.......................................................................................................................................................................... 72
9.5AccessFilter .................................................................................................................................................................................................73
9.5.1 GetAccessFilterConfig .....................................................................................................................................................................73
9.5.2 SetAccessFilterConfig ......................................................................................................................................................................73
9.6AutoMaintain ..............................................................................................................................................................................................73
9.6.1 GetAutoMaintainConfig ..................................................................................................................................................................73
6
9.6.2 SetAutoMaintainConfig ................................................................................................................................................................... 74
9.7UserManager .............................................................................................................................................................................................. 74
9.7.1 Group .............................................................................................................................................................................................. 74
9.7.2 GetGroupInfo ..................................................................................................................................................................................75
9.7.3 GetGroupInfoAll ..............................................................................................................................................................................75
9.7.4 AddUser ..........................................................................................................................................................................................75
9.7.5 DeleteUser ...................................................................................................................................................................................... 76
9.7.6 ModifyUser ..................................................................................................................................................................................... 76
9.7.7 ModifyPassword ............................................................................................................................................................................. 76
9.7.8 GetUserInfo ..................................................................................................................................................................................... 76
9.7.9 GetUserInfoAll.................................................................................................................................................................................77
9.7.10 GetActiveUserInfoAll .....................................................................................................................................................................77
9.8System Operation ....................................................................................................................................................................................... 77
9.8.1 Reboot ............................................................................................................................................................................................77
9.8.2 Shutdown ........................................................................................................................................................................................77
9.8.3 GetDeviceType ................................................................................................................................................................................ 78
9.8.4 GetHardwareVersion ....................................................................................................................................................................... 78
9.8.5 GetSerialNo ..................................................................................................................................................................................... 78
9.8.6 GetMachineName ........................................................................................................................................................................... 78
9.8.7 GetSystemInfo ................................................................................................................................................................................. 78
9.8.8 GetVendor ....................................................................................................................................................................................... 78
9.8.9 GetSoftwareVersion ........................................................................................................................................................................79
9.8.10 GetOnvifVersion ............................................................................................................................................................................79
9.9 Log .............................................................................................................................................................................................................79
9.9.1 StartFind .........................................................................................................................................................................................79
9.9.2 DoFind.............................................................................................................................................................................................79
9.9.3 StopFind ..........................................................................................................................................................................................80
9.9.4 Clear ................................................................................................................................................................................................ 80
9.10 UserGlobal ...............................................................................................................................................................................................80
9.10.1 GetUserGlobalConfig ....................................................................................................................................................................80
9.10.2 SetUserGlobalConfig .....................................................................................................................................................................80
10.Storage................................................................................................................................................................................................................81
10.1 File Finding ..............................................................................................................................................................................................81
10.1.1 Create............................................................................................................................................................................................81
10.1.2 StartFind .......................................................................................................................................................................................81
10.1.3 FindNextFile ..................................................................................................................................................................................81
10.1.4 Close .............................................................................................................................................................................................82
10.1.5 Destroy ..........................................................................................................................................................................................82
10.2 Storage Device .........................................................................................................................................................................................83
10.2.1 GetStorageDeviceCollect ..............................................................................................................................................................83
10.3 Work Group .............................................................................................................................................................................................83
10.3.1 GetWorkGroupCollect ...................................................................................................................................................................83
10.4 Work Directory.........................................................................................................................................................................................83
10.4.1 GetWorkDirectoryCollect ..............................................................................................................................................................83
10.5 NAS ..........................................................................................................................................................................................................84
7
10.5.1 GetNASConfig ...............................................................................................................................................................................84
10.5.2 SetNASConfig ................................................................................................................................................................................84
10.6 Storage Point............................................................................................................................................................................................85
10.6.1 GetRecordStoragePointConfig ......................................................................................................................................................85
10.6.2 SetRecordStoragePointConfig .......................................................................................................................................................85
10.6.3 GetStorageGroupConfig ................................................................................................................................................................85
10.6.4 SetStorageGroupConfig.................................................................................................................................................................86
11.Audio ..................................................................................................................................................................................................................86
11.1 Audio MIME type .....................................................................................................................................................................................86
11.2 Post Audio ................................................................................................................................................................................................ 87
11.2.1 Example for singlepart .................................................................................................................................................................. 87
11.2.2 Example for multipart ................................................................................................................................................................... 87
11.3 Get Audio .................................................................................................................................................................................................88
11.3.1 Example for singlepart ..................................................................................................................................................................88
11.3.2 Example for multipart ...................................................................................................................................................................88
12.Appendix.............................................................................................................................................................................................................89
12.1 Stream Format ......................................................................................................................................................................................... 89
13.VedioInput ..........................................................................................................................................................................................................91
13.1 AdjustFocus ..............................................................................................................................................................................................91
13.2 AdjustFocusContinuously .........................................................................................................................................................................91
13.3 AutoFocus ................................................................................................................................................................................................ 92
13.4 GetFocusStatus ........................................................................................................................................................................................ 92
14. SD Camera ......................................................................................................................................................................................................... 92
14.1 VideoInWhiteBalance .............................................................................................................................................................................. 92
14.1.1 GetVideoInWhiteBalance ............................................................................................................................................................. 92
14.2.2 SetVideoInWhiteBalance ..............................................................................................................................................................93
14.2 VideoInExposure ...................................................................................................................................................................................... 93
14.2.1 GetVideoInExposure .....................................................................................................................................................................93
14.2.2 SetVideoInExposure ......................................................................................................................................................................95
14.3 VideoInDenoise ....................................................................................................................................................................................96
14.3.1 GetVideoInDenoise .......................................................................................................................................................................96
14.3.2 SetVideoInDenoise ....................................................................................................................................................................... 97
14.4 VideoInDayNight .................................................................................................................................................................................. 97
14.4.1 GetVideoInDayNight ..................................................................................................................................................................... 97
14.4.2 SetVideoInDayNight ......................................................................................................................................................................98
14.5 VideoInFocus ..........................................................................................................................................................................................98
14.5.1 GetVideoInFocus...........................................................................................................................................................................98
14.5.2 SetVideoInFocus ...........................................................................................................................................................................99
14.6 VideoInZoom ..........................................................................................................................................................................................99
14.6.1 GetVideoInZoom...........................................................................................................................................................................99
14.6.2 SetVideoInZoom ...........................................................................................................................................................................99
14.7 VideoInSharpness ..............................................................................................................................................................................100
14.7.1 GetVideoInSharpness .................................................................................................................................................................100
14.7.2 SetVideoInSharpness ..................................................................................................................................................................100
14.8 VideoInColor .........................................................................................................................................................................................101
8
14.8.1 GetVideoInColor .........................................................................................................................................................................101
14.8.2 SetVideoInColor ..........................................................................................................................................................................101
14.9 VideoInRotate ....................................................................................................................................................................................... 102
14.9.1 GetVideoInRotate ....................................................................................................................................................................... 102
14.9.2 SetVideoInRotate ........................................................................................................................................................................ 102
14.10 VideoInMode ......................................................................................................................................................................................103
14.10.1 GetVideoInMode ......................................................................................................................................................................103
14.10.2 SetVideoInMode .......................................................................................................................................................................104
15. VideoAnalyse ...................................................................................................................................................................................................104
15.1 VideoAnalyseRule ..................................................................................................................................................................................105
15.1.1 GetVideoAnalyseRule .................................................................................................................................................................105
15.1.2 SetVideoAnalyseRule ..................................................................................................................................................................105
3.1Transaction
The HTTP API Transaction starts from a request from a client Application, usually a web browser. The request is processed by the web
server on the Dahua video products, then send the response back to the client application. The HTTP request is taken in GET form. If the
request is successful, the Dahua video product will return a HTTP header contains 200 OK. The HTTP Body will contain actual data or error
message if an error occurs.
For describe convenience, we use some short words to instead the long expressions. The follows are several regulations:
1. The italics and bold will be replaced by the value behind the symbol “=”.
2. The URL must follow the standard way of writing a URL.(RFC_3986:Uniform Resource Identifiers (URI) Generic Syntax);that is ,spaces
and other reserved characters (“;”, “/”, “?”, “:”, “@”, “=”, “+”, “,” and “$”) within a <paramName> or a <paramValue> must be replaced
with %<ASCII hex>.For example ,the blank must be instead with %20.
3. To describe the range of the configuration, we use some symbols such as “[]”, “{}” and so on. For example :”[0-100]” denotes a
integer not less than 0 and not larger than 100. “{0,1,2,3}” denotes the valid value of a integer among 0,1,2 and 3.
4. In the request and response, we use “[]” to denote an array. The index is usually a integer and start form 0.
5. The parameter value has several types: string, integer, bool and float.Integer is 32 bits.The range of bool is “true” and “false”.
The below is an example of a transaction:
Request GET http://<ip>/cgi-bin/configManager.cgi?action=getConfig&name=VideoColor
Description Get VideoColor configuration.
Response HTTP/1.1 200 OK
Content-Type:text/plain
head.Brightness=50
head.Contrast=50
head.Hue=50
head.Saturation=50
head.TimeSection=1 00:00:00-24:00:00
9
Comment In above table, head= table.VideoColor[ChannelNo][ColorConfigNo]
ChannelNo = video channel index,
colorConfigNo = color config index.
0 = Color Config 1
1 = Color Config 2
…
We can also request the single config.
For example:
Request :
GET http://10.7.2.4/cgi-bin/configManager.cgi?action=getConfig&name=VideoColor[0][0].Brightness
Response:
HTTP/1.1 200 OK
Content-Type:text/plain
table.VideoColor[0][0].Brightness=50
3.2Authentication
The Dahua video product supplies two authentication ways: basic authentication and digest authentication. If the http request does not
have “Authorization” , the Dahua video product returns 401, utill the http request has a legal authentication .
For example:
1. When basic authentication, the Dahua video product response:
401 Unauthorized
WWW-Authenticate: Basic realm=”XXXXXX”
Then the client encode the username and password with base64, send the following request:
Authorization: Basic VXZVXZ.
2. When digest authentication, the Dahua video product response:
WWW-Authenticate: Digest realm="DH_00408CA5EA04", nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad",
stale=FALSE, qop="auth";
The client calculates the digest using username, password, nonce, realm and URI with MD5, then send the following request:
Authorization: Digest username="admin", realm="DH_00408CA5EA04", nc=00000001,cnonce="0a4f113b",qop="auth"
nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad",uri="cgi-bin/global.login?userName=admin",
response="65002de02df697e946b750590b44f8bf"
4.Camera
Camera API allows application to configure and view Dahua video product settings.
10
4.1Stream
4.1.1 GetStream
4.1.2 GetMaxExtraStreamCounts
4.1.3 GetSnapshot
4.1.4 GetVideo
11
Content-Type:image/jpeg
Content-Length:<image size>
4.1.5 PlayBack
4.1.6 LoadFile
Comment Compared to 4.1.1 GetStream using RTSP, it is another way of get stream. This is a way to use http
protocol to get realmonitor stream. The data format is shown in appendix.
12
endTime=<endTime>
Response HTTP Code: 200 OK
Content-Type: Application/octet-stream
Body:
streamId=<streamId>\r\n
<data>
<data>
Comment Compared to 4.1.5 Playback using RTSP, it is another way of get playback stream. This is a way to use
http protocol to get playback stream. The data format is shown in appendix.
cmd=pause
pause the playback stream;
cmd=cancel
cancel the playback stream, and destroy the streamed;
This is the cgi to control playback stream, used to control the stream which built by “action=getStream”.
4.2VideoColor
4.2.1 GetVideoColorConfig
13
0 = Color Config 1
1 = Color Config 2
…
4.2.2 SetVideoColorConfig
Example:
0 01:00:00-02:00:00, means this config is not effective.
1 01:00:00-02:00:00, means this config is effective between 01:00:00 and 02:00:00
4.3VideoInOptions
4.3.1 GetVideoInputCaps
15
GainAuto bool true: support auto gain.
HorizontalBinning integer Horizontal/Vertical pixel binning mask,
VerticalBinning integer 1 – support 2 pixel binning,
2 – support 3 pixel binning
4 - support 4 pixel binning
…
2^n – support n+2 pixel binning
InfraRed bool true: support Infra compensation
Iris bool true: support Iris adjust
IrisAuto bool true: support auto Iris adjust
LadenBitrate integer Unit is Kbps.
Maximum value of video stream bitrate, 16bpp, not in binning mode.
LimitedAutoExposure bool true: support auto exposure with time limit.
MaxHeight integer Maximum video height
MaxWidth integer Maximum video width
Mirror bool true: support picture mirror.
NightOptions bool true: support night options.
ReferenceLevel bool true: support reference level.
Rotate90 bool true: support clockwise/anticlockwise 90°rotate
SetColor bool true: support color set.
SignalFormats string It’s a string contains supported video input signal formats for this channel. Signal formats
are separated by comma.
Range is {Inside, BT656, 720p,1080p, 1080i, 1080sF, 1_3M}
4.3.2 GetVideoInOptionsConfig
16
head.ExposureSpeed=0
head.ExposureValue1=0.100000
head.ExposureValue2=80.000000
head.ExternalSync=0
head.ExternalSyncPhase=0
head.FlashControl.Mode=0
head.FlashControl.Pole=0
head.FlashControl.Value=0
head.FlashControl.PreValue=0
head.Flip=false
head.Gain=50
head.GainAuto=true
head.IrisAuto=false
head.Mirror=false
head.NightOptions.AntiFlicker=0
head.NightOptions.Backlight=0
head.NightOptions.BacklightRegion[0]=3096
head.NightOptions.BacklightRegion[1]=3096
head.NightOptions.BacklightRegion[2]=5096
head.NightOptions.BacklightRegion[3]=5096
head.NightOptions.BrightnessThreshold=50
head.NightOptions.DayNightColor=2
head.NightOptions.ExposureMode=0
head.NightOptions.ExposureSpeed=0
head.NightOptions.ExposureValue1=0
head.NightOptions.ExposureValue2=40
head.NightOptions.ExternalSyncPhase=125
head.NightOptions.Flip=false
head.NightOptions.Gain=50
head.NightOptions.GainAuto=true
head.NightOptions.GainBlue=50
head.NightOptions.GainGreen=50
head.NightOptions.GainMax=50
head.NightOptions.GainMin=0
head.NightOptions.GainRed=50
head.NightOptions.GlareInhibition=0
head.NightOptions.IrisAuto=true
head.NightOptions.Mirror=false
head.NightOptions.Profile=3
head.NightOptions.ReferenceLevel=50
head.NightOptions.Rotate90=0
head.NightOptions.SunriseHour=0
head.NightOptions.SunriseMinute=0
head.NightOptions.SunriseSecond=0
head.NightOptions.SunsetHour=23
17
head.NightOptions.SunsetMinute=59
head.NightOptions.SunsetSecond=59
head.NightOptions.SwitchMode=4
head.NightOptions.WhiteBalance=Auto
head.NightOptions.WideDynamicRange=0
head.NightOptions.WideDynamicRangeMode=0
head.NormalOptions.AntiFlicker=0
head.NormalOptions.Backlight=0
head.NormalOptions.BacklightRegion[0]=3096
head.NormalOptions.BacklightRegion[1]=3096
head.NormalOptions.BacklightRegion[2]=5096
head.NormalOptions.BacklightRegion[3]=5096
head.NormalOptions.BrightnessThreshold=50
head.NormalOptions.DayNightColor=1
head.NormalOptions.ExposureMode=0
head.NormalOptions.ExposureSpeed=0
head.NormalOptions.ExposureValue1=0
head.NormalOptions.ExposureValue2=40
head.NormalOptions.ExternalSyncPhase=125
head.NormalOptions.Flip=false
head.NormalOptions.Gain=50
head.NormalOptions.GainAuto=true
head.NormalOptions.GainBlue=50
head.NormalOptions.GainGreen=50
head.NormalOptions.GainMax=50
head.NormalOptions.GainMin=0
head.NormalOptions.GainRed=50
head.NormalOptions.GlareInhibition=0
head.NormalOptions.IrisAuto=true
head.NormalOptions.Mirror=false
head.NormalOptions.Profile=0
head.NormalOptions.ReferenceLevel=50
head.NormalOptions.Rotate90=0
head.NormalOptions.SunriseHour=0
head.NormalOptions.SunriseMinute=0
head.NormalOptions.SunriseSecond=0
head.NormalOptions.SunsetHour=23
head.NormalOptions.SunsetMinute=59
head.NormalOptions.SunsetSecond=59
head.NormalOptions.SwitchMode=0
head.ReferenceLevel=50
head.ReferenceLevelEnable=false
head.Rotate90=0
head.SignalFormat=BT656
head.WhiteBalance=Disable
18
Comment In above table, head = table.VideoInOptions[ChannelNo]
ChannelNo = video channel index.
4.3.3 SetVideoInOptionsConfig
19
head.ExternalSyncPhase integer Range is [0°-360°]
External Synchronous Signal Phase
head.FlashControl.Mode integer Range is {0,1,2}
0:forbid flash
1:always flash
2:auto flash
head.FlashControl.Pole integer Range is {0,1, 2, 3}
Trigger mode:
0:low level
1:high level
2: rising-edge
3:falling-edge
head.FlashControl.Value integer Range is [0-15]
Flashlight time-unit:
0 - 0us,
1 - 64us,
2 - 128us,
3 – 192us
...
15 - 960us
head.FlashControl.PreValue integer Range is [0-100]
It’s threshold of brightness value, if brightness is less than this value, flash light
begin to work.
head.Flip bool true: enable video flip function
false: disable video flip function
head.Gain integer Range is [0-100]
If GainAuto is true, it’s upper limit of auto gain, else it’s the fixed gain adjust
value.
head.GainBlue integer Range is [0-100]
Gain for blue value, Value is effective when WhiteBalance is “Custom.”
head.GainRed integer Range is [0-100]
Gain for red value, Value is effective when WhiteBalance is “Custom.”
head.GainGreen integer Range is [0-100]
Gain for green value, Value is effective when WhiteBalance is “Custom.”
head.GainAuto bool true: GainAuto
false: No GainAuto
head.IrisAuto bool true: IrisAuto
false: No IrisAuto
head.Mirror bool true: enable video mirror function
false: disable video mirror function
head.WhiteBalance String Range is {Disable, Auto, Custom, Sunny, Cloudy, Home, Office, Night}
White balance Mode
head.ReferenceLevel integer Range is [0-100]
The expected average brightness level of video frames.
head.Rotate90 integer Range is {0,1,2}
20
Video rotation:
0: No rotate
1: clockwise rotate 90°
2: anticlockwise rotate 90°
head.SignalFormat String Range is {Inside, BT656, 720p, 1080p, 1080i, 1080sF}
Input Signal Mode
head.AntiFlicker integer Range is {0,1,2}
AntiFlicker mode:
0: Outdoor
1: 50 Hz AntiFlicker
2: 60 Hz AntiFlicker
head.GlareInhibition integer Range is [0-100]
GlareInhibition:
0: Close GlareInhibition.
head.NightOptions.BrightnessThreshold integer NightOptions contain a set of parameters used when brightness is not enough.
Range is [0-100]
when brightness is less than the BrightnessThreshold, parameters change to
Nightoptions.
head.NightOptions.IrisAuto bool true: IrisAuto
false: No IrisAuto
head.NightOptions.SunriseHour integer Range is [00-23]
Sunrise hour.
head.NightOptions.SunriseMinute integer Range is [00-59]
Sunrise minute
head.NightOptions.SunriseSecond integer Range is [00-59]
Sunrise second
head.NightOptions.SunsetHour integer Sunset time. Its range is same with sunrise time, and it should be after sunrise
head.NightOptions.SunsetMinute integer time.
head.NightOptions.SunsetSecond integer NightOptions are used if time is after sunset time and before sunrise time.
head.NightOptions.SwitchMode integer Range is {0,1,2}
0: NoSwitch,always use day options;
1: Switch depends on brightness;
2: Switch depends on time, switch to NightOptions when time is after sunset
time and before sunrise.
3: NoSwitch,always use NightOptions;
4:No switch,always use NormalOptions.
head.NightOptions.Profile integer Range is {0,1,2,3}
0: use temporary day options;
1: use temporary NightOptions;
2: use temporary NormalOptions;
3:depends on head.NightOptions.SwitchMode.
head.NightOptions.ExposureSpeed integer Range is the same as relevant items of day options in this table.
head.NightOptions.ExposureValue1 float Example:
head.NightOptions.ExposureValue2 float Value range of head.NightOptions.ExposureSpeed is the same with
head.NightOptions.Gain integer head. ExposureSpeed
21
head.NightOptions.GainAuto bool
head.NightOptions.GainBlue integer
head.NightOptions.GainGreen integer
head.NightOptions.GainRed integer
head.NightOptions.WhiteBalance String
head.NightOptions.ReferenceLevel integer
head.NightOptions.ExternalSyncPhase integer
head.NightOptions.AntiFlicker integer
head.NightOptions.Backlight integer
head.NightOptions.DayNightColor integer
head.NightOptions.ExposureMode integer
head.NightOptions.GlareInhibition integer
head.NightOptions.Mirror integer
head.NightOptions.Flip integer
head.NightOptions.Rotate90 integer
head.NomalOptions.BrightnessThreshold integer NomalOptions contain a set of parameters similar with NightOptions.
head.NormalOptions.IrisAuto bool Range is the same as relevant items of NightOptions in this table.
head.NormalOptions.SunriseHour integer
head.NormalOptions.SunriseMinute integer
head.NormalOptions.SunriseSecond integer
head.NormalOptions.SunsetHour integer
head.NormalOptions.SunsetMinute integer
head.NormalOptions.SunsetSecond integer
head.NormalOptions.ExposureSpeed integer
Head.NormalOptions.ExposureValue1 float
head.NormalOptions.ExposureValue2 float
head.NormalOptions.Gain integer
head.NormalOptions.GainAuto bool
head.NormalOptions.GainBlue integer
head.NormalOptions.GainGreen integer
head.NormalOptions.GainRed integer
head.NormalOptions.WhiteBalance String
head.NormalOptions.ReferenceLevel integer
head.NormalOptions.ExternalSyncPhase integer
head.NormalOptions.AntiFlicker integer
head.NormalOptions.Backlight integer
head.NormalOptions.DayNightColor integer
head.NormalOptions.ExposureMode integer
head.NormalOptions.GlareInhibition integer
head.NormalOptions.Mirror integer
head.NormalOptions.Flip integer
head.NormalOptions.Rotate90 integer
22
4.4VideoEncode
4.4.1 GetVideoConfigCaps
23
FPSMax integer Maximum FPS.
ResolutionTypes It contains all supported video resolutions.
string
Range is in 4.4.2 Resolution.
4.4.2 Resolution
4.4.3 GetVideoEncodeConfig
24
Response headMain.Video.BitRate=8192
headMain.Video.BitRateControl=CBR
headMain.Video.Compression=H.264
headMain.Video.FPS=25
headMain.Video.GOP=50
headMain.Video.Height=1200
headMain.Video.Profile=Main
headMain.Video.Quality=4
headMain.Video.Width=1600
headMain.VideoEnable=true
headExtra.Video.BitRate=8192
headExtra.Video.BitRateControl=CBR
headExtra.Video.Compression=H.264
headExtra.Video.FPS=25
headExtra.Video.GOP=50
headExtra.Video.Height=1200
headExtra.Video.Profile=Main
headExtra.Video.Quality=4
headExtra.Video.Width=1600
headExtra.VideoEnable=true
Comment Channel: video channel index
RecordType:
0 = regular record
1 = motion detection record
2 = alarm record
ExtraStream:
0 = extra stream 1
1 = extra stream 2
2 = extra stream 3
4.4.4 SetVideoEncodeConfig
25
ExtraStream:
0 = extra stream 1
1 = extra stream 2
2 = extra stream 3
4.5AudioEncode
4.5.1 GetAudioConfigCaps
26
caps[0].MainFormat[0].Audio.CompressionTypes=PCM,G.711A,G.711Mu
caps[0].MainFormat[1]…
…
4.5.2 GetAudioEncodeConfig
4.5.3 SetAudioEncodeConfig
4.6 SnapEncode
4.6.1 GetSnapConfigCaps
28
0 = regular snapshot
1 = motion detection snapshot
2 = alarm snapshot
Response caps[Channel].SnapFormat[SnapType].Video.CompressionTypes=H.264,MJPG
caps[Channel].SnapFormat[SnapType].Video.ResolutionTypes=3M,1080,SXGA,1_3M,720,D1,CIF
4.6.2 GetSnapEncodeConfig
4.6.3 SetSnapEncodeConfig
4.7ChannelTitle
4.7.1 GetChannelTitleConfig
30
4.7.2 SetChannelTitleConfig
4.8VideoStandard
4.8.1 GetVideoStandardConfig
4.8.2 SetVideoStandardConfig
4.9VideoWidget
4.9.1 GetVideoWidgetConfig
31
Response head.BackColor[0]=0
head.BackColor[1]=0
head.BackColor[2]=0
head.BackColor[3]=128
head.EncodeBlend=true
head.FrontColor[0]=255
head.FrontColor[1]=255
head.FrontColor[2]=255
head.FrontColor[3]=0
head.Rect[0]=0
head.Rect[1]=8191
head.Rect[2]=0
head.Rect[3]=8191
…
…
Comment Channel: video channel index
CoReg: Cover Region
Covers is an array which sustains multi- Cover regions
0 = region 1
1 = region 2
2 = region 3
3 = region 4
head=table.VideoWidget[Channel].ChannelTitle (or)
table.VideoWidget[Channel].Covers[CoReg] (or)
table.VideoWidget[Channel].TimeTitle
table.VideoWidget[Channel].CustomTitle[index]
4.9.2 SetVideoWidgetConfig
32
VideoWidgetConfig contains cover region settings, channel title settings and time title settings.
The italics below will be replaced by the above abbreviations.
Response OK or ERROR
33
headTimeTitle.Rect[2]
headTimeTitle.Rect[3]
headTimeTitle.ShowWeek bool True: Display week within the time title.
headCustomTitle.BackColor[0] integer Range is the same with headCover
headCustomTitle.BackColor[1]
headCustomTitle.BackColor[2]
headCustomTitle.BackColor[3]
headCustomTitle.EncodeBlend bool
headCustomTitle.FrontColor[0] integer
headCustomTitle.FrontColor[1]
headCustomTitle.FrontColor[2]
headCustomTitle.FrontColor[3]
headCustomTitle.Rect[0] integer Range is [0-8191].
headCustomTitle.Rect[1] Rect[0]:top left corner x coordinate (left)
headCustomTitle.Rect[2] Rect[1]:top left corner y coordinate (top)
headCustomTitle.Rect[3] Rect[2]:bottom right x coordinate (right)
Rect[3]:bottom right y coordinate (bottom).
PTZPreset.BackColor[0] integer Range is the same with headCover
PTZPreset.BackColor[1]
PTZPreset.BackColor[2]
PTZPreset.BackColor[3]
PTZPreset.EncodeBlend bool
PTZPreset.FrontColor[0] integer
PTZPreset.FrontColor[1]
PTZPreset.FrontColor[2]
PTZPreset.FrontColor[3]
PTZPreset.Rect[0] integer Range is [0-8191].
PTZPreset.Rect[1] Rect[0]:top left corner x coordinate (left)
PTZPreset.Rect[2] Rect[1]:top left corner y coordinate (top)
PTZPreset.Rect[3] Rect[2]:bottom right x coordinate (right)
Rect[3]:bottom right y coordinate (bottom).
4.10VideoOut
4.10.1 GetVideoOutConfig
34
head.Color.Brightness=50
head.Color. Contrast =50
head.Color. Satuation =50
head.Color. Hue =50
head.Mode. Width =800
head.Mode. Height=600
head.Mode. BPP =16
head.Mode. Format =”Auto”
head.Mode. RefreshRate =60…
…
Comment head = table.VideoOut[channel].
4.10.2 SetVideoOutConfig
4.11FlashLight
4.11.1 GetFlashLightConfig
35
head.TimeSection[0][0]=1 00:00:00-23:59:59
head.TimeSection[0][1]=0 00:00:00-23:59:59
…
head.TimeSection[6][5]=0 00:00:00-23:59:59
Comment head = table.FlashLight
4.11.2 SetFlashLightConfig
Example:
TimeSection[1][0]=1 12:00:00-18:00:00
Means flash light is effective between 12:00:00 and 18:00:00 at
Monday.
5.NetWork
5.1NetInterfaces
5.1.1 GetInterfaces
36
Name: network interface name.
“eth0” - wired network interface
“eth2” - wireless network interface
“3G” - 3G network interface
5.2BasicConfig
5.2.1 GetBasicConfig
5.2.2 SetBasicConfig
37
ParamName ParamValue type Description
NetWork.DefaultInterface string Set default network interface when multiple interfaces exist.
Range of interfaces is depends on 5.1.1 GetInterfaces
NetWork.Domain string Domain name.
NetWork.Hostname string Hostname and Domain compose a network address.
Network.interface.DefaultGateway string IP address
Network.interface.DhcpEnable bool Enable/Disable DHCP.
Network.interface.DnsServers[0] string IP address of first DNS server.
Network.interface.DnsServers[1] string IP address of second DNS server.
Network.interface.IPAddress string Interface IP address.
Network.interface.MTU integer Interface MTU.
Network.interface.PhysicalAddress string MAC address of interface.
HEX string in the form of:
xx:xx:xx:xx:xx:xx.
Range of x is [0-9,a-f,A-F]
Example:
00:10:5c:f2:1c:b4
00:10:5C:F2:1C:B5
Network.interface.SubnetMask string Network mask string:
In the form of x.x.x.x, range of x is [0-255]
Example:
255.255.255.0
5.3PPPoE
5.3.1 GetPPPoEConfig
5.3.2 SetPPPoEConfig
38
ParamName ParamValue type Description
PPPoE.Enable bool Enable/Disable PPPoE.
PPPoE.UserName string PPPoE user name.
PPPoE.Password string PPPoE user password.
5.4DDNS
5.4.1 GetDDNSConfig
5.4.2 SetDDNSConfig
39
DDNS[index].UserName string DDNS user name
5.5Email
5.5.1 GetEmailConfig
5.5.2 SetEmailConfig
5.6Wlan
5.6.1 GetWlanConfig
5.6.2 SetWlanConfig
41
ParamName ParamValue type Description
WLan.interface.Enable bool True: Enable WLan on this interface.
WLan.interface.Encryption string Range is {Off, On, WEP64Bits, WEP128Bits,
WPA-PSK-TKIP, WPA-PSK-CCMP}
Encryption mode.
WLan.interface.KeyFlag bool true: key is configured.
WLan.interface.KeyID integer Range is [0-3]
Indicates which key is used.
0 : WLan.interface.Keys[0] is used.
WLan.interface.KeyType string Range is {Hex, ASCII]
WLan.interface.Keys[0] string For ASCII key type: 64bits encryption key length is 5,
WLan.interface.Keys[1] string 128bits encryption key length is 13, consists of [0-9,
WLan.interface.Keys[2] string a-z, A-Z]
WLan.interface.Keys[3] string
For HEX key type: 64bits encryption key length is 10,
128bits encryption key length is 26, consists of [0-9,
a-z, A-Z]
WLan.interface.LinkMode string Range is {Auto, Ad-hoc, Infrastructure}.
Auto – select suitable mode automatically.
Ad-hoc – Device with wireless network adapter can
connect to each other without Access Point.
Infrastructure – Integrate wire and wireless LAN
together to share network resource, access point is
need in this mode.
WLan.interface.SSID string
5.6.3 ScanWlanDevices
42
ParamName ParamValue type Description
SSID string Specified SSID, if not include any SSID, all wifi
information will be searched and displayed.
5.7UPnP
5.7.1 GetUPnPConfig
5.7.2 SetUPnPConfig
5.7.3 GetUPnPStatus
43
Comment Get UPNP mapping result:
result=1: mapping succeed.
result=0: mapping failed.
Response rsult=1
5.8NTP
5.8.1 GetNTPConfig
5.8.2 SetNTPConfig
5.9RTSP
5.9.1 GetRTSPConfig
5.9.2 SetRTSPConfig
45
Comment
Response OK or ERROR
6.Events
6.1EventHandler
EventHandler is used in alarm and event config in following sections. It contains settings for actions linked with alarm and events. Actions
include record, snapshot, PTZ action, log, mail, alarm out and so on.When alarm or event happen, actions defined in alarm EventHandler and
event EventHandler are executed.
6.1.1 GetEventHandler
Example URL:
http://<ip>/cgi-bin/configManager.cgi?action=getConfig&name=Alarm[0].EventHandler
can get EventHandler settings of alarm channel 0.
Response
handlerName.EventHandler.AlarmOutChannels[0]=1
handlerName.EventHandler.AlarmOutChannels[1]=1
…
handlerName.EventHandler.AlarmOutEnable=false
handlerName.EventHandler.AlarmOutLatch=10
handlerName.EventHandler.BeepEnable=true
handlerName.EventHandler.Dejitter=0
handlerName.EventHandler.Delay=30
46
handlerName.EventHandler.LogEnable=true
handlerName.EventHandler.MailEnable=true
handlerName.EventHandler.PtzLink[0][0]=None
handlerName.EventHandler.PtzLink[0][1]=0
handlerName.EventHandler.PtzLink[1][0]=None
handlerName.EventHandler.PtzLink[1][1]=0
…
handlerName.EventHandler.PtzLinkEnable=false
handlerName.EventHandler.RecordChannels[0]=1
handlerName.EventHandler.RecordChannels[1]=1
…
handlerName.EventHandler.RecordEnable=true
handlerName.EventHandler.RecordLatch=10
handlerName.EventHandler.SnapshotChannels[0]=1
handlerName.EventHandler.SnapshotChannels[1]=1
…
handlerName.EventHandler.SnapshotEnable=false
handlerName.EventHandler.SnapshotPeriod=3
handlerName.EventHandler.SnapshotTimes=0
handlerName.EventHandler.TimeSection[0][0]=1 01:00:00-24:00:00
handlerName.EventHandler.TimeSection[0][1]=1 01:00:00-24:00:00
…
…
handlerName.EventHandler.TimeSection[6][5]=1 01:00:00-24:00:00
handlerName.EventHandler.TipEnable=true
handlerName.EventHandler. ExAlarmOutEnable=true
handlerName. ExAlarmOutChannels[0] =2
handlerName.ExAlarmOutChannels[1]=3
…
6.1.2 SetEventHandler
47
0 – do not output alarm at alarm out channel ch
1 – output alarm at alarm out channel ch
handlerName.EventHandler.AlarmOutEnable bool Enable/Disable alarm out function.
handlerName.EventHandler.AlarmOutLatch Integer Range is [10-300].
Unit is seconds, indicates the time to output alarm after input alarm is
cleared.
handlerName.EventHandler.BeepEnable bool Enable/Disable beep.
handlerName.EventHandler.Dejitter integer Range is [0-255].
Alarm signal dejitter seconds. Alarm signal change during this period is
ignored.
handlerName.EventHandler.Delay integer Range is [0-300].
Delay seconds before setting take effect.
handlerName.EventHandler.LogEnable bool Enable/Disable log for alarm.
handlerName.EventHandler.MailEnable bool Enable/Disable mail send for alarm.
handlerName.EventHandler.PtzLink[ch][0] string Range is {None, Preset, Tour, Pattern}
This is PTZ action linked with events. ch is PTZ channel index.
handlerName.EventHandler.PtzLink[ch][1] integer This is the parameter of PtzLink[ch][0],
If PtzLink[ch]][0] is
Preset: this is preset point.
Tour: this is tour path number.
Pattern: this is pattern number.
handlerName.EventHandler.PtzLinkEnable Bool Enable/Disable PTZ link.
handlerName.EventHandler.RecordChannels[ch] Integer Range is {0, 1}
0 – do not record on video channel ch
1 – record. on video channel ch
handlerName.EventHandler.RecordEnable bool Enable/Disable record function.
handlerName.EventHandler.RecordLatch integer Range is [10-300].
Unit is seconds, indicates the time to record after input alarm is cleared..
handlerName.EventHandler.SnapshotChannels[ch] integer Range is {0, 1}
0 – do not snapshot on video channel ch
1 – snapshot on video channel ch
handlerName.EventHandler.SnapshotEnable bool Enable/Disable snapshot function.
handlerName.EventHandler.SnapshotPeriod integer Range is [0-255].
Frames between snapshot.
0 means continuously snapshot for every frame.
handlerName.EventHandler.SnapshotTimes integer Range is [0-65535]
Snapshot times before stop, 0 means don’t stop snapshot.
handlerName.EventHandler.TimeSection[wd][ts] String It’s table contains effective time period for eventHanlder everyday.
wd (week day) range is [0-6] (Sunday-Staurday)
ts (time section) range is [0-23], it’s index of timesection table.
6.2Alarm
6.2.1 GetAlarmConfig
6.2.2 SetAlarmConfig
49
6.2.3 GetAlarmOutConfig
6.2.4 SetAlarmOutConfig
6.2.5 GetInSlots
6.2.6 GetOutSlots
50
6.2.7 GetInState
6.2.8 GetOutState
6.2.9 GetChannelInState
6.2.10 GetChannelOutState
6.3MotionDetect
6.3.1 GetMotionDetectConfig
51
Comment MotionDetect config of a video channel contains Enable, Level, Region and EventHandler.
Response table.MotionDetect[0].Enable=false
table.MotionDetect[0].EventHandler… (output of EventHandler is described in 6.1.1 GetEventHandler)
table.MotionDetect[0].Level=3
table.MotionDetect[0].Region[0]=3932160
table.MotionDetect[0].Region[1]=3932160
table.MotionDetect[0].MotionDetectWindow[0].Id=0
table.MotionDetect[0].MotionDetectWindow[0].Name=Region0
table.MotionDetect[0].MotionDetectWindow[0].Sensitive=58
table.MotionDetect[0].MotionDetectWindow[0].Threshold=4
table.MotionDetect[0].MotionDetectWindow[0].Region[0]=3932160
table.MotionDetect[0].MotionDetectWindow[0].Region[1]=3932160
…
…
table.MotionDetect[1]…
…
6.3.2 SetMotionDetectConfig
52
6: highest sensitivity.
6.4BlindDetect
6.4.1 GetBlindDetectConfig
6.4.2 SetBlindDetectConfig
53
ParamName ParamValue type Description
head.Enable bool Enable/Disable blind detect feature.
6.5LossDetect
6.5.1 GetLossDetectConfig
6.5.2 SetLossDetectConfig
6.6LoginFailureAlarm
6.6.1 GetLoginFailureAlarmConfig
54
6.6.2 SetLoginFailureAlarmConfig
6.7 StorageAbnormal
6.7.1 GetStorageNotExistConfig
6.7.2 SetStorageNotExistConfig
55
6.7.4 Set StorageFailureConfig
6.7.5 GetStorageLowSpaceConfig
6.7.6 SetStorageLowSpaceConfig
6.8 NetAbnormal
6.8.1 GetNetAbortConfig
56
6.8.2 SetNetAbortConfig
6.8.3 GetIPConflictConfig
6.8.4 SetIPConflictConfig
6.9 GetEventIndexes
57
Response channels[0]=0
channels[1]=2
channels[2]=3
…
(This response means event happened on channel 0, channel 2, and channel 3.)
6.10 Attach
For example:
HTTP Code: 200 OK\r\n
Cache-Control: no-cache\r\n
Pragma: no-cache\r\n
Expires: Thu, 01 Dec 2099 16:00:00 GMT\r\n
Connection: close\r\n
Content-Type: multipart/x-mixed-replace; boundary=myboundary\r\n\r\n
Body:
-- myboundary \r\n
Content-Type: text/plain\r\n
58
Content-Length: 39\r\n
Code=VideoMotion;action=Start;index=0\r\n\r\n
-- myboundary \r\n
Content-Type: text/plain\r\n
Content-Length: 38\r\n
Code=VideoBlind;action=Start;index=0\r\n\r\n
-- myboundary \r\n
Content-Type: text/plain\r\n
Content-Length: 38\r\n
Code= AlarmLocal;action=Start;index=0\r\n\r\n
-- myboundary \r\n
Content-Type: text/plain\r\n
Content-Length: 38\r\n
Code= MDResult;action=Pulse;index=0;data=61708863,61708863…\r\n\r\n
-- myboundary \r\n
…
7.PTZ
7.1PTZConfig
7.1.1 GetPTZConfig
7.1.2 SetPTZConfig
59
Response OK or ERROR
7.2PTZControl
7.2.1 GetProtocolList
7.2.2 GetCurrentProtocolCaps
61
7.2.3 PTZ control commands
63
this is tour path
LightController Control the light on/off. Address of light Light number switch 0
controller
PositionABS Go to ABS position Horizontal angle: Vertical Zoom in mutiple Speed[1-8], not
0°-360° angle :0°-90° must
PositionReset Use current direction as 0 0 0 0
reference.
UpTele up + TELE Speed [1-8] 0 0 0
DownTele down + TELE Speed [1-8] 0 0 0
LeftTele left + TELE Speed [1-8] 0 0 0
RightTele right + TELE Speed [1-8] 0 0 0
LeftUpTele leftup + TELE Speed [1-8] 0 0 0
LeftDownTele leftdown + TELE Speed [1-8] 0 0 0
RigjtUpTele rightup + TELE Speed [1-8] 0 0 0
RightDownTele rightdown + TELE Speed [1-8] 0 0 0
UpWide up + WIDE Speed [1-8] 0 0 0
DownWide down + WIDE Speed [1-8] 0 0 0
LeftWide left + WIDE Speed [1-8] 0 0 0
RightWide right + WIDE Speed [1-8] 0 0 0
LeftUpWide leftup + WIDE Speed [1-8] 0 0 0
LeftDownWide leftdown + WIDE Speed [1-8] 0 0 0
RightUpWide rightup + WIDE Speed [1-8] 0 0 0
RightDownWide rightdown + WIDE Speed [1-8] 0 0 0
Continuously Horizontal Speed Vertical Speed Zoom Speed [-8-8] Timeout
Move Continuously
[-8-8] [-8-8]
Relatively Relatively angle: Relatively Relatively Zoom
Move Relatively
0°-360° angle :0°-90°
7.3PTZStatus
64
8.Record&Snap
8.1Record
8.1.1 GetRecordConfig
8.1.2 SetRecordConfig
65
Bit3: card record
Example:
Set record time to every Sunday all day. Record type is motion detection and alarm.
URL should be:
http://<ip>/cgi-bin/configManager.cgi?action=setConfig&name=Record[0].TimeSection[0][0]&table=6 00:00:00-24:00:00
In this example, “6 00:00:00-24:00:00” means motion detection and alarm record all day (6 = 4 & 2, alarm is 4, motion detection is 2.).
8.1.3 GetRecordModeConfig
8.1.4 SetRecordModeConfig
8.2Snap
8.2.1 GetSnapConfig
66
8.2.2 SetSnapConfig
8.3MediaGlobal
8.3.1 GetMediaGlobalConfig
8.3.2 SetMediaGlobalConfig
67
MediaGlobal.SnapFormatAs string The range is {“MainFormat”, “ExtraFormat”}
8.4Holiday
8.4.1 GetHolidayConfig
8.4.2 SetHolidayConfig
68
9.System
9.1General
9.1.1 GetGeneralConfig
9.1.2 SetGeneralConfig
69
9.2SystemTime
9.2.1 GetCurrentTime
9.2.2 SetCurrentTime
9.3Locales
9.3.1 GetLocalesConfig
70
9.3.2 SetLocalesConfig
Example:
yyyy-MM-dd HH:mm:ss or
71
MM-dd-yyyy HH:mm:ss or
dd-M-yy hh:mm:ss
9.4Language
9.4.1 GetLanguageCaps
9.4.2 GetLanguageConfig
9.4.3 SetLanguageConfig
72
9.5AccessFilter
9.5.1 GetAccessFilterConfig
9.5.2 SetAccessFilterConfig
9.6AutoMaintain
9.6.1 GetAutoMaintainConfig
73
table.AutoMaintain. AutoShutdownHour=0
table.AutoMaintain. AutoShutdownMinute=0
table.AutoMaintain. AutoStartUpDay=1
table.AutoMaintain. AutoStartUpHour=2
table.AutoMaintain. AutoStartUpMinute=0
9.6.2 SetAutoMaintainConfig
9.7UserManager
9.7.1 Group
There are two user groups: “admin” and “user”. The “admin” group has all the authorities of operating the IP Camera. The “user” group
only has monitor and replay authorities.
74
9.7.2 GetGroupInfo
9.7.3 GetGroupInfoAll
9.7.4 AddUser
75
9.7.5 DeleteUser
9.7.6 ModifyUser
9.7.7 ModifyPassword
9.7.8 GetUserInfo
76
9.7.9 GetUserInfoAll
9.7.10 GetActiveUserInfoAll
9.8System Operation
9.8.1 Reboot
9.8.2 Shutdown
77
9.8.3 GetDeviceType
9.8.4 GetHardwareVersion
9.8.5 GetSerialNo
9.8.6 GetMachineName
9.8.7 GetSystemInfo
9.8.8 GetVendor
78
9.8.9 GetSoftwareVersion
9.8.10 GetOnvifVersion
9.9 Log
9.9.1 StartFind
Example:
Find log between 2011-1-1 12:00:00 and 2011-1-10 12:00:00, URL is:
http://<ip>/cgi-bin/log.cgi?action=startFind&condition.StartTime=2011-1-1 12:00:00
&condition.EndTime=2011-1-10 12:00:00
Response token=1
9.9.2 DoFind
79
items[1].RecNo=790
items[1].Time=2011-05-20 11:59:21
items[1].Type=SaveConfig
items[1].User=System
…
9.9.3 StopFind
9.9.4 Clear
9.10 UserGlobal
9.10.1 GetUserGlobalConfig
9.10.2 SetUserGlobalConfig
80
10.Storage
10.1.1 Create
10.1.2 StartFind
10.1.3 FindNextFile
10.1.4 Close
10.1.5 Destroy
82
Comment Destroy the media file finder.
Response OK or ERROR
10.2.1 GetStorageDeviceCollect
10.3.1 GetWorkGroupCollect
10.4.1 GetWorkDirectoryCollect
83
10.5 NAS
10.5.1 GetNASConfig
10.5.2 SetNASConfig
84
10.6 Storage Point
10.6.1 GetRecordStoragePointConfig
10.6.2 SetRecordStoragePointConfig
10.6.3 GetStorageGroupConfig
10.6.4 SetStorageGroupConfig
11.Audio
MIME Description
Audio/PCM
Audio/ADPCM
Audio/G.711A
Audio/G.711Mu
Audio/G.726
Audio/G.729
Audio/MPEG2
Audio/AMR
Audio/AAC
86
11.2 Post Audio
The RUL of transmit a singlepart、channel 1 audio stream(encoded with G.711 A-law) is:
http: //<ip>/cgi-bin/audio.cgi?action=postAudio&httptype=singlepart&channel=1
example:
POST /cgi-bin/audio.cgi?action=postAudio&httptype=singlepart&channel=1 HTTP/1.1
Content-Type: Audio/G.711A
Content-Length:9999999
<Audio data>
<Audio data>
The RUL of transmit a multipart、channel 1 audio stream(encoded with G.711 A-law) is:
http: //<ip>/cgi-bin/audio.cgi?action=postAudio&httptype= multipart &channel=1
example:
POST /cgi-bin/audio.cgi?action=postAudio&httptype= multipart &channel=1 HTTP/1.1
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
--<boundary>
Content-Type: Audio/G.711A
Content-Length: 800
<Audio data>
--<boundary>
87
11.3 Get Audio
The RUL of Request a singlepart、channel 1 audio stream(encoded with G.711 A-law) is:
http: //<ip>/cgi-bin/audio.cgi?action=getAudio&httptype=singlepart&channel=1
If the request was successful, the server returns a continuous flow of audio packets.The content type is only set at the beginning of the
connection.
Return:
HTTP Code: 200 OK
Content-Type: Audio/G.711A
Body:
<Audio data>
<Audio data>
The RUL of Request a multipart、channel 1 audio stream(encoded with G.711 A-law) is:
http: //<ip>/cgi-bin/audio.cgi?action=getAudio&httptype=multipart&channel=1
If the request was successful, the server returns a continuous flow of audio packets. The content type is “multipart/x-mixed-replace” and each
audio packet ends with a boundary string.
Return:
HTTP Code: 200 OK
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
--<boundary>
Content-Type: Audio/G.711A
Content-Length: 800
88
<Audio data>
--<boundary>
12.Appendix
The Stream format is used by 4.1.7 GetStream By Http and 4.1.8 Playback By Http, describes the format of the data stream.
Stream Header:
Byte
0 1 2 3 4 5 6 7
Order
Byte
8 9 10 11 12 13 14 15
Order
Extend header
Key channel Sequence
length
Byte
16 17 18 19 20 21 22 23
Order
Check
Key utc utcms reserved
sum
Flag=”DH”;
Type=0x10 means the audio packet;
Type=0x20 means the video packet;
Packet length means the packet total length, contains the packet header, maybe one or more extend header, and the media data;
Byte
0 1 2 3 4 5 6 …
Order
89
Byte
0 1 2 3 4 5 6 7
Order
Audio Sample
Key 0x11 8 reserved Tracks reserved
Type Freq
A audio packet must contain the audio extend header;
Audio Type:1 - PCM8;2 - G729;3 - IMA_ADPCM;4 - G711U;5 - G721;6 - PCM8_VWIS;7 - MS_ADPCM;8 - G711A;9 - AMR-NB;10 -
PCM16;11- G723.1;12 – AAC;13 - G726_40;14 - G726_32;15 - G726_24;16 - G726_16
Tracks: Tracks number, support 1 and 2;
Sample Freq: audio sample frequence,1 - 4000;2 - 8000;3 - 11025;4 - 16000;5 - 20000;6 - 22050;7 - 32000;8 - 44100;9 - 48000;
Byte
0 1 2 3 4 5 6 7
Order
Video Frame
Key 0x21 16 reserved Width
Type Type
Byte
8 9 10 11 12 13 14 15
Order
I Frame Frame
Key Height reserved
Interval Rate
A video packet must contain the video extend header; Video Type means the video codec type, 1-MPEG4; 2-H.264; Frame Type: 1-I frame;
2-P frame;3-B frame; Width and Height describe the frame width and height by pixel;
Byte
0 1 2 3 4 5 6 …
Order
Byte
0 1 2 3 4 5 6 7
Order
Daylight
Key 0x31 8 reserved Time Zone saving reserved
time
90
When a stream begin, or the TimeZone changes, the video packet must contain the TimeZone extend header; Time Zone[0]:
[-12,12](west time zone 12 to east time zone 12), Time Zone[1] modify the time by minutes; Daylight saving time: 1/0, yes or not in daylight
saving time;
Byte
0 1 2 3 4 5 6 …
Order
13.VedioInput
13.1 AdjustFocus
13.2 AdjustFocusContinuously
91
13.3 AutoFocus
13.4 GetFocusStatus
14. SD Camera
This chapter is only effective with SD Camera.
14.1 VideoInWhiteBalance
14.1.1 GetVideoInWhiteBalance
92
table.VideoInWhiteBalance[0][2].Mode=Auto
14.2.2 SetVideoInWhiteBalance
14.2 VideoInExposure
14.2.1 GetVideoInExposure
94
table.VideoInExposure[0][2].Value1=0.100000
table.VideoInExposure[0][2].Value2=80
table.VideoInExposure[0][2].WideDynamicRange=0
table.VideoInExposure[0][2].WideDynamicRangeMode=0
14.2.2 SetVideoInExposure
95
2:auto flash
head.RecoveryTime integer Range is {0,300,900, 3600, 7200}, Unit is second.
0:close
14.3 VideoInDenoise
14.3.1 GetVideoInDenoise
96
14.3.2 SetVideoInDenoise
14.4 VideoInDayNight
14.4.1 GetVideoInDayNight
97
14.4.2 SetVideoInDayNight
14.5 VideoInFocus
14.5.1 GetVideoInFocus
98
14.5.2 SetVideoInFocus
14.6 VideoInZoom
14.6.1 GetVideoInZoom
14.6.2 SetVideoInZoom
14.7 VideoInSharpness
14.7.1 GetVideoInSharpness
14.7.2 SetVideoInSharpness
100
14.8 VideoInColor
14.8.1 GetVideoInColor
14.8.2 SetVideoInColor
14.9 VideoInRotate
14.9.1 GetVideoInRotate
14.9.2 SetVideoInRotate
14.10 VideoInMode
14.10.1 GetVideoInMode
14.10.2 SetVideoInMode
Response OK or ERROR
15. VideoAnalyse
This chapter is only effective with smart IP Camera.
104
15.1 VideoAnalyseRule
15.1.1 GetVideoAnalyseRule
15.1.2 SetVideoAnalyseRule
105
106