ZoneMinder / zoneminder

ZoneMinder is a free, open source Closed-circuit television software application developed for Linux which supports IP, USB and Analog cameras.
http://www.zoneminder.com/
GNU General Public License v2.0
4.98k stars 1.21k forks source link

Onvif probe fail to detect profiles #3767

Open allotherarenotavaliable opened 10 months ago

allotherarenotavaliable commented 10 months ago

Describe Your Environment

If the issue concerns a camera

Describe the bug This is camera problem and you need same model (or some other model with same problem) in order to reproduce bug. Anyway, this can be fixed in onvif error handling.

From main window choose "Add" and in monitor configuration window click on onvif.

I have tested camera behavior (new in onvif, not perl programmer) and have detected : GetProfiles is working without problem GetStreamUri crash because of broken response (I am guessing "next" is reading both profiles and GetStreamUri)

The problem is because character "&" is not properly encoded in response and that onvif crash because xml is not valid.

I have intercepted GetStreamUriResponse after GetStreamUri and broken part is in Uri

rtsp://10.10.10.10:554/user=admin_password=xxxxx=0_stream=0&onvif=0.sdp?real_stream</tt:Uri>

From my point of view solution would be to catch xml parse error, check raw output for malformed responses and try to parse response again. something like ... Replace("&", "&");

(Yes, I understand this is camera wrong response, not soap bug but looks like many camera models have same problem and this would be nice improvement to handle error and fix this error)

I am new in zoneminder and not linux programmer but have a lot experience in IT so fell free to contact me for more details if this is not clear.

Camera is identified from broadcast with two lines for two soap version I2P3C-model@<1.1.1.1> using version 1.[1-2]

welcome[bot] commented 10 months ago

Thanks for opening your first issue here! Just a reminder, this forum is for Bug Reports only. Be sure to follow the issue template!

Magical-Lin commented 9 months ago

same OS ubuntu 22.04.3 LTS, my camera onvif port is 8090, but i cant not check my camera at onvif network searching. so can we add the funtion that custom onvif IP and port ?

allotherarenotavaliable commented 9 months ago

same OS ubuntu 22.04.3 LTS, my camera onvif port is 8090, but i cant not check my camera at onvif network searching. so can we add the funtion that custom onvif IP and port ?

Discovery (probe) is UDP broadcast. I guess your camera is not onvif if this is not found. Alternative is that you are not on same sub network or your router is not forwarding those packets

Magical-Lin commented 9 months ago

same OS ubuntu 22.04.3 LTS, my camera onvif port is 8090, but i cant not check my camera at onvif network searching. so can we add the funtion that custom onvif IP and port ?

Discovery (probe) is UDP broadcast. I guess your camera is not onvif if this is not found. Alternative is that you are not on same sub network or your router is not forwarding those packets

but i can use ONVIF Device Manager to find it ,and can custom ip:port to connect it via onvier that android app. image

connortechnology commented 9 months ago

Can we please get the output from zmonvif-probe.pl -v profiles?

I don't see why a & in a url would be invalid... is it not utf8? Is that what you are saying? Technically we could try to sanitise the response before soap parsing... but this feels very wrong.

Magical-Lin commented 9 months ago

same OS ubuntu 22.04.3 LTS, my camera onvif port is 8090, but i cant not check my camera at onvif network searching. so can we add the funtion that custom onvif IP and port ?

Discovery (probe) is UDP broadcast. I guess your camera is not onvif if this is not found. Alternative is that you are not on same sub network or your router is not forwarding those packets

Currently, zoneminder does not support custom onvif IP to automatic setting function, so i use odm2.2.2 to find the rtsp url that fill in Source Path, it work. image

By the way, on Android apps, if searching funtion is not work , we can custom onvif url, just simply fill in the 'host address,port ,user and password' to automatically complete the settings, including PTZ. it is userfull in NAT traversal, cross segment access. Ah... at first i thought zoneminder could be like this.