EasyNVR web camera without plug-H5, Google Chrome broadcast program -Onvif (a) use Onvif protocol device discovery and device information specified probe

Creative Commons License Creative Commons

background analysis

As we all know, EasyNVR not rigidly stick, it is not limited to the camera brands and supporting platform, as long as the network surveillance cameras IPC, DVR NVR, and the device supports standard RTSP / Onvif protocol, you can access real-time video streaming system into the EasyNVR be broadcast live, recording, retrieval and playback services. About EasyNVR, the venue may be based on EasyNVR achieve RTSP / Onvif surveillance camera Web live without plug-in technology to monitor specific knowledge. Meanwhile EasyNVR onvif protocol supports device discovery, PTZ control, onvif address acquisition and other functions.

This post focuses on EasyNVR explained how the device discovery

1. preparation stage

First of all, we have to understand Onvif protocol ( https://www.onvif.org/ ), previously developed on how to use gsoap be onvif clients have explored, gsoap of onvif framework to generate your own google. There are many features Onvif agreement, we only discuss security monitoring live several common features.

2. The principle found

Onvif agreement calls for device supports device discovery, and device detection Onvif protocol service, which is discovery and probe. Discovery, client subnet to a multicast address 239.255.255.250, port 3702 transmits a broadcast message, wait for the network device in response Onvif protocol. The device response message returned to their IP, UUID, EP Address, Type, the most important will return the device Device Service Address, formats such as: http://192.168.1.2:8080/onvif/devices , this address is to Onvif services provided equipment service address, we need to use this address other operations.

  • Use gsoap be discover devices

    SOAP_ENV__Header header;
    soap_default_SOAP_ENV__Header(soap_, &header);

    header.wsa__MessageID = const_cast<char*>(soap_wsa_rand_uuid(soap_));
    header.wsa__To = "urn:schemas-xmlsoap-org:ws:2005:04:discovery";
    header.wsa__Action = "http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe";
    soap_->header = &header;

    wsdd__ScopesType scopesType;
    soap_default_wsdd__ScopesType(soap_, &scopesType);
    scopesType.__item = "";
    wsdd__ProbeType probeType;
    soap_default_wsdd__ProbeType(soap_, &probeType);
    probeType.Scopes = &scopesType;
    probeType.Types = "";

    __wsdd__ProbeMatches probeMatches;
    int result = soap_send___wsdd__Probe(soap_, "soap.udp://239.255.255.250:3702", NULL, &probeType);
    if (result == SOAP_OK)
    {
	  do
	{
		result = soap_recv___wsdd__ProbeMatches(soap_, &probeMatches);
		if (result == SOAP_OK)
		{
			//处理接收到的响应消息,提取设备信息
			//这里我们通常需要IP、Device Service Address
			//IP: soap_->ip
			//Address: probeMatches.wsdd__ProbeMatches->ProbeMatch->XAddrs 
		}
		else
		{
			break;
		}
	} while (true);
    }


3. Want More

We can find the above operations into a unified network segment of the device, or can be broadcast to the device, but once we emerged across the network can not broadcast to the device, how do we get it for device information?

  • First, we need to know the IP address of the device, or otherwise unable to start, if you do not know, unable to continue ...

  • When you know the IP address of the device, the same token, we can detect to this device, that is, we are talking probe

Currently instructions can be found Onvif how to obtain the specified device information, estimated that only one of my


    SOAP_ENV__Header header;
    soap_default_SOAP_ENV__Header(soap_, &header);

    header.wsa__MessageID = const_cast<char*>(soap_wsa_rand_uuid(soap_));
    header.wsa__To = "urn:schemas-xmlsoap-org:ws:2005:04:discovery";
    header.wsa__Action = "http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe";
    soap_->header = &header;

    wsdd__ScopesType scopesType;
    soap_default_wsdd__ScopesType(soap_, &scopesType);
    scopesType.__item = "";
    wsdd__ProbeType probeType;
    soap_default_wsdd__ProbeType(soap_, &probeType);
    probeType.Scopes = &scopesType;
    probeType.Types = "";

    __wsdd__ProbeMatches probeMatches;
    std::string soapAddress(Format("soap.udp://%s:3702", host));
    if (soap_send___wsdd__Probe(soap_, soapAddress.c_str(), NULL, &probeType) == SOAP_OK)
    {
	    if (soap_recv___wsdd__ProbeMatches(soap_, &probeMatches) == SOAP_OK)
		//Address: probeMatches.wsdd__ProbeMatches->ProbeMatch->XAddrs
    }

EasyNVS cloud management platform (free of charge)

EasyNVS cloud management platform is based on a new generation of ultra-innovative integration and technology to build, with a complete cloud infrastructure platform video streaming service capabilities and operation and maintenance management service capabilities, it can be distributed in different areas of the network environment and sets EasyNVR equipment , unified interface for registration and management, with broadband cloud resources to solve the problem of playback devices in the cloud single cloud in the multi-channel distribution required for viewing live up broadband issues, and distributed storage.

The client by EasyNVR listing on EasyNVS cloud management platform, and each network camera snapshots online and acquire a corresponding camera video stream data ROMS, while achieving on-demand broadcast, reduce network bandwidth and server stress.

EasyNVS

EasyNVR scenarios

EasyNVR can be said to have become the vanguard of the domestic Internet video infrastructure, livelihood of the people in almost every industry have already had the ability to output video EasyNVR figure, EasyNVR years of service in all walks of life video infrastructure, EasyNVR reliability, integrity, stability It has been widely recognized in the industry!

EasyNVR stable and reliable
EasyNVR a scene

Ping site

EasyNVR Scene II

Wisdom campus

About EasyNVR

EasyNVR have is a full, independent, controllable intellectual property rights, but also can have the function of security software and hardware integration of Internet streaming media server, network camera through a simple channel configuration, monitoring industry inside traditional high-definition network camera IP Camera , etc. with the NVR RTSP, Onvif protocol output device access to EasyNVR, EasyNVR these audio and video data can be video sources is a pull, is converted to RTMP / HLS, full internet terminal H5 live (Web, Android, iOS), and EasyNVR able to broadcast live video source of data to a third party CDN network, Internet-scale distributed. EasyNVR details you may visit the official website: http://www.easynvr.com

Guess you like

Origin blog.csdn.net/EasyNVR/article/details/91850906