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. ONVIF Java Library by Milgo
Non-Profit, Analytics, Security
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:1466519819@qq.com
头衔: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
Atitit java onvif 开源类库 getProfiles getStreamUri的更多相关文章
- 浅谈 Java 主流开源类库解析 XML
在大型项目编码推进中,涉及到 XML 解析问题时,大多数程序员都不太会选用底层的解析方式直接编码. 主要存在编码复杂性.难扩展.难复用....,但如果你是 super 程序员或是一个人的项目,也不妨一 ...
- java使用开源类库Tesseract实现图片识别
Tesseract-OCR支持中文识别,并且开源和提供全套的训练工具,是快速低成本开发的首选. Tess4J则是Tesseract在Java PC上的应用 Tesseract的OCR引擎最先由HP实验 ...
- Atitit 图像处理 常用8大滤镜效果 Jhlabs 图像处理类库 java常用图像处理类库
Atitit 图像处理 常用8大滤镜效果 Jhlabs 图像处理类库 java常用图像处理类库1.1. 5种常用的Photoshop滤镜,分别针对照片的曝光.风格色调.黑白照片处理.锐利度.降噪这五大 ...
- 【转】java开源类库pinyin4j的使用
最近CMS系统为了增加查询的匹配率,需要增加拼音检索字段,在网上找到了pinyin4j的java开源类库,提供中文转汉语拼音(并且支持多音字), 呵呵,看了看他的demo,决定就用它了,因为我在实际使 ...
- Java 的 JSON 开源类库选择比较(zz)
在看了作者的介绍,然后我又到mvnrepository上去看了各个库的的使用数之后,发现只能在jackson和gson之间做选择. 以下是原文 有效选择七个关于Java的JSON开源类库 April ...
- java开源类库pinyin4j的使用
最近CMS系统为了增加查询的匹配率,需要增加拼音检索字段,在网上找到了pinyin4j的java开源类库,提供中文转汉语拼音(并且支持多音字), 呵呵,看了看他的demo,决定就用它了,因为我在实际使 ...
- atitit.java解析sql语言解析器解释器的实现
atitit.java解析sql语言解析器解释器的实现 1. 解析sql的本质:实现一个4gl dsl编程语言的编译器 1 2. 解析sql的主要的流程,词法分析,而后进行语法分析,语义分析,构建sq ...
- Atitit java集成内嵌浏览器与外嵌浏览器attilax总结
Atitit java集成内嵌浏览器与外嵌浏览器attilax总结 HTML5将颠覆原生App世界.这听起来有点危言耸听,但若认真分析HTML5的发展史,你会发现,这个世界的发展趋势确实就是这样. 熟 ...
- 一些iOS高效开源类库
因为iOS SDK相对比较底层,所以开发者就得受累多做一些体力活.不过幸运的是,有很多第三方的类库可以用来简化很多不必要的工作.笔者整理了一下在本人学习过程中用到的一些比较有用Objective-C开 ...
随机推荐
- Angular2入门系列教程1-使用Angular-cli搭建Angular2开发环境
一直在学Angular2,百忙之中抽点时间来写个简单的教程. 2016年是前端飞速发展的一年,前端越来越形成了(web component)组件化的编程模式:以前Jquery通吃一切的田园时代一去不复 ...
- 用scikit-learn学习主成分分析(PCA)
在主成分分析(PCA)原理总结中,我们对主成分分析(以下简称PCA)的原理做了总结,下面我们就总结下如何使用scikit-learn工具来进行PCA降维. 1. scikit-learn PCA类介绍 ...
- .NET Core 首例 Office 开源跨平台组件(NPOI Core)
前言 最近项目中,需要使用到 Excel 导出,找了一圈发现没有适用于 .NET Core的,不依赖Office和操作系统限制的 Office 组件,于是萌生了把 NPOI 适配并移植到 .NET C ...
- iOS开发系列--打造自己的“美图秀秀”
--绘图与滤镜全面解析 概述 在iOS中可以很容易的开发出绚丽的界面效果,一方面得益于成功系统的设计,另一方面得益于它强大的开发框架.今天我们将围绕iOS中两大图形.图像绘图框架进行介绍:Quartz ...
- ABP框架 - Swagger UI 集成
文档目录 本节内容: 简介 Asp.net Core 安装 安装Nuget包 配置 测试 Asp.net 5.x 安装 安装Nuget包 配置 测试 简介 来自它的网页:“...使用一个Swagger ...
- ExtJS 4.2 Grid组件的单元格合并
ExtJS 4.2 Grid组件本身并没有提供单元格合并功能,需要自己实现这个功能. 目录 1. 原理 2. 多列合并 3. 代码与在线演示 1. 原理 1.1 HTML代码分析 首先创建一个Grid ...
- Cocos2d Android 环境搭建
1.在开始之前,需要先准备好资源如下,如果安卓开发环境有了直接装第3.4. 1.JDK 点击下载 (1.6) 2.ADT(已经自带Android SDK)点击下载 3.NDK 点击下载 4. ...
- VS15 preview 5打开文件夹自动生成slnx.VC.db SQLite库疑惑?求解答
用VS15 preview 5打开文件夹(详情查看博客http://www.cnblogs.com/zsy/p/5962242.html中配置),文件夹下多一个slnx.VC.db文件,如下图: 本文 ...
- 手把手教你做个人 app
我们都知道,开发一个app很大程度依赖服务端:服务端提供接口数据,然后我们展示:另外,开发一个app,还需要美工协助切图.没了接口,没了美工,app似乎只能做成单机版或工具类app,真的是这样的吗?先 ...
- Android快乐贪吃蛇游戏实战项目开发教程-06虚拟方向键(五)绘制方向键箭头
本系列教程概述与目录:http://www.cnblogs.com/chengyujia/p/5787111.html本系列教程项目源码GitHub地址:https://github.com/jack ...