我使用OnVif java库,但它不起作用。如何使用onvif在ip camera中获取rtsp url android
try{
OnvifDevice nvt = new OnvifDevice(cameraIpAddr,cameraUsername,cameraPassword);
List<Profile> profiles=nvt.getDevices().getProfiles();
String profileToken=profiles.get(0).getToken();
String url= nvt.getMedia().getRTSPStreamUri(profileToken);
PtzDevices ptzDevices=nvt.getPtz();
org.onvif.ver10.schema.FloatRange
panRange=ptzDevices.getPanSpaces(profileToken);
org.onvif.ver10.schema.FloatRange tiltRange=
ptzDevices.getTiltSpaces(profileToken);
float zoom=ptzDevices.getZoomSpaces(profileToken).getMin();
float x=(panRange.getMax() + panRange.getMin())/2f;
float y=(tiltRange.getMax() + tiltRange.getMin())/2f;
if(ptzDevices.isAbsoluteMoveSupported(profileToken)){
ptzDevices.absoluteMove(profileToken,x,y,zoom);
}
}catch (ConnectException ex){
ex.printStackTrace();
}catch (SOAPException ex){
ex.printStackTrace();
}
在Android Studio中,SOAPException
类未找到,我使用的外部jar的gradle却未能打造添加类的SoapException请给我对Java和Android onvif client
例如然后通知我。
请给我参考了网上使用的Android
请检查我的回答得到RTSP URL。 –