Atitit java onvif 开源类库 getProfiles getStreamUri

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. getProfiles  respones file

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

Request SOAP Message (GetStreamUri): <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><env:Header><wsse:Security><wsse:UsernameToken><wsse:Username/><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">K3vtv2ZkAdcl0DFdQz/cjBsPcU8=</wsse:Password><wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">MTQ4MzgwMzUyMw==</wsse:Nonce><wsu:Created>2016-12-21T15:04:00Z</wsu:Created></wsse:UsernameToken></wsse:Security></env:Header><env:Body><ns2:GetStreamUri xmlns:ns10="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns11="http://www.onvif.org/ver10/schema" xmlns:ns2="http://www.onvif.org/ver10/media/wsdl" xmlns:ns3="http://www.w3.org/2005/08/addressing" xmlns:ns4="http://docs.oasis-open.org/wsn/b-2" xmlns:ns5="http://docs.oasis-open.org/wsrf/bf-2" xmlns:ns6="http://docs.oasis-open.org/wsrf/rp-2" xmlns:ns7="http://docs.oasis-open.org/wsn/t-1" xmlns:ns8="http://www.w3.org/2004/08/xop/include" xmlns:xmime="http://www.w3.org/2005/05/xmlmime"><ns2:StreamSetup/><ns2:ProfileToken>PROFILE_000</ns2:ProfileToken></ns2:GetStreamUri></env:Body></env:Envelope>

Response SOAP Message (GetStreamUriResponse): <?xml version="1.0" encoding="UTF-8"?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:e="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:ter="http://www.onvif.org/ver10/error" ><s:Body><trt:GetStreamUriResponse><trt:MediaUri><tt:Uri>rtsp://192.168.31.144:10554/tcp/av0_0</tt:Uri><tt:InvalidAfterConnect>false</tt:InvalidAfterConnect><tt:InvalidAfterReboot>false</tt:InvalidAfterReboot><tt:Timeout>PT60S</tt:Timeout></trt:MediaUri></trt:GetStreamUriResponse></s:Body></s:Envelope>

getStreamUri:rtsp://192.168.31.144:10554/tcp/av0_0

1.4. Code---

package com.attilax.video;

/**

* @author attilax

*2016年12月21日 下午10:38:11

*/

import java.io.IOException;

import java.net.ConnectException;

import java.util.List;

import javax.xml.soap.SOAPException;

import org.onvif.ver10.media.wsdl.GetStreamUri;

import org.onvif.ver10.media.wsdl.GetStreamUriResponse;

import org.onvif.ver10.schema.Profile;

import org.onvif.ver10.schema.StreamSetup;

import org.onvif.ver10.schema.Transport;

import de.onvif.soap.OnvifDevice;

public class OnvifTest {

public static void main(String[] args) {

// org.apache.commons.codec.binary.Base64

// org.apache.commons.codec.binary.Base64

try {

// OnvifDevice nvt = new OnvifDevice("192.168.0.20", "admin",

// "password");

OnvifDevice nvt = new OnvifDevice("192.168.31.144:10080", "", "");

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

for (Profile profile : profiles) {

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

System.out.println(profile);

}

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

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

StreamSetup streamSetup = new StreamSetup();

String getStreamUri = nvt.getMedia().getStreamUri(profileToken, streamSetup);

System.out.println("getStreamUri:" + getStreamUri);

catch (ConnectException e) {

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

catch (SOAPException e) {

e.printStackTrace();

}

}

作者:: 绰号:老哇的爪子claw of Eagle 偶像破坏者Iconoclast image-smasher

捕鸟王"Bird Catcher 王中之王King of Kings 虔诚者Pious 宗教信仰捍卫者 Defender Of the Faith. 卡拉卡拉红斗篷 Caracalla red cloak

简称:: Emir Attilax Akbar 埃米尔 阿提拉克斯 阿克巴

全名::Emir Attilax Akbar bin Mahmud bin  attila bin Solomon bin adam Al Rapanui 埃米尔 阿提拉克斯 阿克巴 本 马哈茂德 本 阿提拉 本 所罗门 本亚当  阿尔 拉帕努伊

常用名:艾提拉(艾龙),  EMAIL:[email protected]

头衔:uke总部o2o负责人,全球网格化项目创始人,

uke宗教与文化融合事务部部长, uke宗教改革委员会副主席

,Uke部落首席大酋长,

uke制度与重大会议委员会委员长,uke保安部首席大队长,uke制度检查委员会副会长,

奶牛科技cto ,uke 首席cto

uke波利尼西亚区大区连锁负责人,克尔格伦群岛区连锁负责人,莱恩群岛区连锁负责人,uke汤加王国区域负责人。布维岛和南乔治亚和南桑威奇群岛大区连锁负责人

Uke软件标准化协会理事长理事长 uke终身教育学校副校长

Uke 数据库与存储标准化协会副会长 uke出版社编辑总编

Uke医院方面的创始人

转载请注明来源:attilax的专栏  ?http://www.cnblogs.com/attilax/

--Atiend

时间: 2024-08-07 16:45:06

Atitit java onvif 开源类库 getProfiles getStreamUri的相关文章

浅谈 Java 主流开源类库解析 XML

在大型项目编码推进中,涉及到 XML 解析问题时,大多数程序员都不太会选用底层的解析方式直接编码. 主要存在编码复杂性.难扩展.难复用....,但如果你是 super 程序员或是一个人的项目,也不妨一试. Jdom/Dom4j/Xstream... 基于底层解析方式重新组织封装的开源类库,简洁明了的 API,稳定高效的运行表现. Dom4j 基于 JAXP 解析方式,性能优异.功能强大.极易使用的优秀框架.想了解底层解析方式请翻看:浅谈 Java XML 底层解析方式 Jdom 你细看内部代码,

Atitit 图像处理 常用8大滤镜效果 Jhlabs 图像处理类库 java常用图像处理类库

1.1. 5种常用的Photoshop滤镜,分别针对照片的曝光.风格色调.黑白照片处理.锐利度.降噪这五大方向.坦11.2. Java Image Filters 是由 Jhlabs 开发的一组用来处理 Java 图像的类库,提供各种常用的图像处理效果,例如反转色.扭曲.水波纹.凹凸.黑白效果等等数十种效果,11.3. Photoshop CS6常用8大滤镜中文集合版31.4. 史上超强图像处理开源工具包--ImageMagick?41.5. Thumbnailator是一个用来生成图像缩略图的

atitit. java jsoup html table的读取解析 总结

atitit. java jsoup html table的读取解析 总结 1. 两个大的parser ,,,jsoup 跟个   htmlparser 1 2. 资料比较 1 3. jsoup越佳.. 1 4. 解析并提取 HTML 元素的模式( 选择器 and  DOM 方式 ) 2 5. html修改 2 6. 跟个htmlparse的比较 2 7. jsoup的用处 3 7.1. html解析 3 7.2. html修改 3 7.3. HTML 文档清理 3 8. code--读取解析表

IOS 一些开源类库

因 为iOS SDK相对比较底层,所以开发者就得受累多做一些体力活.不过幸运的是,有很多第三方的类库可以用来简化很多不必要的工作.笔者整理了一下在本人学习过程 中用到的一些比较有用Objective-C开源类库,既是做一个总结,同时也希望通过这些分享,能提高各位的开发效率. KissXml——xml解析库 相关教程: github:https://github.com/Threew/KissXML http://sencho.blog.163.com/blog/static/8305622820

Atitit.java&#160;jna&#160;&#160;调用c&#160;&#160;c++&#160;dll的原理与实践&#160;&#160;总结&#160;&#160;v2&#160;&#160;q27

Atitit.java jna  调用c  c++ dll的原理与实践  总结  v2  q27 1. Jna简单介绍1 2. Jna范例halo owrld1 3. Jna概念2 3.1. (1)需要定义一个接口,继承自Library 或StdCallLibrary2 3.2. 2)接口内部定义2 4. 数据类型映射 NA官方给出的默认类型映射表如下:3 5.  JNA能完全替代JNI吗?3 6. 参考4 1. Jna简单介绍 原来使用JNI,你必须手工用C写一个动态链接库,在C语言中映射Ja

Atitit.java&#160;jna&#160;调用c++&#160;dll&#160;的总结

Atitit.java jna 调用c++ dll 的总结 1. JNA技术解密1 1.1. JNA工作原理1 2. JNA技术难点 Java—C和操作系统数据类型的对应表1 2.1. 1 2.2. JNA编程过程3 2.2.1. 跨平台.跨语言调用的第一原则:就是尽量使用基本.简单的数据类型,尽量少跨语言.平台传递数据!4 3. 参考4 1. JNA技术解密 1.1. JNA工作原理 JNA是建立在JNI技术基础之上的一个Java类库,它使您可以方便地使用java直接访问动态链接库中的函数.

Android之开源类库Pinyin4j的使用----搜索联系人

Pinyin4j只能算是Java开源类库,但是在Android的应用开发中也经常被用到.大家都用过手机的通讯录,通讯录的搜索联系人的功能,用pinyin4j就可以实现.下面我给大家带来这个例子,使用pinyin4j实现搜索联系人功能. 首先先对pinyin4j做一个简单的介绍: pinyin4j是一个流行的Java库,支持中文字符和拼音之间的转换,拼音的输出格式也可以定制,并且支持汉字的多音字.pinyin4j的官方网是:http://pinyin4j.sourceforge.net/ piny

C#常用开源类库

一.AOP框架        Encase 是C#编写开发的为.NET平台提供的AOP框架.Encase 独特的提供了把方面(aspects)部署到运行时代码,而其它AOP框架依赖配置文件的方式.这种部署方面(aspects)的方法帮助缺少经验的开发人员提高开发效率. NKalore是一款编程语言,它扩展了C#允许在.net平台使用AOP.NKalore的语法简单.直观,它的编译器是基于Mono C#编译器(MCS).NKalore目前只能在命令行或#Develop内部使用.NKalore兼容公

[转]C#常用开源类库收集

.net PDF 类库 PDFsharp PDFsharp是一款可以让.NET框架支持的任何语言很容易的创建PDF文件的类库. ASP.NET FO PDF FO PDF 是一款C#编写类似于ASP.NET服务器控件的控件.它接受DataTable 和一些其它参数来创建XSL FO,并使用NFOP (Apache FOP Port in J#) PDF Formatter来绘制一个类似PDF Report 的DataGrid .今后将会增加更多的标签来可以生成XSL FO . Report.NE