ONVIF 获取主题事件
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 | HTTP/1.1 200 OK Date: Tue, 22 Oct 2024 08:39:21 GMT X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block Cache-Control: no-cache Content-Length: 14474 Connection: close Content-Type: application/soap+xml; charset=utf-8 <? xml version="1.0" encoding="UTF-8"?> < env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl" xmlns:tst="http://www.onvif.org/ver10/storage/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:dn="http://www.onvif.org/ver10/network/wsdl" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:wsoap12="http://schemas.xmlsoap.org/wsdl/soap12" xmlns:http="http://schemas.xmlsoap.org/wsdl/http" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:wsadis="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wsntw="http://docs.oasis-open.org/wsn/bw-2" xmlns:wsrf-rw="http://docs.oasis-open.org/wsrf/rw-2" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsrf-r="http://docs.oasis-open.org/wsrf/r-2" xmlns:trc="http://www.onvif.org/ver10/recording/wsdl" xmlns:tse="http://www.onvif.org/ver10/search/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tnshik="http://www.hikvision.com/2011/event/topics" xmlns:hikwsd="http://www.onvifext.com/onvif/ext/ver10/wsdl" xmlns:hikxsd="http://www.onvifext.com/onvif/ext/ver10/schema" xmlns:tas="http://www.onvif.org/ver10/advancedsecurity/wsdl" xmlns:tr2="http://www.onvif.org/ver20/media/wsdl" xmlns:axt="http://www.onvif.org/ver20/analytics"> < env:Header > < wsa:Action >http://www.onvif.org/ver10/events/wsdl/EventPortType/GetEventPropertiesResponse</ wsa:Action > </ env:Header > < env:Body > < tev:GetEventPropertiesResponse > < tev:TopicNamespaceLocation >http://www.onvif.org/onvif/ver10/topics/topicns.xml</ tev:TopicNamespaceLocation > < wsnt:FixedTopicSet >true</ wsnt:FixedTopicSet > < wstop:TopicSet > < tns1:VideoSource wstop:topic="true"> < MotionAlarm wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Source > < tt:SimpleItemDescription Name="Source" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:SimpleItemDescription Name="State" Type="xs:boolean" /> </ tt:Data > </ tt:MessageDescription > </ MotionAlarm > < ImageTooDark wstop:topic="false"> < ImagingService wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Source > < tt:SimpleItemDescription Name="Source" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:SimpleItemDescription Name="State" Type="xs:boolean" /> </ tt:Data > </ tt:MessageDescription > </ ImagingService > </ ImageTooDark > </ tns1:VideoSource > < tns1:Device wstop:topic="true"> < Trigger wstop:topic="true"> < tnshik:AlarmIn wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Source > < tt:SimpleItemDescription Name="AlarmInToken" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:SimpleItemDescription Name="State" Type="xs:boolean" /> </ tt:Data > </ tt:MessageDescription > </ tnshik:AlarmIn > < DigitalInput wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Source > < tt:SimpleItemDescription Name="InputToken" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:SimpleItemDescription Name="LogicalState" Type="xs:boolean" /> </ tt:Data > </ tt:MessageDescription > </ DigitalInput > < Relay wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Source > < tt:SimpleItemDescription Name="RelayToken" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:SimpleItemDescription Name="LogicalState" Type="tt:RelayLogicalState" /> </ tt:Data > </ tt:MessageDescription > </ Relay > </ Trigger > < HardwareFailure wstop:topic="true"> < tnshik:HardDiskFull wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="HardDiskNo" Type="xs:int" /> </ tt:Source > </ tt:MessageDescription > </ tnshik:HardDiskFull > < tnshik:HardDiskError wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="HardDiskNo" Type="xs:int" /> </ tt:Source > </ tt:MessageDescription > </ tnshik:HardDiskError > </ HardwareFailure > < tnshik:Network wstop:topic="true"> < tnshik:EthernetBroken wstop:topic="true" /> < tnshik:IPAddrConflict wstop:topic="true" /> </ tnshik:Network > </ tns1:Device > < tns1:UserAlarm wstop:topic="true"> < tnshik:IllegalAccess wstop:topic="true" /> </ tns1:UserAlarm > < tns1:RuleEngine wstop:topic="true"> < CellMotionDetector wstop:topic="true"> < Motion wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Source > < tt:SimpleItemDescription Name="VideoSourceConfigurationToken" Type="tt:ReferenceToken" /> < tt:SimpleItemDescription Name="VideoAnalyticsConfigurationToken" Type="tt:ReferenceToken" /> < tt:SimpleItemDescription Name="Rule" Type="xs:string" /> </ tt:Source > < tt:Data > < tt:SimpleItemDescription Name="IsMotion" Type="xs:boolean" /> </ tt:Data > </ tt:MessageDescription > </ Motion > </ CellMotionDetector > < LineDetector wstop:topic="true"> < Crossed wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Source > < tt:SimpleItemDescription Name="VideoSourceConfigurationToken" Type="tt:ReferenceToken" /> < tt:SimpleItemDescription Name="VideoAnalyticsConfigurationToken" Type="tt:ReferenceToken" /> < tt:SimpleItemDescription Name="Rule" Type="xs:string" /> </ tt:Source > < tt:Data > < tt:SimpleItemDescription Name="ObjectId" Type="xs:integer" /> </ tt:Data > </ tt:MessageDescription > </ Crossed > </ LineDetector > < FieldDetector wstop:topic="true"> < ObjectsInside wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Source > < tt:SimpleItemDescription Name="VideoSourceConfigurationToken" Type="tt:ReferenceToken" /> < tt:SimpleItemDescription Name="VideoAnalyticsConfigurationToken" Type="tt:ReferenceToken" /> < tt:SimpleItemDescription Name="Rule" Type="xs:string" /> </ tt:Source > < tt:Key > < tt:SimpleItemDescription Name="ObjectId" Type="xs:integer" /> </ tt:Key > < tt:Data > < tt:SimpleItemDescription Name="IsInside" Type="xs:boolean" /> </ tt:Data > </ tt:MessageDescription > </ ObjectsInside > </ FieldDetector > < TamperDetector wstop:topic="true"> < Tamper wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Source > < tt:SimpleItemDescription Name="VideoSourceConfigurationToken" Type="tt:ReferenceToken" /> < tt:SimpleItemDescription Name="VideoAnalyticsConfigurationToken" Type="tt:ReferenceToken" /> < tt:SimpleItemDescription Name="Rule" Type="xs:string" /> </ tt:Source > < tt:Data > < tt:SimpleItemDescription Name="IsTamper" Type="xs:boolean" /> </ tt:Data > </ tt:MessageDescription > </ Tamper > </ TamperDetector > </ tns1:RuleEngine > < tns1:AudioAnalytics wstop:topic="true"> < Audio wstop:topic="true"> < DetectedSound wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="AudioSourceConfigurationToken" Type="tt:ReferenceToken" /> < tt:SimpleItemDescription Name="AudioAnalyticsConfigurationToken" Type="tt:ReferenceToken" /> < tt:SimpleItemDescription Name="Rule" Type="xs:string" /> </ tt:Source > < tt:Key > < tt:SimpleItemDescription Name="isSoundDetected" Type="xs:boolean" /> </ tt:Key > < tt:Data > < tt:SimpleItemDescription Name="UTCTime" Type="xs:dateTime" /> </ tt:Data > </ tt:MessageDescription > </ DetectedSound > </ Audio > </ tns1:AudioAnalytics > < tns1:Configuration wstop:topic="true"> < Profile wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:Profile" /> </ tt:Data > </ tt:MessageDescription > </ Profile > < VideoEncoderConfiguration wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:VideoEncoderConfiguration" /> </ tt:Data > </ tt:MessageDescription > </ VideoEncoderConfiguration > < VideoSourceConfiguration wstop:topic="true"> < MediaService wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:VideoSourceConfiguration" /> </ tt:Data > </ tt:MessageDescription > </ MediaService > </ VideoSourceConfiguration > < AudioEncoderConfiguration wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:AudioEncoderConfiguration" /> </ tt:Data > </ tt:MessageDescription > </ AudioEncoderConfiguration > < AudioSourceConfiguration wstop:topic="true"> < MediaService wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:AudioSourceConfiguration" /> </ tt:Data > </ tt:MessageDescription > </ MediaService > </ AudioSourceConfiguration > < AudioOutputConfiguration wstop:topic="true"> < MediaService wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:AudioOutputConfiguration" /> </ tt:Data > </ tt:MessageDescription > </ MediaService > </ AudioOutputConfiguration > < MetadataConfiguration wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:MetadataConfiguration" /> </ tt:Data > </ tt:MessageDescription > </ MetadataConfiguration > < PTZConfiguration wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:PTZConfiguration" /> </ tt:Data > </ tt:MessageDescription > </ PTZConfiguration > < VideoAnalyticsConfiguration wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:VideoAnalyticsConfiguration" /> </ tt:Data > </ tt:MessageDescription > </ VideoAnalyticsConfiguration > </ tns1:Configuration > < tns1:RecordingConfig wstop:topic="true" xmlns:xs="http://www.w3.org/2001/XMLSchema"> < JobState wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Source > < tt:SimpleItemDescription Name="RecordingJobToken" Type="tt:RecordingJobReference" /> </ tt:Source > < tt:Data > < tt:SimpleItemDescription Name="State" Type="xs:string" /> < tt:ElementItemDescription Name="Information" Type="tt:RecordingJobStateInformation" /> </ tt:Data > </ tt:MessageDescription > </ JobState > < RecordingJobConfiguration wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="RecordingJobToken" Type="tt:RecordingJobReference" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:RecordingJobConfiguration" /> </ tt:Data > </ tt:MessageDescription > </ RecordingJobConfiguration > < RecordingConfiguration wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="RecordingToken" Type="tt:RecordingReference" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:RecordingConfiguration" /> </ tt:Data > </ tt:MessageDescription > </ RecordingConfiguration > < TrackConfiguration wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="RecordingToken" Type="tt:RecordingReference" /> < tt:SimpleItemDescription Name="TrackToken" Type="tt:TrackReference" /> </ tt:Source > < tt:Data > < tt:ElementItemDescription Name="Configuration" Type="tt:TrackConfiguration" /> </ tt:Data > </ tt:MessageDescription > </ TrackConfiguration > </ tns1:RecordingConfig > < tns1:Monitoring wstop:topic="false"> < ProcessorUsage wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Source > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:SimpleItemDescription Name="Value" Type="xs:float" /> </ tt:Data > </ tt:MessageDescription > </ ProcessorUsage > < OperatingTime wstop:topic="false"> < LastReset wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Data > < tt:SimpleItemDescription Name="Status" Type="xs:dateTime" /> </ tt:Data > </ tt:MessageDescription > </ LastReset > </ OperatingTime > < OperatingTime wstop:topic="false"> < LastReboot wstop:topic="true"> < tt:MessageDescription IsProperty="true"> < tt:Data > < tt:SimpleItemDescription Name="Status" Type="xs:dateTime" /> </ tt:Data > </ tt:MessageDescription > </ LastReboot > </ OperatingTime > </ tns1:Monitoring > < tns1:Media wstop:topic="false"> < ProfileChanged wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Data > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Data > </ tt:MessageDescription > </ ProfileChanged > < ConfigurationChanged wstop:topic="true"> < tt:MessageDescription IsProperty="false"> < tt:Source > < tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken" /> </ tt:Source > < tt:Data > < tt:SimpleItemDescription Name="Type" Type="xs:string" /> </ tt:Data > </ tt:MessageDescription > </ ConfigurationChanged > </ tns1:Media > </ wstop:TopicSet > < wsnt:TopicExpressionDialect >http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet</ wsnt:TopicExpressionDialect > < wsnt:TopicExpressionDialect >http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete</ wsnt:TopicExpressionDialect > < tev:MessageContentFilterDialect >http://www.onvif.org/ver10/tev/messageContentFilter/ItemFilter</ tev:MessageContentFilterDialect > < tev:MessageContentSchemaLocation >http://www.onvif.org/onvif/ver10/schema/onvif.xsd</ tev:MessageContentSchemaLocation > </ tev:GetEventPropertiesResponse > </ env:Body > </ env:Envelope > |
这个 XML 片段定义了多个监控设备的事件通知主题(topics)和其相关的消息描述。这些事件的消息内容被分为 `Source` 和 `Data` 两个部分,分别用于描述事件的来源和数据。以下是其中的一些重要结构和内容:
1. **VideoSource 和 Device 事件**:
- `MotionAlarm` 和 `ImageTooDark` 是视频相关的事件,其中 `MotionAlarm` 的数据字段定义了布尔类型的 `State`,表示是否有运动报警。
- `AlarmIn` 和 `DigitalInput` 属于设备触发的事件,这些事件也使用布尔值来描述状态,例如报警输入和数字输入的逻辑状态。
2. **硬件故障检测**:
- `HardDiskFull` 和 `HardDiskError` 是硬盘相关的事件,记录了哪个硬盘出现了问题,字段 `HardDiskNo` 表示硬盘编号。
- 网络故障事件包括 `EthernetBroken` 和 `IPAddrConflict`,它们分别表示以太网断开和 IP 地址冲突。
3. **规则引擎事件**:
- 事件如 `Motion`、`Crossed` 和 `ObjectsInside` 表示视频分析中检测到的运动、越线或物体进入特定区域。这些事件使用 `VideoSourceConfigurationToken` 和 `VideoAnalyticsConfigurationToken` 来标记它们所对应的配置。
4. **音频分析事件**:
- `DetectedSound` 表示检测到声音时的通知,包含了音频源配置的标识符和事件发生的时间。
5. **配置相关事件**:
- `VideoEncoderConfiguration`、`AudioEncoderConfiguration` 和 `PTZConfiguration` 等定义了配置变化时的通知,记录了对应的配置项和新的配置信息。
6. **录制相关事件**:
- `RecordingJobToken` 表示录制任务的标识符,`State` 描述了录制任务的状态,如开始、暂停或停止,`Information` 提供了录制任务的详细状态信息。
这个 XML 定义了多个复杂的 ONVIF 事件,用于设备的监控、告警、视频和音频分析,以及相关的配置和录制管理。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 使用C#创建一个MCP客户端
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 按钮权限的设计及实现