Atitit onvif协议获取rtsp地址播放java语言attilx总结
1.2.Onvif摄像头的发现,ws的发现机制,使用xcf类库1
2.调用getStreamUri 获得rtsp地址 ,使用类库ONVIF Java Library by Milgo2
1.1. 获取rtsp地址的算法与流程
动态发现onvif设备
调用getProfiles 获取Profile列表,
调用getStreamUri 获得rtsp地址( 使用Profile参数)
1.2. Onvif摄像头的发现,ws的发现机制,使用xcf类库
Onvif协议建立在webservice协议基础上。他的发现机制就是ws的发现机制。。
import java.util.List;
import javax.xml.ws.EndpointReference;
import org.apache.cxf.ws.discovery.WSDiscoveryClient;
public class Main
{
public static void main(String[] args)
{
WSDiscoveryClient client = new WSDiscoveryClient();
client.setVersion10(); // use WS-discovery 1.0
client.setDefaultProbeTimeout(1000); // timeout 1s
System.out.println("Probe:" + client.getAddress());
List<EndpointReference> references = client.probe();
System.out.println("Nb answsers:" + references.size());
for (EndpointReference ref : references)
{
System.out.println(ref.toString());
}
}
}
Probe is :soap.udp://239.255.255.250:3702
Nb answsers:1
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><EndpointReference xmlns="http://www.w3.org/2005/08/addre