In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what is the method of obtaining Qt Onvif information". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the method of obtaining Qt Onvif information".
I. Preface
It should be noted that the vast majority of cameras in the market now have a password authentication limit. No matter whether it is admin or 12345 by default, there is at least a user authentication mechanism there, which is relatively secure. Otherwise, anyone can get the corresponding information through the onvif protocol, and there will be no security to speak of. I remember that Haikang exposed a loophole a few years ago, resulting in many surveillance cameras being leaked. For this reason, Haikang's current camera onvif is off by default, and the password requires a variety of combinations after it is turned on. Alas, convenience must be sacrificed if you want to be more secure, and I don't know who can come up with a perfect solution.
The main functions of onvif:
Search for equipment and get information about the equipment, such as manufacturer, model, etc.
Get multiple profile information profile for the device.
Get parameters such as video stream address rtsp and resolution of the corresponding configuration file.
Head control, moving up and down, left and right, focal length magnified and reduced, relative and absolute movement.
Get the preset information and trigger the preset.
Subscribe to events and receive all kinds of messages from the device, especially alarm events such as the alarm of the IO port.
Capture the picture to get the current picture of the device.
Get, create, and delete user information.
Get and device network configuration information such as IP address.
Gets and sets NTP time synchronization and sets device time.
Gets and sets video and picture parameters (brightness, color, saturation).
Restart the device.
The processing flow of onvif:
Bind a multicast IP (239.255.255.250) and a port (3702) to send a data search device in a fixed xml format.
The received data is parsed in xml format to get the Onvif address of the device.
Send the corresponding data to the Onvif address, receive the data and take out the corresponding node data.
Request Onvif address to obtain Media address and Ptz address. Media address is used to obtain detailed configuration files, and Ptz address is used for cloud control.
Ptz control is to send the corresponding data to the Ptz address.
Set up the need for user authentication to organize the user token information to be sent together, and each time it needs to be authenticated.
The data received is not standard xml data and can not be processed according to normal node parsing, so it can only be done with QXmlQuery.
The data returned by each manufacturer's equipment may not be completely consistent, but they are basically inconsistent, so it is necessary to fuzzy find the node value.
Specially uses the underlying protocol parsing, because soap is too bloated and the function name is too alternative, so it is specially lightweight.
Two must-have tools, Onvif Device Manager and Onvif Device Test Tool.
II. Functional features
Broadcast search equipment, support IPC and NVR, return in turn, you can choose different network card IP.
Get the Onvif address, Media address, Profile file, and Rtsp address in turn.
The video stream Rtsp address, such as the main stream substream address, can be obtained for the specified Profile.
Onvif user information can be set for each device, which can be used for authentication to obtain details.
Camera images can be previewed in real time.
Support head control, adjust head up and down, left and right, support absolute movement and relative movement, you can put and reduce the distance of the image.
Any Qt version of Qt4 and Qt5 is supported, and Qt4.7.0 to Qt5.14.2 is tested.
Support any compiler, test mingw, msvc, gcc, clang.
Support any operating system, test xp, win7, win10, android, linux, embedded linux, raspberry pie H3, etc.
Support any Onvif camera and NVR, test Haikang, Dahua, Yushi, Huawei, Hayes chip cores, etc., can be customized and developed.
Unicast search for specified IP addresses and onvif addresses is supported, for example, in the case of cross-network segments.
Support to specify filter criteria to filter search devices.
Support the search interval setting to ensure that all devices are searched back, which is very useful in a large number of equipment sites.
The picture parameters (brightness, color, saturation) can be set.
Support NTP timing and time synchronization settings.
Written by pure Qt, super compact and lightweight, a total of about 2000 lines of code, does not rely on any third-party libraries and components, cross-platform.
Encapsulated the general functions of data sending and receiving parsing, it is very convenient to expand other Onvif processing.
The sending and receiving data text box is provided on the tool to display the sending and receiving data, which is convenient for viewing and analysis.
Support all Onvif devices, neat code, friendly interface, directly introduced into pri can be used.
Third, effect picture
4. Core code OnvifDevice::DeviceInfo * OnvifBase::getDeviceInfo () {if (device- > deviceUrl.isEmpty ()) {return 0;} QString file = device- > request- > getSendData ("GetDeviceInformation"); QByteArray dataSend = file.toUtf8 (); QNetworkReply * reply = device- > request- > auth (device- > deviceUrl, dataSend); emit sendData (dataSend, device- > deviceUrl); OnvifDevice::DeviceInfo * deviceInfo = 0; QByteArray dataReceive Bool ok = device- > checkData (reply, dataReceive, "get device information"); if (ok) {OnvifQuery query; query.setData (dataReceive); QString wsdl = query.getDeviceWsdl (); QString name_path = QString ("/ /% 1:GetDeviceInformationResponse/%1:Manufacturer") .arg (wsdl); QString mod_path = QString ("/ /% 1:GetDeviceInformationResponse/%1:Model") .arg (wsdl) QString ver_path = QString ("/ /% 1:GetDeviceInformationResponse/%1:FirmwareVersion") .arg (wsdl); QString ser_path = QString ("/ /% 1:GetDeviceInformationResponse/%1:SerialNumber") .arg (wsdl); QString hard_path = QString ("/ /% 1:GetDeviceInformationResponse/%1:HardwareId") .arg (wsdl); / / package the device information searched by the broadcast first deviceInfo = new OnvifDevice::DeviceInfo DeviceInfo- > addr = device- > deviceInfo.value ("addr"); deviceInfo- > ip = device- > deviceInfo.value ("ip"); deviceInfo- > name = device- > deviceInfo.value ("name"); deviceInfo- > location = device- > deviceInfo.value ("location"); deviceInfo- > hardware = device- > deviceInfo.value ("hardware"); deviceInfo- > manufacturer = query.getValue (name_path); deviceInfo- > model = query.getValue (mod_path) DeviceInfo- > firmwareVersion = query.getValue (ver_path); deviceInfo- > serialNumber = query.getValue (ser_path); deviceInfo- > hardwareId = query.getValue (hard_path);} return deviceInfo }% 1 Thank you for your reading, the above is the content of "what is the method of obtaining Qt Onvif information". After the study of this article, I believe you have a deeper understanding of what the method of obtaining Qt Onvif information is, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.