getRTSPStreamUri() returns two ports in the string :80:554
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
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.
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.