onvif-java-lib icon indicating copy to clipboard operation
onvif-java-lib copied to clipboard

getRTSPStreamUri() returns two ports in the string :80:554

Open Skinah opened this issue 6 years ago • 2 comments

I may have found a bug.

Code used is... onvifCamera = new OnvifDevice("192.168.1.50:80", "user", "password"); some lines of code removed... rtspUri = onvifCamera.getMedia().getRTSPStreamUri(profileToken);

This returns the following:

rtsp://192.168.1.50:80:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif

Note the double port numbers which my guess is because I specified a port when creating the onvifdevice.

If I remove the extra port the url does work ie

rtsp://192.168.1.50:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif

Using this version Jar

https://github.com/milg0/onvif-java-lib/blob/master/release/onvif-2016-03-16.jar

Skinah avatar Jul 05 '19 09:07 Skinah

This may be camera specific behaviour. And since I do not have any camera to test, can you please check TCP traffic with Wireshark? Look for an GetStreamUri request.

milg0 avatar Jul 05 '19 17:07 milg0

I have the Same issue with two brands of cameras so i doubt it is the cameras at fault. Hikvision and amcrest both do it. I have other issues with PTZ and NPE errors so will grab wireshark out to look into this when I have some time.

Skinah avatar Jul 06 '19 11:07 Skinah