Atitit java onvif 开源类库 getProfiles getStreamUri

本文介绍了如何使用Milgo的ONVIF Java库与IP安全设备进行交互,包括获取设备配置、媒体信息、图像设置和PTZ控制。示例代码展示了如何获取相机的快照URI和流URI,适用于系统集成商和开发者。
摘要由CSDN通过智能技术生成

Atitit java onvif 开源类库 getProfiles getStreamUri

 

1. ONVIF Java Library by Milgo1

1.1. https://github.com/milg0/onvif-java-lib4

1.2. getProfiles  respones file4

1.3. getStreamUri:rtsp://192.168.31.144:10554/tcp/av0_04

1.4. Code---5

 

1. ONVIF Java Library by Milgo

Non-ProfitAnalyticsSecurity

The ONVIF Java library by Milgo aims to be the first library to interact with the API features related to standardize communication between IP-based security products. ONVIF stands for open network video interface forum. ONVIF API is targeted to installers, system integrators, architects, engineers, and end users.

nvifDevice nvt = new OnvifDevice("192.168.0.20", "admin", "password");

nvt.getDevices(); // Basic methods for configuration and information

nvt.getMedia(); // Methods to get media information like stream or screenshot URIs or to change your video encoder configuration

nvt.getImaging(); // A few functions to change your image settings, really just for your image settings!

nvt.getPtz(); // Functionality to move your camera (if supported!)

Our first goal is to get a snapshot URI of our camera (not every must support this, but most NVT should do). So we will work on with our media methods and there are some methods to achieve our goal. Don't get irritated by the fact that there are methods to get snapshot- and screenshot-URIs, they return the same and have just different names.

getDefaultSnapshotUri() : String

getSnapshotUri(profileToken : String) : String

 

 

You can get your device profiles with the initial devices.

OnvifDevice nvt = new OnvifDevice("192.168.0.20", "admin", "password");

List<Profile> profiles = nvt.getDevices().getProfiles();

 

 

snapshot URI.

import java.net.ConnectException;

import java.util.List;

 

import javax.xml.soap.SOAPException;

 

import org.onvif.ver10.schema.Profile;

 

import de.onvif.soap.OnvifDevice;

 

public class OnvifTest {

   public static void main(String[] args) {

      try {

         OnvifDevice nvt = new OnvifDevice("192.168.0.20", "admin", "password");

         List<Profile> profiles = nvt.getDevices().getProfiles();

         String profileToken = profiles.get(0).getToken();

         System.out.println("Snapshot URI: "+nvt.getMedia().getSnapshotUri(profileToken));

      }

      catch (ConnectException e) {

         System.err.println("Could not connect to NVT.");

      }

      catch (SOAPException e) {

         e.printStackTrace();

      }

   }

}

1.1. https://github.com/milg0/onvif-java-lib

1.2. 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值