Dahua HTTP Api All Cgis
Dahua HTTP Api All Cgis
Version 2.0
1
Document History
No Release Notes Date Version Author
draft 2015-8-24 2.0 Wenqiang Zhang
Combine the file DAHUA_HTTP_API_FOR_DVR.doc with the file
DAHUA_HTTP_API_FOR_IPC.doc, and make follow modifications:
th
1) The single CGI in the 18 chapter storageDevice is a repeat of
chapter 10.2.1. Delete the 18th chapter.
th
2) Both of the CGIs in the 19 chapter NetApp is a repeat of
1 th
chapter 5.1.1 and chapter 5.7.3. Delete the 19 chapter.
3) Modify the response of the CGI
“/cgi-bin/magicBox.cgi?action=getSoftwareVersion”. The
response must contain “version” and “build”. For example:
version=2.212.0000.0.R,build:2013-11-14
2
Preface
This document details the API of Dahua video products. Programmers can access and configure Dahua video products follow the APIs. This
document with version 1.10 is available with firmware version 2.608, 2.610 and above. This document with version 1.20, 1.21, 1.22, 1.23, 1.24
is available with firmware 2.616 and above.
Catalog
Document History ...................................................................................................................................................................................................... 2
Preface ....................................................................................................................................................................................................................... 3
Catalog ....................................................................................................................................................................................................................... 3
1 HTTP API Transaction ...................................................................................................................................................................................... 12
1.1 Transaction ................................................................................................................................................................................... 12
1.2 Format.......................................................................................................................................................................................... 13
1.3 Authentication ............................................................................................................................................................................. 13
1.4 Response ...................................................................................................................................................................................... 14
2 MediaStream ..................................................................................................................................................................................................14
2.1 Video............................................................................................................................................................................................ 14
2.1.1 GetMaxExtraStreamCounts ................................................................................................................................................ 14
2.1.2 GetRtspStream .................................................................................................................................................................... 15
2.1.3 RtspPlayback ....................................................................................................................................................................... 15
2.1.4 RtspPlayBack By Filename .................................................................................................................................................. 15
2.1.5 GetMjpgStream ..................................................................................................................................................................15
2.1.6 Download File ..................................................................................................................................................................... 16
2.1.7 Download File By Filename ................................................................................................................................................ 17
2.1.8 GetStream ........................................................................................................................................................................... 17
2.1.9 Playback .............................................................................................................................................................................. 17
2.2 Audio ............................................................................................................................................................................................ 18
2.2.1 Audio MIME type ................................................................................................................................................................ 19
2.2.2 Get Audio Input Channel .................................................................................................................................................... 19
2.2.3 Get Audio Output Channel ................................................................................................................................................. 19
2.2.4 Post Audio Stream .............................................................................................................................................................. 19
2.2.5 Get Audio Stream ............................................................................................................................................................... 20
2.3 Snapshot ...................................................................................................................................................................................... 21
2.3.1 GetSnapConfig .................................................................................................................................................................... 21
2.3.2 SetSnapConfig ..................................................................................................................................................................... 22
2.3.3 Manual Snapshot ................................................................................................................................................................ 22
2.3.4 Event Snapshot ...................................................................................................................................................................23
3 VideoAttributes .............................................................................................................................................................................................. 24
3.1 VideoColor ................................................................................................................................................................................... 24
3.1.1 GetVideoColorConfig .......................................................................................................................................................... 24
3.1.2 SetVideoColorConfig........................................................................................................................................................... 24
3.2 VideoEncode ................................................................................................................................................................................ 25
3.2.1 GetVideoConfigCaps ........................................................................................................................................................... 25
3.2.2 Resolution(翻译成英文) ..................................................................................................................................................... 26
3
3.2.3 GetVideoEncodeConfig ....................................................................................................................................................... 28
3.2.4 SetVideoEncodeConfig ....................................................................................................................................................... 28
3.2.5 GetCaps............................................................................................................................................................................... 30
3.3 AudioEncode ................................................................................................................................................................................ 30
3.3.1 GetAudioConfigCaps ........................................................................................................................................................... 30
3.3.2 GetAudioEncodeConfig ....................................................................................................................................................... 31
3.3.3 SetAudioEncodeConfig ....................................................................................................................................................... 32
3.4 SnapEncode ................................................................................................................................................................................. 33
3.4.1 GetSnapConfigCaps ............................................................................................................................................................ 33
3.4.2 GetSnapEncodeConfig ........................................................................................................................................................ 33
3.4.3 SetSnapEncodeConfig ......................................................................................................................................................... 34
3.5 ChannelTitle ................................................................................................................................................................................. 35
3.5.1 GetChannelTitleConfig........................................................................................................................................................ 35
3.5.2 SetChannelTitleConfig ........................................................................................................................................................ 35
3.6 ChannelNumber ........................................................................................................................................................................... 36
3.6.1 Get Video Input Channels ................................................................................................................................................... 36
3.7 VideoStandard ............................................................................................................................................................................. 36
3.7.1 GetVideoStandardConfig .................................................................................................................................................... 36
3.7.2 SetVideoStandardConfig ..................................................................................................................................................... 36
3.8 VideoWidget ................................................................................................................................................................................ 36
3.8.1 GetVideoWidgetConfig ....................................................................................................................................................... 36
3.8.2 SetVideoWidgetConfig ....................................................................................................................................................... 37
3.9 VideoInOptions ............................................................................................................................................................................ 39
3.9.1 GetVideoInputCaps ............................................................................................................................................................ 39
3.9.2 GetVideoInOptionsConfig ................................................................................................................................................... 42
3.9.3 SetVideoInOptionsConfig ................................................................................................................................................... 44
3.10 VideoInWhiteBalance ..................................................................................................................................................................49
3.10.1 SetVideoInWhiteBalance .................................................................................................................................................... 49
3.10.2 SetVideoInWhiteBalance .................................................................................................................................................... 49
3.11 VideoInFocus ............................................................................................................................................................................... 50
3.11.1 GetVideoInFocus ................................................................................................................................................................ 50
3.11.2 SetVideoInFocus .................................................................................................................................................................50
3.12 VideoInZoom ............................................................................................................................................................................... 51
3.12.1 GetVideoInZoom ................................................................................................................................................................ 51
3.12.2 SetVideoInZoom .................................................................................................................................................................51
3.13 VideoInSharpness ........................................................................................................................................................................ 52
3.13.1 GetVideoInSharpness ......................................................................................................................................................... 52
3.13.2 SetVideoInSharpness .......................................................................................................................................................... 52
3.14 VideoInRotate .............................................................................................................................................................................. 53
3.14.1 GetVideoInRotate ............................................................................................................................................................... 53
3.14.2 SetVideoInRotate ................................................................................................................................................................ 53
3.15 VideoInMode ............................................................................................................................................................................... 54
3.15.1 GetVideoInMode ................................................................................................................................................................ 54
3.15.2 SetVideoInMode .................................................................................................................................................................55
4 Flashlight ........................................................................................................................................................................................................ 56
4
4.1 FlashlightConfig ............................................................................................................................................................................ 56
4.1.1 GetFlashlightConfig ............................................................................................................................................................. 56
4.1.2 SetFlashlightConfig ............................................................................................................................................................. 56
5 Network .......................................................................................................................................................................................................... 57
5.1 Net Interfaces............................................................................................................................................................................... 57
5.1.1 GetInterfaces ...................................................................................................................................................................... 57
5.2 BasicNetworkConfig ..................................................................................................................................................................... 57
5.2.1 GetBasicNetworkConfig ...................................................................................................................................................... 57
5.2.2 SetBasicNetworkConfig....................................................................................................................................................... 58
5.3 PPPoE ........................................................................................................................................................................................... 59
5.3.1 GetPPPoEConfig ..................................................................................................................................................................59
5.3.2 SetPPPoEConfig...................................................................................................................................................................59
5.4 DDNS ............................................................................................................................................................................................ 59
5.4.1 GetDDNSConfig ...................................................................................................................................................................59
5.4.2 SetDDNSConfig ...................................................................................................................................................................60
5.5 Email ............................................................................................................................................................................................ 61
5.5.1 GetEmailConfig ...................................................................................................................................................................61
5.5.2 SetEmailConfig .................................................................................................................................................................... 61
5.6 Wlan ............................................................................................................................................................................................. 62
5.6.1 GetWlanConfig.................................................................................................................................................................... 62
5.6.2 SetWlanConfig .................................................................................................................................................................... 62
5.6.3 ScanWlanDevices ................................................................................................................................................................ 63
5.7 UPnP ............................................................................................................................................................................................ 64
5.7.1 GetUPnPConfig ...................................................................................................................................................................64
5.7.2 SetUPnPConfig .................................................................................................................................................................... 64
5.7.3 GetUPnPStatus.................................................................................................................................................................... 65
5.8 NTP............................................................................................................................................................................................... 65
5.8.1 GetNTPConfig ..................................................................................................................................................................... 65
5.8.2 SetNTPConfig ...................................................................................................................................................................... 66
5.9 RTSP ............................................................................................................................................................................................. 67
5.9.1 GetRTSPConfig .................................................................................................................................................................... 67
5.9.2 SetRTSPConfig ..................................................................................................................................................................... 67
5.10 Telnet ........................................................................................................................................................................................... 68
5.10.1 GetTelnetConfig ..................................................................................................................................................................68
5.10.2 SetTelnetConfig ...................................................................................................................................................................68
5.11 NetAlarmServer ........................................................................................................................................................................... 68
5.11.1 GetAlarmServerConfig ........................................................................................................................................................ 68
5.11.2 SetAlarmServerConfig ......................................................................................................................................................... 68
6 Alarm .............................................................................................................................................................................................................. 69
6.1 EventHandler ............................................................................................................................................................................... 69
6.1.1 GetEventHandler ................................................................................................................................................................ 69
6.1.2 SetEventHandler ................................................................................................................................................................. 70
6.2 Alarm ........................................................................................................................................................................................... 72
6.2.1 GetAlarmConfig .................................................................................................................................................................. 72
6.2.2 SetAlarmConfig ................................................................................................................................................................... 72
5
6.2.3 GetAlarmOutConfig ............................................................................................................................................................ 73
6.2.4 SetAlarmOutConfig ............................................................................................................................................................. 73
6.2.5 GetInSlots ........................................................................................................................................................................... 74
6.2.6 GetOutSlots......................................................................................................................................................................... 74
6.2.7 GetInState ........................................................................................................................................................................... 74
6.2.8 GetOutState ........................................................................................................................................................................ 74
6.3 MotionDetect ............................................................................................................................................................................... 74
6.3.1 GetMotionDetectConfig...................................................................................................................................................... 74
6.3.2 SetMotionDetectConfig ...................................................................................................................................................... 75
6.4 BlindDetect .................................................................................................................................................................................. 76
6.4.1 GetBlindDetectConfig ......................................................................................................................................................... 76
6.4.2 SetBlindDetectConfig .......................................................................................................................................................... 76
6.5 LossDetect ....................................................................................................................................................................................77
6.5.1 GetLossDetectConfig ..........................................................................................................................................................77
6.5.2 SetLossDetectConfig ...........................................................................................................................................................77
6.6 LoginFailureAlarm ........................................................................................................................................................................77
6.6.1 GetLoginFailureAlarmConfig ...............................................................................................................................................77
6.6.2 SetLoginFailureAlarmConfig ................................................................................................................................................ 78
6.7 StorageAbnormal ......................................................................................................................................................................... 78
6.7.1 GetStorageNotExistConfig .................................................................................................................................................. 78
6.7.2 SetStorageNotExistConfig ................................................................................................................................................... 78
6.7.3 Get StorageFailureConfig .................................................................................................................................................... 79
6.7.4 Set StorageFailureConfig ..................................................................................................................................................... 79
6.7.5 GetStorageLowSpaceConfig ................................................................................................................................................ 79
6.7.6 SetStorageLowSpaceConfig................................................................................................................................................. 79
6.8 NetAbnormal ............................................................................................................................................................................... 80
6.8.1 GetNetAbortConfig ............................................................................................................................................................. 80
6.8.2 SetNetAbortConfig .............................................................................................................................................................. 80
6.8.3 GetIPConflictConfig............................................................................................................................................................. 80
6.8.4 SetIPConflictConfig ............................................................................................................................................................. 80
6.9 GetEventIndexes .......................................................................................................................................................................... 81
6.10 Attach ........................................................................................................................................................................................... 81
6.11 GetCaps ........................................................................................................................................................................................ 83
7 PTZ .................................................................................................................................................................................................................. 83
7.1 PTZConfig ..................................................................................................................................................................................... 83
7.1.1 GetPTZConfig ...................................................................................................................................................................... 83
7.1.2 SetPTZConfig ....................................................................................................................................................................... 84
7.1.3 GetPtzAutoMovementConfig .............................................................................................................................................. 84
7.1.4 SetPtzAutoMovementConfig .............................................................................................................................................. 85
7.2 PTZControl.................................................................................................................................................................................... 86
7.2.1 GetProtocolList ...................................................................................................................................................................86
7.2.2 GetCurrentProtocolCaps ..................................................................................................................................................... 86
7.2.3 PTZ control commands ....................................................................................................................................................... 87
7.3 PTZStatus ..................................................................................................................................................................................... 90
7.3.1 PTZ GetStatus...................................................................................................................................................................... 90
6
8 Record ............................................................................................................................................................................................................ 90
8.1 RecordManager ........................................................................................................................................................................... 90
8.1.1 GetCaps............................................................................................................................................................................... 90
8.2 Record .......................................................................................................................................................................................... 91
8.2.1 GetRecordConfig .................................................................................................................................................................91
8.2.2 SetRecordConfig .................................................................................................................................................................91
8.2.3 GetRecordModeConfig ....................................................................................................................................................... 92
8.2.4 SetRecordModeConfig ........................................................................................................................................................ 92
8.3 Record MediaGlobal..................................................................................................................................................................... 93
8.3.1 GetMediaGlobalConfig ....................................................................................................................................................... 93
8.3.2 SetMediaGlobalConfig ........................................................................................................................................................ 93
9 System ............................................................................................................................................................................................................ 93
9.1 General......................................................................................................................................................................................... 93
9.1.1 GetGeneralConfig ............................................................................................................................................................... 93
9.1.2 SetGeneralConfig ................................................................................................................................................................ 94
9.2 SystemTime ................................................................................................................................................................................. 94
9.2.1 GetCurrentTime ..................................................................................................................................................................94
9.2.2 SetCurrentTime ..................................................................................................................................................................94
9.3 Locales ......................................................................................................................................................................................... 94
9.3.1 GetLocalesConfig ................................................................................................................................................................ 94
9.3.2 SetLocalesConfig .................................................................................................................................................................95
9.4 Language ...................................................................................................................................................................................... 96
9.4.1 GetLanguageCaps ............................................................................................................................................................... 96
9.4.2 GetLanguageConfig ............................................................................................................................................................. 96
9.4.3 SetLanguageConfig ............................................................................................................................................................. 97
9.5 AccessFilter .................................................................................................................................................................................. 97
9.5.1 GetAccessFilterConfig ......................................................................................................................................................... 97
9.5.2 SetAccessFilterConfig .......................................................................................................................................................... 97
9.6 AutoMaintain ............................................................................................................................................................................... 98
9.6.1 GetAutoMaintainConfig ...................................................................................................................................................... 98
9.6.2 SetAutoMaintainConfig....................................................................................................................................................... 98
9.7 UserManager ............................................................................................................................................................................... 99
9.7.1 Group .................................................................................................................................................................................. 99
9.7.2 GetGroupInfo ...................................................................................................................................................................... 99
9.7.3 GetGroupInfoAll ................................................................................................................................................................ 100
9.7.4 AddUser ............................................................................................................................................................................ 100
9.7.5 DeleteUser ........................................................................................................................................................................ 100
9.7.6 ModifyUser ....................................................................................................................................................................... 101
9.7.7 ModifyPassword ............................................................................................................................................................... 101
9.7.8 GetUserInfo ....................................................................................................................................................................... 101
9.7.9 GetUserInfoAll................................................................................................................................................................... 101
9.7.10 GetActiveUserInfoAll ......................................................................................................................................................... 102
9.8 System Operation ....................................................................................................................................................................... 102
9.8.1 Reboot .............................................................................................................................................................................. 102
9.8.2 Shutdown.......................................................................................................................................................................... 102
7
9.8.3 GetDeviceType .................................................................................................................................................................. 103
9.8.4 GetHardwareVersion......................................................................................................................................................... 103
9.8.5 GetSerialNo ....................................................................................................................................................................... 103
9.8.6 GetMachineName ............................................................................................................................................................. 103
9.8.7 GetSystemInfo .................................................................................................................................................................. 103
9.8.8 GetVendor......................................................................................................................................................................... 104
9.8.9 GetSoftwareVersion .......................................................................................................................................................... 104
9.8.10 GetBuildDate .................................................................................................................................................................... 104
9.8.11 GetCGIVersion ................................................................................................................................................................... 104
9.8.12 GetOnvifVersion ................................................................................................................................................................ 104
9.8.13 GetDeviceClass .................................................................................................................................................................104
9.9 Log.............................................................................................................................................................................................. 105
9.9.1 StartFind ........................................................................................................................................................................... 105
9.9.2 DoFind .............................................................................................................................................................................. 105
9.9.3 StopFind ............................................................................................................................................................................ 106
9.9.4 Clear .................................................................................................................................................................................. 106
9.10 OnvifLoginCheck ........................................................................................................................................................................ 106
9.10.1 GetOnvifLoginCheckConfig ............................................................................................................................................... 106
9.10.2 SetOnvifLoginCheckConfig ................................................................................................................................................ 106
9.11 ConfigRestore ............................................................................................................................................................................. 107
9.11.1 Restore .............................................................................................................................................................................. 107
9.11.2 RestoreExcept ................................................................................................................................................................... 107
9.12 Holiday ....................................................................................................................................................................................... 107
9.12.1 GetHolidayConfig .............................................................................................................................................................. 107
9.12.2 SetHolidayConfig............................................................................................................................................................... 108
10 Storage ......................................................................................................................................................................................................... 108
10.1 FileFinding ................................................................................................................................................................................. 108
10.1.1 Create ............................................................................................................................................................................... 108
10.1.2 StartFind ........................................................................................................................................................................... 109
10.1.3 FindNextFile...................................................................................................................................................................... 109
10.1.4 Close ................................................................................................................................................................................. 110
10.1.5 Destroy.............................................................................................................................................................................. 110
10.2 Storage Device ........................................................................................................................................................................... 110
10.2.1 GetStorageDevicePortInfo ................................................................................................................................................ 110
10.2.2 GetStorageDeviceNames .................................................................................................................................................. 111
10.2.3 GetDeviceAllInfo ............................................................................................................................................................... 111
10.2.4 GetCaps............................................................................................................................................................................. 111
10.3 Work Group................................................................................................................................................................................ 112
10.3.1 GetWorkGroupCollect....................................................................................................................................................... 112
10.4 Work Directory ........................................................................................................................................................................... 112
10.4.1 GetWorkDirectoryCollect .................................................................................................................................................. 112
10.5 NAS ............................................................................................................................................................................................ 112
10.5.1 GetNASConfig ................................................................................................................................................................... 112
10.5.2 SetNASConfig .................................................................................................................................................................... 113
10.6 Storage Point .............................................................................................................................................................................. 113
8
10.6.1 GetRecordStoragePointConfig .......................................................................................................................................... 113
10.6.2 SetRecordStoragePointConfig ........................................................................................................................................... 114
10.6.3 GetStorageGroupConfig .................................................................................................................................................... 114
10.6.4 SetStorageGroupConfig .................................................................................................................................................... 114
11 Display .......................................................................................................................................................................................................... 115
11.1 GUIConfig ................................................................................................................................................................................... 115
11.1.1 GetGUIConfig .................................................................................................................................................................... 115
11.1.2 SetGUIConfig..................................................................................................................................................................... 116
11.2 Split ............................................................................................................................................................................................ 116
11.2.1 GetSplitMode .................................................................................................................................................................... 116
11.2.2 SetSplitMode .................................................................................................................................................................... 117
11.3 Monitor Tour .............................................................................................................................................................................. 117
11.3.1 EnableMonitorTour ........................................................................................................................................................... 117
11.3.2 GetMonitorTourConfig ...................................................................................................................................................... 117
11.3.3 SetMonitorTourConfig ...................................................................................................................................................... 118
11.4 Monitor Collect .......................................................................................................................................................................... 118
11.4.1 GetMonitorCollectionConfig ............................................................................................................................................. 118
11.4.2 SetMonitorCollectionConfig ............................................................................................................................................. 118
11.5 VideoOut.................................................................................................................................................................................... 119
11.5.1 GetVideoOutConfig .......................................................................................................................................................... 119
11.5.2 SetVideoOutConfig ........................................................................................................................................................... 120
12 VideoFocus ................................................................................................................................................................................................... 120
12.1 AdjustFocus ................................................................................................................................................................................ 120
12.2 AdjustFocusContinuously ........................................................................................................................................................... 121
12.3 AutoFocus .................................................................................................................................................................................. 121
12.4 GetFocusStatus .......................................................................................................................................................................... 121
12.5 getCurrentWindow .................................................................................................................................................................... 122
12.6 setCurrentWindow .................................................................................................................................................................... 122
13 Backup .......................................................................................................................................................................................................... 123
13.1 ConfigBackup ............................................................................................................................................................................. 123
13.2 LogBackup .................................................................................................................................................................................. 123
14 AccessControl ............................................................................................................................................................................................... 125
14.1 OpenDoor .................................................................................................................................................................................. 125
14.2 GetDoorStatus ........................................................................................................................................................................... 125
14.3 AccessControlCard ..................................................................................................................................................................... 125
14.3.1 find .................................................................................................................................................................................... 125
14.3.2 update............................................................................................................................................................................... 126
14.3.3 insert ................................................................................................................................................................................. 127
14.3.4 remove .............................................................................................................................................................................. 127
14.3.5 getQuerySize ..................................................................................................................................................................... 127
14.4 AccessControlCardRec ................................................................................................................................................................ 128
14.4.1 find .................................................................................................................................................................................... 128
14.5 Announcement .......................................................................................................................................................................... 129
14.5.1 insert ................................................................................................................................................................................. 129
14.6 VideoTalkLog .............................................................................................................................................................................. 129
9
14.6.1 find .................................................................................................................................................................................... 129
14.7 AlarmRecord .............................................................................................................................................................................. 130
14.7.1 find .................................................................................................................................................................................... 130
15 DeviceDiscovery ........................................................................................................................................................................................... 131
15.1 DeviceDiscovery ......................................................................................................................................................................... 131
16 VideoAnalyse................................................................................................................................................................................................ 131
16.1 GetCaps ...................................................................................................................................................................................... 132
16.1.1 GetCaps............................................................................................................................................................................. 132
16.2 VideoAnalyseRule ...................................................................................................................................................................... 132
16.2.1 GetVideoAnalyseRule ....................................................................................................................................................... 132
16.2.2 SetVideoAnalyseRule ........................................................................................................................................................ 133
16.3 VideoWidgetNumberStat .......................................................................................................................................................... 134
16.3.1 GetVideoWidgetNumberStat ........................................................................................................................................... 134
16.3.2 SetVideoWidgetNumberStat ............................................................................................................................................ 134
16.4 VideoEncodeROI ........................................................................................................................................................................ 135
16.4.1 GetVideoEncodeROI ......................................................................................................................................................... 135
16.4.2 SetVideoEncodeROI .......................................................................................................................................................... 135
16.5 VideoStatServer ......................................................................................................................................................................... 136
16.5.1 GetSummary ..................................................................................................................................................................... 136
16.5.2 StartFind ........................................................................................................................................................................... 136
16.5.3 DoFind .............................................................................................................................................................................. 137
16.5.4 StopFind ............................................................................................................................................................................ 137
17 Traffic ............................................................................................................................................................................................................ 139
17.1 TrafficSnap ................................................................................................................................................................................. 139
17.1.1 GetParkingSpaceStatus ..................................................................................................................................................... 139
17.2 TrafficParking ............................................................................................................................................................................. 139
17.2.1 GetAllParkingSpaceStatus ................................................................................................................................................. 139
18 Radiometry ................................................................................................................................................................................................... 141
18.1 RadioMetry Config ..................................................................................................................................................................... 141
18.1.1 GetHeatImagingThermometryConfig ............................................................................................................................... 141
18.1.2 SetHeatImagingThermometryConfig ................................................................................................................................ 141
18.1.3 GetThermometryRuleConfig ............................................................................................................................................. 142
18.1.4 SetThermometryRuleConfig ............................................................................................................................................. 143
18.1.5 GetHeatImagingTemperConfig.......................................................................................................................................... 144
18.1.6 SetHeatImagingTemperConfig .......................................................................................................................................... 144
18.2 GetCaps ...................................................................................................................................................................................... 145
18.3 GetRandomPointTemper............................................................................................................................................................ 146
18.4 GetTemper ................................................................................................................................................................................. 146
19 Thermography .............................................................................................................................................................................................. 147
19.1 Thermography Config................................................................................................................................................................. 147
19.1.1 GetThermographyOptionsConfig ...................................................................................................................................... 147
19.1.2 SetThermographyOptionsConfig....................................................................................................................................... 148
19.2 GetExternSystemInfo .................................................................................................................................................................149
19.3 GetPresetParam ......................................................................................................................................................................... 149
19.4 GetCaps ...................................................................................................................................................................................... 150
10
19.5 GetOptimizedRegion .................................................................................................................................................................. 151
19.6 EnableShutter ............................................................................................................................................................................ 151
20 HeatMap ....................................................................................................................................................................................................... 152
20.1 GetPicByTime............................................................................................................................................................................. 152
21 VideoTalkPeer............................................................................................................................................................................................... 152
21.1 attachState ................................................................................................................................................................................. 152
21.2 detachState ................................................................................................................................................................................ 153
21.3 invite .......................................................................................................................................................................................... 153
21.4 cancel ......................................................................................................................................................................................... 154
21.5 answer ....................................................................................................................................................................................... 154
21.6 refuse ......................................................................................................................................................................................... 155
21.7 hangup ....................................................................................................................................................................................... 155
22 Abandoned APIs ........................................................................................................................................................................................... 155
22.1 Get Video Detect Caps ............................................................................................................................................................... 155
22.2 GetChannelInState ..................................................................................................................................................................... 156
22.3 GetChannelOutState .................................................................................................................................................................. 156
22.4 GetUUID ..................................................................................................................................................................................... 156
22.5 SetStorageDevice ....................................................................................................................................................................... 156
23 Appendix ...................................................................................................................................................................................................... 157
23.1 Stream Format ........................................................................................................................................................................... 157
23.2 Extend Header Format ............................................................................................................................................................... 158
23.2.1 Audio extend header ........................................................................................................................................................ 158
23.2.2 Video Extend Header: ....................................................................................................................................................... 158
23.2.3 Channel Title Extend Header: ........................................................................................................................................... 159
23.2.4 TimeZone Extend Header: ................................................................................................................................................ 159
23.2.5 Event Flag Extend Header: ................................................................................................................................................ 159
11
1 HTTP API Transaction
1.1 Transaction
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, and then sends 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 an integer
not less than 0 and not larger than 100. “{0, 1, 2, 3}” denotes the valid value of an integer among 0, 1, 2 and 3.
4. In the request and response, we use “[]” to denote an array. The index is usually an integer and start form 0.
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 Video Color 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
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
12
1.2 Format
Params in Resp :
the range of table.MaxExtraStream is {1,2,3}
URL Syntax: the format of the CGI. The variable is between "<" and ">", and unnecessary params are between "[" and "]". We also use “[]” to
denote an array.
Description: the function explanation of the CGI, and a real example if there is any variable in the CGI.
Response: example of response for the CGI.
Comment: the comments of the CGI. “Params in URL” is followed by comments of params in URL Syntax and “Params in Resp” is followed by
comments of params in the Response. The comments contain type of params, range of params, explanations of abbreviations and so on.
1.3 Authentication
The Dahua video product supplies two authentication ways: basic authentication and digest authentication. If the http request does not
have a legal “Authorization”, the Dahua video product returns 401, requiring an authentication of the http request.
For example:
1. When basic authentication, the Dahua video product response:
401 Unauthorized
WWW-Authenticate: Basic realm=”XXXXXX”
Then the client encodes the username and password with base64, and then sends the following authorization with 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, qop and URI with MD5, and then sends the following
authorization with request:
Authorization: Digest username="admin", realm="DH_00408CA5EA04", nc=00000001, cnonce="0a4f113b", qop="auth",
nonce="000562fdY631973ef04f77a3ede7c1832ff48720ef95ad", uri="/cgi-bin/magicBox.cgi?action=getLanguageCaps",
response="65002de02df697e946b750590b44f8bf"
13
1.4 Response
2 MediaStream
Camera API allows application to configure and view Dahua video product settings.
2.1 Video
2.1.1 GetMaxExtraStreamCounts
14
2.1.2 GetRtspStream
2.1.3 RtspPlayback
2.1.5 GetMjpgStream
15
To get a video stream of channel 1, main stream, the URL can be
http://192.168.1.108/cgi-bin/mjpg/video.cgi
or
http://192.168.1.108/cgi-bin/mjpg/video.cgi?channel=1&subtype=0
Response video stream encoded by MJPG.
Return:
HTTP Code:200 OK
Content-Type: multipart/x-mixed-replace; boundary=<boundary>
Body:
--<boundary>
Content-Type: image/jpeg
Content-Length:<image size>
16
2.1.7 Download File By Filename
URL Syntax http://<ip>/cgi-bin/RPC_Loadfile/<filename>
Description Download a file by filename.
Example:
http://192.168.1.108/cgi-bin/RPC_Loadfile/2012_09_15_12_37_05:2012_09_15_18_34_14[0][0].dav
Response HTTP Code: 200 OK
Content-Type: Application/octet-stream
Content-Length:<fileLength>
Body:
<data>
<data>
Comment Params in URL:
filename: name of media files which would be downloaded
2.1.8 GetStream
2.1.9 Playback
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”.
2.2 Audio
18
2.2.1 Audio MIME type
MIME Description
Audio/PCM
Audio/ADPCM
Audio/G.711A
Audio/G.711Mu
Audio/G.726
Audio/G.729
Audio/MPEG2
Audio/AMR
Audio/AAC
example:
POST /cgi-bin/audio.cgi?action=postAudio&httptype=singlepart&channel=1 HTTP/1.1
Content-Type: Audio/G.711A
Content-Length:9999999
19
<Audio data>
<Audio data>
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>
Response OK or Error
Comment Params in URL:
The paramName and paramValue are in the below table.
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>
20
Example for multipart
The URL of Request a multipart、channel 1 audio stream(encoded with G.711 A-law) is:
http: //192.168.1.108/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
<Audio data>
--<boundary>
Response OK or Error
Comment Params in URL:
The paramName and paramValue are in the below table.
2.3 Snapshot
2.3.1 GetSnapConfig
21
table. Snap[channel].TimeSection[weekday][4]=0 05:00:00-24:00:00
table. Snap[channel].TimeSection[weekday][5]=0 06:00:00-24:00:00
Comment Params in Resp:
Channel is video channel number, weekday range is [0-6] (Sunday - Saturday).
2.3.2 SetSnapConfig
eventCode includes:
VideoMotion: motion detection event
VideoLoss: video loss detection event
VideoBlind: video blind detection event.
AlarmLocal: alarm detection event.
23
3 VideoAttributes
3.1 VideoColor
3.1.1 GetVideoColorConfig
3.1.2 SetVideoColorConfig
24
head. Saturation integer Saturation
head. TimeSection string Effective time for this video color config.
Format is: mask starttime endtime
Mask range is {0, 1}.
Mask 0 – this video config is not effective
Mask 1 - this config is effective
Starttime/Endtime format like 11:00:00.
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
head.NightOptions.ExposureValue1 float
head.NightOptions.ExposureValue2 float
head.NightOptions.Gain integer
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
3.2 VideoEncode
3.2.1 GetVideoConfigCaps
25
Params in Resp:
headMain= caps[Channel].MainFormat[RecordType]
headExtra = caps[Channel].ExtraFormat[ExtraStream]
headSnap = caps[Channel].SnapFormat[SnapType]
3.2.2 Resolution(翻译成英文)
26
"QVGA" 320 x 240
"SVCD" 480 x 480
"QQVGA" 160 x 128
"SVGA" 800 x 592
"SVGA1" 800 x 600
"WVGA" 800 x 480
"FWVGA" 854 x 480
"DVGA" 960 x 640
"XVGA" 1024 x 768
"WXGA" 1280 x 800
"WXGA2" 1280 x 768
"WXGA3" 1280 x 854
"WXGA4" 1366 x 768
"SXGA" 1280 x 1024
"SXGA+" 1400 x 1050
"WSXGA" 1600 x 1024
"UXGA" 1600 x 1200
"WUXGA" 1920 x 1200
"ND1" 240 x 192
"720P" 1280 x 720
"1080P" 1920 x 1080
"QFHD" 3840 x 2160
"1_3M", "1280x960" 1280 x 960 (1.3 Mega Pixels)
"2_5M", "1872x1408" 1872 x 1408 (2.5 Mega Pixels)
"5M", "3744x1408" 3744 x 1408 (5 Mega Pixels)
"3M", "2048x1536" 2048 x 1536 (3 Mega Pixels)
"5_0M", "2432x2048" 2432 x 2048 (5 Mega Pixels)
"1_2M", "1216x1024" 1216 x 1024 (1.2 Mega Pixels)
"1408x1024" 1408 x 1024 (1.5 Mega Pixels)
"3296x2472" 3296 x 2472 (8 Mega Pixels)
"5_1M", "2560x1920" 2560 x 1920 (5 Mega Pixels)
"960H", 960 x 576 960 x 480
"DV720P" 960 x 720
"2560x1600" 2560 x 1600 (4 Mega Pixels)
"2336x1752" 2336 x 1752 (4 Mega Pixels)
"2592x2048" 2592 x 2048
"2448x2048" 2448 x 2048
"1920x1440" 1920x1440
"2752x2208" 2752x2208
"3840x2160" 3840x2160
"4096x2160" 4096x2160
"3072x2048" 3072x2048
27
3.2.3 GetVideoEncodeConfig
3.2.4 SetVideoEncodeConfig
29
3.2.5 GetCaps
Comment
3.3 AudioEncode
3.3.1 GetAudioConfigCaps
3.3.2 GetAudioEncodeConfig
31
2 = extra stream 3
3.3.3 SetAudioEncodeConfig
32
3.4 SnapEncode
3.4.1 GetSnapConfigCaps
3.4.2 GetSnapEncodeConfig
3.4.3 SetSnapEncodeConfig
34
Frames per second.
< 1.0: several seconds/frame, FPS=0.3333: 3 seconds per frame.
>1.0: several frames/second. FPS=3: 3 frames per second.
head.Video.GOP integer Range is [1-100].
Group of picture, it’s the interval of I Frame,
Example: GOP=50, means there is one I frame every 49 P or B frames
head.Video.Height integer Video height
head.Video.Width integer Video Width
head.Video.Quality integer Range is [1-6].
Image Quality, available when Video.BitRateControl=VBR
1: worst quality
6: best quality
head.VideoEnable bool True: enable video
3.5 ChannelTitle
3.5.1 GetChannelTitleConfig
3.5.2 SetChannelTitleConfig
Params in URL:
In below table,
Channel : video channel index
35
3.6 ChannelNumber
3.7 VideoStandard
3.7.1 GetVideoStandardConfig
3.7.2 SetVideoStandardConfig
3.8 VideoWidget
3.8.1 GetVideoWidgetConfig
36
and positions of channel title and time title, and defines the regions which are not visible (cover).
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 Params in Resp:
head=table.VideoWidget[Channel].ChannelTitle (or)
table.VideoWidget[Channel].Covers[CoReg] (or)
table.VideoWidget[Channel].TimeTitle
3.8.2 SetVideoWidgetConfig
37
headTimeTitle = VideoWidget[Channel].TimeTitle
38
headTimeTitle.FrontColor[0] integer
headTimeTitle.FrontColor[1]
headTimeTitle.FrontColor[2]
headTimeTitle.FrontColor[3]
headTimeTitle.Rect[0] integer
headTimeTitle.Rect[1]
headTimeTitle.Rect[2]
headTimeTitle.Rect[3]
headTimeTitle.ShowWeek bool True: Display week within the time title.
3.9 VideoInOptions
3.9.1 GetVideoInputCaps
40
caps. VideoInDenoise.Support=true
caps. WhiteBalance=3
caps. WideDynamicRange=1
Comment Params in URL:
channelNo: video channel index
Params in Resp:
see below table
41
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}
3.9.2 GetVideoInOptionsConfig
42
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
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
43
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
Comment Params in Resp:
head = table.VideoInOptions[ChannelNo]
ChannelNo = video channel index.
3.9.3 SetVideoInOptionsConfig
URL http://<ip>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramValue>[&<paramName>=<paramValue>...]
Synt
ax
Desc Set Video In Options config, including Backlight, ExposureSpeed, DayNightColor, DayOptions, NightOptions, NormalOptions and so on
ripti For example:
on Auto Exposure:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].ExposureMode=0&VideoInOptions[0].Exposure
Speed=0
Low Noise:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].ExposureMode=1&VideoInOptions[0].Exposure
Speed=0&VideoInOptions[0].GainMin=0&VideoInOptions[0].GainMax=60
Low Motion Blur:
44
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].ExposureMode=2&VideoInOptions[0].Exposure
Speed=0&VideoInOptions[0].GainMin=0&VideoInOptions[0].GainMax=50&VideoInOptions[0].ExposureValue1=0&VideoInOptions[0].E
xposureValue2=20
Manual:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[0].ExposureMode=4&VideoInOptions[0].Exposure
Speed=32&VideoInOptions[0].GainMin=0&VideoInOptions[0].GainMax=50&VideoInOptions[0].ExposureValue1=40&
VideoInOptions[0].ExposureValue2=40
Resp OK or Error
onse
Com Params in URL:
ment In below table, head =VideoInOptions[ChannelNo]
ChannelNo = video channel index.
45
1: External Synchronous
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.
46
head. Rotate90 integer Range is {0,1,2}
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
47
head. NightOptions.Gain integer head. ExposureSpeed
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. integer NomalOptions contain a set of parameters similar with NightOptions.
NomalOptions.BrightnessThreshold Range is the same as relevant items of NightOptions in this table.
head. NormalOptions.IrisAuto bool
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
48
3.10 VideoInWhiteBalance
3.10.1 SetVideoInWhiteBalance
3.10.2 SetVideoInWhiteBalance
3.11 VideoInFocus
3.11.1 GetVideoInFocus
Comment
3.11.2 SetVideoInFocus
50
ParamName ParamValue Description
type
head. Mode integer 2-Auto focus, 3-Half auto focus, 4-Manual focus
head. FocusLimit integer 100、1000、2000、3000、5000、
head. Sensitivity integer Range is 0,1,2
0-high,1-default,2-low
head. IRCorrection integer 0: No correction; 1: Correction; 2: Auto correction
head. FocusLimitSelectMode Manual or Auto
3.12 VideoInZoom
3.12.1 GetVideoInZoom
3.12.2 SetVideoInZoom
URL http://<ip>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramValue>[&<paramName>=<paramValue>...]
Syntax
Descriptio Set video input zoom config.
n Example:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInZoom[0][0].DigitalZoom=false&VideoInZoom[0][0].Sp
eed=8
Response OK or Error
Comment Params in URL:
head = VideoInZoom [ChannelNo] [ConfigNo]
ChannelNo: integer, array index which equals to video channel index -1, starts from 0.
ConfigNo: array index, can be 0,1 or 2, which means normal, day and night.
3.13 VideoInSharpness
3.13.1 GetVideoInSharpness
3.13.2 SetVideoInSharpness
URL http://<ip>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramValue>[&<paramName>=<paramValue>...]
Syntax
Descript Set Video Input Sharpness settings.
ion Example:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoInSharpness[0][0].Level=10&VideoInSharpness[0][0].Mod
e=1&VideoInSharpness[0][0].Sharpness=0
Respons OK or Error
e
Comme Params in URL:
nt paramName and paramValue are as below table.
In below table,
head = VideoInSharpness [ChannelNo] [ConfigNo]
ChannelNo: integer, array index which equals to video channel index -1, starts from 0.
ConfigNo: array index, can be 0,1 or 2, which means normal, day and night.
3.14 VideoInRotate
3.14.1 GetVideoInRotate
Comment
3.14.2 SetVideoInRotate
3.15 VideoInMode
3.15.1 GetVideoInMode
Comment
3.15.2 SetVideoInMode
55
4 Flashlight
4.1 FlashlightConfig
4.1.1 GetFlashlightConfig
4.1.2 SetFlashlightConfig
URL http://<ip>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramValue>[&<paramName>=<paramValue>...]
Syntax
Descriptio Set Flashlight config
n Example:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&FlashLight.Enable=true&FlashLight.TimeSection[1][0]=1%201
2:00:00-18:00:00
Response OK or Error
Comment
56
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.1.1 GetInterfaces
5.2 BasicNetworkConfig
5.2.1 GetBasicNetworkConfig
57
table.Network.Domain=dahua
table.Network.Hostname=badak
table.Network.interface.DefaultGateway=10.7.0.1
table.Network.interface.DhcpEnable=false
table.Network.interface.DnsServers[0]=221.123.33.228
table.Network.interface.DnsServers[1]=221.12.1.228
table.Network.interface.IPAddress=10.7.2.3
table.Network.interface.MTU=1500
table.Network.interface.PhysicalAddress=00:10:5c:f2:1c:b4
table.Network.interface.SubnetMask=255.255.0.0
Comment interface in response is network interface name, such as eth0, eth2…
5.2.2 SetBasicNetworkConfig
58
255.255.255.0
5.3 PPPoE
5.3.1 GetPPPoEConfig
5.3.2 SetPPPoEConfig
5.4 DDNS
5.4.1 GetDDNSConfig
59
table.DDNS[index].KeepAlive=10
table.DDNS[index].Password=none
table.DDNS[index].Port=5050
table.DDNS[index].Protocol= Quick DDNS
table.DDNS[index].UserName=user1
table.DDNS[index].DefaultHostName.Enable=false
table.DDNS[index].DefaultHostName.HostName=9002A9D77133.quickddns.com
Comment Index in response is the DDNS protocol table index, start from 0.
the meaning of params can refer to SetDDNSConfig chapter.
5.4.2 SetDDNSConfig
60
5.5 Email
5.5.1 GetEmailConfig
5.5.2 SetEmailConfig
61
Email. Enable bool Enable/Disable email function
Email. HealthReport.Enable bool Enable/Disable report device status by email.
Email. HealthReport.Interval integer Range is [30-1440].
Unit is minutes
Email. Password string User password of email account.
Email. Port integer Range is [1-65535]
Email. Receivers[0] string Email addresses of 3 receivers.
Email. Receivers[1] string
Email. Receivers[2] string
Email. SendAddress string Sender email address.
Email. SslEnable bool True: enable SSL email.
Email. Title string Title of email.
Email. UserName string User name of email account.
5.6 Wlan
5.6.1 GetWlanConfig
5.6.2 SetWlanConfig
62
Example:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Wlan.eth2.Enable=true&Wlan.eth2.KeyType=Hex
Response OK or Error
Comment In below ParamName, interface is name of wireless interface.
5.6.3 ScanWlanDevices
63
wlanDevice[0].AuthMode=7
wlanDevice[0].BSSID=28:2c:b2:5c:de:36
wlanDevice[0].EncrAlgr=3
wlanDevice[0].LinkMode=0
wlanDevice[0].LinkQuality=31
wlanDevice[0].RSSIQuality=0
wlanDevice[0].SSID=xia_yuguo 13098 Internet
Comment
5.7 UPnP
5.7.1 GetUPnPConfig
5.7.2 SetUPnPConfig
5.7.3 GetUPnPStatus
Comment
5.8 NTP
5.8.1 GetNTPConfig
65
5.8.2 SetNTPConfig
66
28: "GMT-08:00"
29: "GMT-09:00"
30: "GMT-10:00"
31: "GMT-11:00"
32: "GMT-12:00"
NTP.UpdatePeriod integer Range is [0-65535], unit is minutes
5.9 RTSP
5.9.1 GetRTSPConfig
5.9.2 SetRTSPConfig
67
5.10 Telnet
5.10.1 GetTelnetConfig
5.10.2 SetTelnetConfig
5.11 NetAlarmServer
5.11.1 GetAlarmServerConfig
5.11.2 SetAlarmServerConfig
URL http://<ip>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramValue>[&<paramName>=<paramValue>...]
68
Syntax
Descriptio Set Alarm Server config
n Example:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AlarmServer.Address=as.dahuatech.com&AlarmServer.Enabl
e=false
Response OK or Error
Comment
6 Alarm
6.1 EventHandler
6.1.1 GetEventHandler
Example:
http://192.168.1.108/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
69
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
…
Comment Params in URL:
< handlerName> can be one of below four formats
Alarm[alarm channel].EventHandler
MotionDetect[video channel]. EventHandler
BlindDetect[video channel]. EventHandler
LossDetect[video channel]. EventHandler
6.1.2 SetEventHandler
URL http://<ip>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramValue>[&<paramName>=<paramValue>...]
Syntax
70
Descripti Modify Event Handler settings
on Example:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Alarm[0].EventHandler.AlarmOutChannels[0]=1&Alarm[0].Eve
ntHandler.AlarmOutEnable=true
Respons OK or Error
e
Commen In below paramName, Meaning of handlerName is the same with GetEventHandler
t
Example:
TimeSection[1][0]=1 12:00:00-18:00:00
Means EventHandler is effective between 12:00:00 and 18:00:00 at
Monday.
handlerName.EventHandler.TipEnable bool Enable/Disable local message box tip.
handlerName.EventHandler. ExAlarmOutEnable bool
handlerName. ExAlarmOutChannels[channels] integer
6.2 Alarm
6.2.1 GetAlarmConfig
6.2.2 SetAlarmConfig
6.2.3 GetAlarmOutConfig
6.2.4 SetAlarmOutConfig
73
6.2.5 GetInSlots
6.2.6 GetOutSlots
6.2.7 GetInState
6.2.8 GetOutState
6.3 MotionDetect
6.3.1 GetMotionDetectConfig
74
Description Motion Detect 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 GetEventHandler)
table.MotionDetect[0].Level=3
table.MotionDetect[0].Region[0]=4194303
table.MotionDetect[0].Region[1]=4194303
…
…
table.MotionDetect[1]…
…
Comment
6.3.2 SetMotionDetectConfig
75
MotionDetect[0].Region[0] = 4194303 (0x3FFFFF): the 22 blocks in channel 0 line
0 is monitored.
MotionDetect[0].Region[1] =0: the 22 blocks in channel 0 line 1 is not monitored.
MotionDetect[0].Region[17] = 3: the left two blocks in the last line of channel 0 is
monitored.
6.4 BlindDetect
6.4.1 GetBlindDetectConfig
6.4.2 SetBlindDetectConfig
76
6.5 LossDetect
6.5.1 GetLossDetectConfig
6.5.2 SetLossDetectConfig
6.6 LoginFailureAlarm
6.6.1 GetLoginFailureAlarmConfig
77
6.6.2 SetLoginFailureAlarmConfig
6.7 StorageAbnormal
6.7.1 GetStorageNotExistConfig
6.7.2 SetStorageNotExistConfig
78
6.7.3 Get StorageFailureConfig
6.7.5 GetStorageLowSpaceConfig
6.7.6 SetStorageLowSpaceConfig
6.8 NetAbnormal
6.8.1 GetNetAbortConfig
6.8.2 SetNetAbortConfig
6.8.3 GetIPConflictConfig
6.8.4 SetIPConflictConfig
6.9 GetEventIndexes
(This response means event happened on channel 0, channel 2, and channel 3.)
Comment Params in URL:
eventCode includes:
VideoMotion: motion detection event
VideoLoss: video loss detection event
VideoBlind: video blind detection event.
AlarmLocal: alarm detection event.
StorageNotExist: storage not exist event.
StorageFailure: storage failure event.
StorageLowSpace: storage low space event.
AlarmOutput: alarm output event.
6.10 Attach
81
Connection: close\r\n
Content-Type: multipart/x-mixed-replace; boundary=<boundary>\r\n
Body:
--<boundary>\r\n
Content-Type: text/plain\r\n
Content-Length: <data length>\r\n
<eventInfo>\r\n\r\n
--<boundary>\r\n
Content-Type: text/plain\r\n
Content-Length: <data length>\r\n
<eventInfo>\r\n\r\n
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
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= MDResult;action=Pulse;index=0;data=61708863,61708863…\r\n\r\n
-- myboundary \r\n
…
Comment eventCode can be any one of the standard codes defined in DHIIF.
For example:
VideoMotion: motion detection event
VideoLoss: video loss detection event
VideoBlind: video blind detection event.
AlarmLocal: alarm detection event.
StorageNotExist: storage not exist event.
StorageFailure: storage failure event.
StorageLowSpace: storage low space event.
AlarmOutput: alarm output event.
MDResult: motion detection data reporting event. The motion detect window contains 18 rows and 22 columns. The
82
event info contains motion detect data with mask of every row.
6.11 GetCaps
7 PTZ
7.1 PTZConfig
7.1.1 GetPTZConfig
83
7.1.2 SetPTZConfig
7.1.3 GetPtzAutoMovementConfig
84
table.PtzAutoMovement[port][Task].ScanId = 0
table.PtzAutoMovement[port][Task].PresetId = 1
table.PtzAutoMovement[port][Task].PatternId = 0
table.PtzAutoMovement[port][Task].TourId = 0
table.PtzAutoMovement[port][Task].AutoHoming.Enable = true
table.PtzAutoMovement[port][Task].AutoHoming.Time = 300
table.PtzAutoMovement[port][Task].SnapshotEnable = false
table.PtzAutoMovement[port][Task].SnapshotDelayTime = 30
Comment Params in Resp:
Port is PTZ port index, start from 0.
Task is the number of task, start from 0.
week: from 1 to 7.
section: time section, from 0 to 5.
7.1.4 SetPtzAutoMovementConfig
85
head. SnapshotEnable bool Enable/Disable Snap, when “Fuction” is “Preset”.
head. SnapshotDelayTime integer Delay time of snap, when “Fuction” is “Preset”.
7.2 PTZControl
7.2.1 GetProtocolList
7.2.2 GetCurrentProtocolCaps
88
AlarmSearch Search alarm. 0 0 0 0
Position Go to position Horizontal Vertical position Zoom change 0
position
AuxOn Auxiliary function on, auxiliary 0 0 0 0
function is defined in product
definition document.
AuxOff Auxiliary function off 0 0 0 0
Menu 0 0 0 0
Exit 0 0 0 0
Enter 0 0 0 0
Esc 0 0 0 0
MenuUp 0 0 0 0
MenuDown 0 0 0 0
MenuLeft 0 0 0 0
MenuRight 0 0 0 0
Reset Restore default configuration. 0 0 0 0
SetPresetName Preset point Preset point title. 0 0
number (1 byte)
AlarmPtz Alarm linked PTZ. External alarm Link type: Argument of link 0
input channel. 1: go to preset type:
point Link type = 1,
2: auto scan this is preset point
3: tour number
Link type = 2,
this is auto scan
path
Link type = 3,
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
89
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.3 PTZStatus
8 Record
8.1 RecordManager
8.1.1 GetCaps
90
caps.SupportHoliday=true
caps.SupportPacketType[0]=Time
caps.SupportPacketType[1]=Size
caps.SupportResumeTransmit=false
Comment
8.2 Record
8.2.1 GetRecordConfig
8.2.2 SetRecordConfig
91
ParamName ParamValue type Description
Record[ch].PreRecord integer Range is [0-300].
Prerecord seconds, 0 means no prerecord.
ch (Channel number) starts form 0
Record[ch].TimeSection[wd][ts] string wd (week day) range is [0-6] (Sunday - Saturday)
ts (time section) range is [0-23], time section table index.
8.2.3 GetRecordModeConfig
8.2.4 SetRecordModeConfig
92
8.3 Record MediaGlobal
8.3.1 GetMediaGlobalConfig
8.3.2 SetMediaGlobalConfig
9 System
9.1 General
9.1.1 GetGeneralConfig
93
9.1.2 SetGeneralConfig
9.2 SystemTime
9.2.1 GetCurrentTime
9.2.2 SetCurrentTime
9.3 Locales
9.3.1 GetLocalesConfig
94
Description Get Locales config
Response table.Locales.DSTEnable=false
table.Locales.DSTEnd.Day=1
table.Locales.DSTEnd.Hour=0
table.Locales.DSTEnd.Minute=0
table.Locales.DSTEnd.Month=1
table.Locales.DSTEnd.Week=2
table.Locales.DSTEnd.Year=2011
table.Locales.DSTStart.Day=0
table.Locales.DSTStart.Hour=0
table.Locales.DSTStart.Minute=0
table.Locales.DSTStart.Month=1
table.Locales.DSTStart.Week=1
table.Locales.DSTStart.Year=2011
table.Locales.TimeFormat=yyyy-MM-dd HH:mm:ss
Comment
9.3.2 SetLocalesConfig
95
Locales.DSTStart.Day Range is the same with items in Locales.DSTEnd
Locales.DSTStart.Hour Locales.DSTStart table and Locales.DSTEnd table together defines the
Locales.DSTStart.Minute time range of DST.
Locales.DSTStart.Month
Locales.DSTStart.Week
Locales.DSTStart.Year
Locales.TimeFormat string Defines time format displayed in video time title.
String form is: year-month-day hour:mm:ss.
Position of year, month and day can be exchanged.
Example:
yyyy-MM-dd HH:mm:ss or
MM-dd-yyyy HH:mm:ss or
dd-M-yy hh:mm:ss
9.4 Language
9.4.1 GetLanguageCaps
9.4.2 GetLanguageConfig
9.4.3 SetLanguageConfig
9.5 AccessFilter
9.5.1 GetAccessFilterConfig
9.5.2 SetAccessFilterConfig
URL http://<ip>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramValue>[&<paramName>=<paramValue>...]
Syntax
Descriptio Set Access Filter config
n Example:
97
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&AccessFilter.BannedList[0]=192.168.1.1&AccessFilter.Type=B
annedList
Response OK or Error
Comment Params in Resp:
In below table,
index is the IP list index, it's range is [0-255]
9.6 AutoMaintain
9.6.1 GetAutoMaintainConfig
9.6.2 SetAutoMaintainConfig
9.7 UserManager
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 monitoring and replaying authorities.
9.7.2 GetGroupInfo
9.7.3 GetGroupInfoAll
9.7.4 AddUser
9.7.5 DeleteUser
100
9.7.6 ModifyUser
9.7.7 ModifyPassword
9.7.8 GetUserInfo
9.7.9 GetUserInfoAll
101
users[0].Id=1
users[0].Memo=admin 's account
users[0].Name=admin
users[0].Reserved=true
users[0].Sharable=true
users[0]. AuthList=<authList>
users[1].Group=admin
…
Comment
9.7.10 GetActiveUserInfoAll
9.8.1 Reboot
9.8.2 Shutdown
102
9.8.3 GetDeviceType
9.8.4 GetHardwareVersion
9.8.5 GetSerialNo
9.8.6 GetMachineName
9.8.7 GetSystemInfo
103
9.8.8 GetVendor
9.8.9 GetSoftwareVersion
9.8.10 GetBuildDate
This CGI is abandoned. It is replaced by GetSoftwareVersion to get the build information of software.
URL Syntax http://<ip>/cgi-bin/magicBox.cgi?action=getBuildDate
Description Get the build date information.
Response builddate=2013-04-22
Comment
9.8.11 GetCGIVersion
9.8.12 GetOnvifVersion
9.8.13 GetDeviceClass
104
Description Get the Device Class.
Response class=HDVR
Comment
9.9 Log
9.9.1 StartFind
URL http://<ip>/cgi-bin/log.cgi?action=startFind&condition.StartTime=<start>&condition.EndTime=<end>
Syntax
Descriptio Start to find log
n Example:
Find log between 2011-1-1 12:00:00 and 2011-1-10 12:00:00, URL is:
http://192.168.1.108/cgi-bin/log.cgi?action=startFind&condition.StartTime=2011-1-1%2012:00:00&condition.EndTime=2011-1-1
0%2012:00:00
Response token=1
Comment Params in URL:
start/end: the start/end time of log. Format is: yyyy-mm-dd hh:mm:ss.
in response, there is a token for further log finding process.
9.9.2 DoFind
9.9.3 StopFind
9.9.4 Clear
9.10 OnvifLoginCheck
9.10.1 GetOnvifLoginCheckConfig
9.10.2 SetOnvifLoginCheckConfig
106
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&UserGlobal.OnvifLoginCheck=true
Response OK or Error
Comment Params in URL:
<flag> range is {true, false}.
9.11 ConfigRestore
9.11.1 Restore
9.11.2 RestoreExcept
9.12 Holiday
9.12.1 GetHolidayConfig
107
table.Holiday.MonthMask[5]=0
table.Holiday.MonthMask[6]=0
table.Holiday.MonthMask[7]=0
table.Holiday.MonthMask[8]=0
table.Holiday.MonthMask[9]= 1610612739
table.Holiday.MonthMask[10]=0
table.Holiday.MonthMask[11]=0
Comment
9.12.2 SetHolidayConfig
10 Storage
10.1 FileFinding
10.1.1 Create
108
10.1.2 StartFind
10.1.3 FindNextFile
10.1.4 Close
10.1.5 Destroy
10.2.1 GetStorageDevicePortInfo
10.2.2 GetStorageDeviceNames
10.2.3 GetDeviceAllInfo
10.2.4 GetCaps
111
10.3 Work Group
10.3.1 GetWorkGroupCollect
10.4.1 GetWorkDirectoryCollect
10.5 NAS
10.5.1 GetNASConfig
112
Comment
10.5.2 SetNASConfig
10.6.1 GetRecordStoragePointConfig
113
10.6.2 SetRecordStoragePointConfig
10.6.3 GetStorageGroupConfig
10.6.4 SetStorageGroupConfig
114
Comment Params in URL:
In below table,
Index = Storage Group index
ch = channel index
11 Display
11.1 GUIConfig
11.1.1 GetGUIConfig
115
11.1.2 SetGUIConfig
11.2 Split
11.2.1 GetSplitMode
116
http://192.168.1.108/cgi-bin/split.cgi?action=getMode&channel=1
Comment Params in URL:
channelNo: the display screen No. Start from 1 and <= 2.
Response mode=split1
group=4
11.2.2 SetSplitMode
11.3.1 EnableMonitorTour
11.3.2 GetMonitorTourConfig
117
11.3.3 SetMonitorTourConfig
11.4.1 GetMonitorCollectionConfig
11.4.2 SetMonitorCollectionConfig
11.5 VideoOut
11.5.1 GetVideoOutConfig
119
head = table.VideoOut[channel].
channel: video channel index
11.5.2 SetVideoOutConfig
12 VideoFocus
12.1 AdjustFocus
12.2 AdjustFocusContinuously
URL http://<ip>/cgi-bin/devVideoInput.cgi?action=adjustFocusContinuously&focus=<focusNo>&zoom=<zoomNo>[&channel=<chan
Syntax nelNo>]
Descriptio Adjust focus continuously.
n
For example:
If we want to adjust focus, the API like this:
http:// 192.168.1.108/cgi-bin/devVideoInput.cgi?action=adjustFocusContinuously&focus=0.02&zoom=-1
and when the motor is moving, we send below command to let it stop:
http:// 192.168.1.108/cgi-bin/devVideoInput.cgi?action=adjustFocusContinuously&focus=0&zoom=-1
Response OK or Error
Comment Params in URL:
focusNo : float, the range is -1 < focus < 1; 0 means stop.
zoomNo : float, the range is -1 < zoom< 1; 0 means stop.
channelNo : integer, the video channel index which starts from 1.
The value means the moving speed of motor lens, positive value means move forwards, negative value means move backwards.
This command is used to drive the lens move continuously, until it reaches end. When the motor is moving, you send this
command again with focus or zoom parameter as 0, and then the motor will stop immediately. In this command when you adjust
the focus parameter, the zoom parameter should be -1, and the focus parameter should be -1 when adjust the zoom parameter.
12.3 AutoFocus
12.4 GetFocusStatus
121
status.Status=Normal
Comment Params in Resp :
The range of status.Status is “Normal” and “Autofocus”. This command must be continual executed until status.Status is
“Normal”.
12.5 getCurrentWindow
12.6 setCurrentWindow
122
13 Backup
13.1 ConfigBackup
{
"ATM" : {
"DataSource" : "RS232",
"DisplayPostion" : "lefttop",
"EncodeBlend" : true,
"PreviewBlend" : true,
"ProtocolAbility" : [ "POS" ],
"ProtocolName" : "ATM\/POS",
"RecordChannels" : [ 0, 1, 2, 3 ]
}
……
}
Comment
13.2 LogBackup
&w_User: default
&Time: 2014-09-01 15:20:45
&Type: VideoLoss
&Content: EventType: VideoLoss
123
channel:<8>
StartTime:2014-09-01 15:20:45
…
Comment Params in URL:
startTime /endTime : the start/end time when log info built. 24 hour Format, as: yyyy-mm-dd hh:mm:ss.
For example:
2014-8-25 00:02:32
2020-8-25 01:02:32
124
14 AccessControl
14.1 OpenDoor
14.2 GetDoorStatus
14.3 AccessControlCard
14.3.1 find
125
records [0].CardNo =123456
records [0].UserID =101
records [0].CardStatus =0
records [0].CardType =0
Comment Params in URL:
The paramName and paramValue are in the below table.
Params in Resp :
totalCount : the number of records which match the conditions.
found : the number of records returned
14.3.2 update
126
14.3.3 insert
14.3.4 remove
14.3.5 getQuerySize
14.4 AccessControlCardRec
14.4.1 find
128
14.5 Announcement
14.5.1 insert
14.6 VideoTalkLog
14.6.1 find
Params in Resp :
totalCount : the record count which match condition
found : the record count to return
CallType: call type. The range is {“Incoming”, “Outgoing” }.
EndState: the range is { “EndState” , “Received”}
Response totalCount=1000
129
found=500
records[0].RecNo=789
records[0].CreateTime=123456789
records[0].CallType=Incoming
records[0].EndState=Received
records[0].PeerNumber=501
……
14.7 AlarmRecord
14.7.1 find
Params in Resp :
totalCount : the record count which match condition
found : the record count to return
SenseMethod :the range is { "DoorMagnetism", "PassiveInfrared", "GasSensor", "SmokingSensor", "WaterSensor",
"ActiveInfrared", "CallButton", "UrgencyButton", "Steal", "Perimeter", "PreventRemove", "DoorBell" }
130
15 DeviceDiscovery
15.1 DeviceDiscovery
16 VideoAnalyse
This chapter is only effective with smart IP Camera.
131
16.1 GetCaps
16.1.1 GetCaps
16.2 VideoAnalyseRule
16.2.1 GetVideoAnalyseRule
132
Description Get Video Analyse Rules config.
Response head.Name= line1
head.Type=CrossLineDetection
head.VideoAnalyseRule[0][0].Enable =true
head.VideoAnalyseRule[0][0].EventHandler= (output of EventHandler is described in GetEventHandler)
…
Comment Params in Resp :
head =table.VideoAnalyseRule[ChannelNo] [RuleNo]
ChannelNo = video channel index.
RuleNo =rule index.
16.2.2 SetVideoAnalyseRule
133
“TakenAwayDetection”,“FaceDetection”,“WanderDetection”, “RioterDetection”,
“ParkingDetection”, “MoveDetection”}
head. Config .SizeFilter.MaxSize[1] integer Maximum height. The height of the object must not be beyond maximum height.
head. Config .SizeFilter.MinSize[0] integer Minimum width. The width of the object must not be less than minimum width.
head. Config .SizeFilter.MinSize[1] integer Minimum height. The height of the object must not be beyond minimum height.
head. Config.DetectRegion[0][0] integer The start point of DetectRegion 0;
Adapt to {“CrossRegionDetection”, “LeftDetection”, “TakenAwayDetection”,
“WanderDetection”,“RioterDetection”, “ParkingDetection”, “MoveDetection”}
head. Config.DetectRegion[0][1] integer The end point of DetectRegion 0;
head. Config.DetectRegion[1][0] integer The start point of DetectRegion 1;
head. Config.DetectRegion[1][1] integer The end point of DetectRegion 1;
head. Config.DetectRegion[2][0] integer The start point of DetectRegion 2;
head. Config.DetectRegion[2][1] integer The start point of DetectRegion 2;
head. Config. MinDuration integer Range is 1-600, adapt to {“LeftDetection”, “TakenAwayDetection”,
“WanderDetection”}.
Range is 10-300, adapt to {“RioterDetection”}.
Range is 6-300, adapt to {“ParkingDetection”}.
head. Config. Sensitivity integer Range is 1-10, adapt to {“RioterDetection”, “MoveDetection”}.
Head. Config. EnterThreshold integer Range is 0- 100000000, adapt to {“NumberStat”}.
Head. Config. ExitThreshold integer Range is 0- 100000000, adapt to {“NumberStat”}.
Head. Config. InsideThreshold integer Range is 0- 100000000, adapt to {“NumberStat”}.
16.3 VideoWidgetNumberStat
16.3.1 GetVideoWidgetNumberStat
16.3.2 SetVideoWidgetNumberStat
URL http://<ip>/cgi-bin/configManager.cgi?action=setConfig&<paramName>=<paramValue>[&<paramName>=<paramValue>...]
134
Syntax
Descripti Set OSD config when display human number status information.
on Example:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidgetNumberStat[0].EncodeBlend=true&VideoWidget
NumberStat[0].ShowEnterNum=true
Respons OK or Error
e
Commen Params in URL:
t paramName and paramValue are as below table.
In below table,
head =VideoWidgetNumberStat[ChannelNo]
ChannelNo = array index starts from 0, which means video channel.
16.4 VideoEncodeROI
16.4.1 GetVideoEncodeROI
16.4.2 SetVideoEncodeROI
135
In below table,
head = VideoEncodeROI[ChannelNo]
ChannelNo = array index starts from 0, which means video channel.
16.5 VideoStatServer
16.5.1 GetSummary
16.5.2 StartFind
16.5.3 DoFind
16.5.4 StopFind
138
17 Traffic
17.1 TrafficSnap
17.1.1 GetParkingSpaceStatus
Params in Resp :
TrafficCar : the members refer to TrafficCar
17.2 TrafficParking
17.2.1 GetAllParkingSpaceStatus
139
Description Get all valid parking spaces status of one device
For example If want to get all parking space status, the url is
http://192.168.1.108/cgi-bin/trafficParking.cgi?action=getAllParkingSpaceStatus
Response A list of parking space status
status[0].Lane=0
status[0]. CustomParkNo = A2701
status[0].Status = Park
…
status[1].Lane=1
status[1]. Status = NoPark
…
Comment Params in Resp :
Status : Park or NoPark
140
18 Radiometry
18.1.1 GetHeatImagingThermometryConfig
table.Isotherm.ColorBarDisplay=true
table.HotSpotFollow=true
table.TemperEnable=true
18.1.2 SetHeatImagingThermometryConfig
Example:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&HeatImagingThermometry.RelativeHumidity=50&HeatImagin
gThermometry.ObjectDistance=20.3
141
HeatImagingThermometry.AtmosphericTemperature float The Atmospheric Temperature range and step are
interface in getCaps
HeatImagingThermometry.ObjectDistance float The Object Distance range and step are get from
interface in getCaps
Unit is meter.
HeatImagingThermometry.ReflectedTemperature float The Reflected Temperature range and step are get
18.1.3 GetThermometryRuleConfig
head.T=3
head.Alarm. Id=0
head.Alarm. Enable=true
head.Alarm. Result =Max
head.Alarm. AlarmCondition=Below
head.Alarm. Threshold=20.0
head.Alarm. Hysteresis=0.1
142
head.Alarm. Duration=30
head.LocalParameters.Enable=true
head.LocalParameters. ObjectEmissivity=0.95
head.LocalParameters. ObjectDistance=0.95
head.LocalParameters. RefalectedTemp=0
Comment Params in Resp :
head =table.ThermometryRule[ChannelNo] [RuleNo]
PointNo = point index
ChannelNo = video channel index.
RuleNo =rule index.
Alarm= AlarmSetting[AlarmNo]
AlarmNo = alarm index
18.1.4 SetThermometryRuleConfig
143
The Yscale of Region/Line point
head. T integer Temperature Sample period. Unit is Second.
head. Alarm.Id integer Range [0- 65535],unique alarm id
head. Alarm.Enable bool Enable/Disable
head. Alarm.Result string Depend on the vaule of Type
Spot : {Vaule}
Line:{ Max,Min,Aver}
Area:{Max,Min,Aver,Std,Mid,ISO}
head. Alarm. AlarmCondition string Range is {Below, Match , Above }
head. Alarm. Threshold float Alarm threshold
head. Alarm. Hysteresis float Alarm hysteresis
head. Alarm. Duration integer The duration time of alarm.
Unit is second
head. LocalParameters.Enable bool Enable/Disable
head. LocalParameters. ObjectEmissivity float Range [0 -1]
Accuracy is 0.01
head. LocalParameters. ObjectDistance float Object distance
The range get from interface in getCaps
head. LocalParameters. ReflectedTemp float Object Reflected Temperature
The range get from interface in getCaps
18.1.5 GetHeatImagingTemperConfig
18.1.6 SetHeatImagingTemperConfig
144
paramName and paramValue are as below table.
In below table,
head= HeatImagingTemper[Channel]
Channel=array index, means video channel number
18.2 GetCaps
145
caps.Isotherm.MaxTemp=327.0
caps.Isotherm.MinTemp=-20.0
Comment Params in URL:
channelNo : the channel index; start from 1
Params in Resp :
Type : the range is { "Spot", "Line", "Area" }
MinPeriod :Unit is Second.
18.3 GetRandomPointTemper
Response TempInfo.Type=Spot
TempInfo.TemperAver=27.5
18.4 GetTemper
146
condition. RuleId integer Range [0- MaxNum]
MaxNum is get from interface in getCaps
condition. Type string Range is {Spot, Line,Area}
condition. Name string Name is get from interface in
GetThermometryRuleConfig
19 Thermography
19.1.1 GetThermographyOptionsConfig
147
19.1.2 SetThermographyOptionsConfig
148
head. Auto.HighToLow integer UInt32
head. Auto.HLROI integer UInt32, percentage range is[0-100]
19.2 GetExternSystemInfo
Params in Resp:
SerialNumber : string
SoftwareVersion: string
FirmwareVersion: string
LibVersion : string
19.3 GetPresetParam
19.4 GetCaps
150
Params in Resp:
PresetModes : the preset mode. Range is { "Indoor", "Outdoor", "Default" }
PresetROIModes : Preset ROI mode. Range is {"Full Screen”, “Sky", "Ground", "Horizontal",
19.5 GetOptimizedRegion
Params in Resp:
Regions : the region is a rectangle
i: the region index.
19.6 EnableShutter
151
20 HeatMap
20.1 GetPicByTime
Params in Resp:
heatMap size : width*height+16。
HeatMap Data
0 1 2 3 4 … 15 16 17 18 …
Width Height Reserved Data: every byte symbolize a pixel
21 VideoTalkPeer
21.1 attachState
Example:
http://172.23.2.108/cgi-bin/VideoTalkPeer.cgi?action=attachState
Response Notify the state:
152
SID=315
state.State=Answer
state.Talkback.Pack=RTP
state.Talkback.Protocol=UDP
state.Talkback.Type=Talk
state.Talkback.Audio.AudioPort=6000
state.Talkback.Audio.Format[0].Compression=PCM
state.Talkback.Audio.Format[0].Frequency=44000
state.Talkback.Audio.Format[0].Depth=16
state.Talkback.Audio.Format[1].Compression=G.711A
state.Talkback.Audio.Format[1].Frequency=44000
state.Talkback.Audio.Format[1].Depth=16
state.Talkback.Video.VideoPort=7000
state.Talkback.Video.Format[0].Compression=H.264
state.Talkback.Video.Format[0].Frequency=90000
state.Talkback.Video.Format[1].Compression=MJPG
……
state.Talkback. MediaAddr=224.10.10.10
21.2 detachState
21.3 invite
For example:
http://<ip>/cgi-bin/VideoTalkPeer.cgi?action=invite&Talkback.Protocol=UDP&Talkback.Type=Talk&Talkback.MediaAddr=2
24.10.10.10
or
http://<ip>/cgi-bin/VideoTalkPeer.cgi?action=invite
Response OK or Error
21.4 cancel
For example:
http://<ip>/cgi-bin/VideoTalkPeer.cgi?action=cancel
Response OK or Error
21.5 answer
For example:
http://<ip>/cgi-bin/VideoTalkPeer.cgi?action=answer&Talkback.Protocol=UDP&Talkback.Type=Talk&Talkback.MediaAddr
=224.10.10.10
Response OK or Error
154
21.6 refuse
21.7 hangup
22 Abandoned APIs
This chapter contains unsupported APIS. If is wanted, the API can be supported after redesigned.
155
Comment Get video detect capabilities, channelNo is video channel No. starts from 1 .
Notice that When your device is using V1.0 V2.0 Motion detection, you cannot get any reply while executing the
command.
22.2 GetChannelInState
22.3 GetChannelOutState
22.4 GetUUID
22.5 SetStorageDevice
156
Example:
http://192.168.1.108/cgi-bin/storageDevice.cgi?action=setDevice&pointer=27023434&type=Lock
Response OK or Error: No SD Card
Comment Params in URL:
type: Range is {Lock, UnLock, FormatPatition, UnMount }. pointer: The object Id is got from cgi
API(cgi-bin/storageDevice.cgi?action=getDeviceAllInfo).If type is Lock or UnLock, pointer is list[0].Detail[0].Pointer, If If type
is FormatPatition or UnMount, pointer is list[0].Pointer.
*After formation operation, the device would reboot.
23 Appendix
The Stream format is used by 4.1.9 GetStream By Http and 4.1.10 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.
157
23.2 Extend Header Format
Byte
0 1 2 3 4 5 6 …
Order
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;
158
23.2.3 Channel Title Extend Header:
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
When a stream begin, or the Time Zone changes, the video packet must contain the Time Zone 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
159