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-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://blog.csdn.net/attilax

--Atiend

Atitit java onvif 开源类库 getProfiles getStreamUri相关推荐

  1. Java 使用开源类库 Tesseract 实现图片文字识别

    Tesseract-OCR支持中文识别,并且开源和提供全套的训练工具,是快速低成本开发的首选.Tess4J则是Tesseract在Java上的应用.Tess4J的官网地址为:http://tess4j ...

  2. java pdf 类库_有哪些可以给pdf加水印,java第三方开源类库?

    使用iText ,感觉还是比较简单的 具体代码: /** * * [功能描述:添加图片和文字水印] [功能详细描述:功能详细描述] * @param srcFile 待加水印文件 * @param d ...

  3. 推荐几个开源类库,超好用,远离996!

    今天给大家分享几个 Java 的开源类库,亲测非常好用! 有了它们之后,你就可以和很多重复劳动说再见了. 1. MapStruct MapStruct是干什么的? MapStruct是个代码产生器,它 ...

  4. java汉字转拼音maven_汉字转拼音的Java开源类库 – jpinyin

    jpinyin – A opensource java library for converting chinese to pinyin JPinyin是一个汉字转拼音的Java开源类库,在PinYi ...

  5. web3j官网的完整中文翻译(java开发区块链以太坊应用的开源类库)

    2019独角兽企业重金招聘Python工程师标准>>> web3j是一个轻量级.高度模块化.响应式.类型安全的Java和Android类库提供丰富API,用于处理以太坊智能合约及与以 ...

  6. Atitit.java jna  调用c  c++ dll的原理与实践  总结  v2  q27

    Atitit.java jna  调用c  c++ dll的原理与实践  总结  v2  q27 1. Jna简单介绍1 2. Jna范例halo owrld1 3. Jna概念2 3.1. (1)需 ...

  7. 阿里巴巴关于Java重要开源项目汇总

    点击上方"方志朋",选择"设为星标" 做积极的人,而不是积极废人 来源:segmentfault.com/a/1190000017346799 1.分布式应用服 ...

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

    atitit. java jsoup html table的读取解析 总结 1. 两个大的parser ,,,jsoup 跟个   htmlparser 1 2. 资料比较 1 3. jsoup越佳. ...

  9. .net开源框架开源类库(整理)

    常用库 Json.NET https://github.com/JamesNK/Newtonsoft.Json Json.Net 是一个读写Json效率比较高的.Net框架.Json.Net 使得在. ...

  10. java Linux icepdf,ICEpdf 6.1.1发布,Java的PDF类库

    ICEpdf 6.1.1发布,Java的PDF类库 发布时间:2016-04-05 09:32:56来源:红联作者:baihuo ICEpdf 6.1.1 发布了.ICEpdf 是一个轻量级的开源 J ...

最新文章

  1. Template Method (C++实现)
  2. python如何调用图片-用python简单处理图片(4):图像中的像素访问
  3. 里面使用轮播_小程序ColorUI框架初步使用教程及个人项目实战
  4. 【攻防世界008】answer_to_everything
  5. apt和apt-get的区别?为什么推荐使用apt?RedHat系列(rpm包、包管理工具yum)和Debian系列(deb包、包管理工具apt-get)区别?
  6. nginx上配置phpmyadmin
  7. 解决Qt-至少需要一个有效且已启用的储存库 问题
  8. RecyclerView嵌套RecyclerView报ViewHolder类型不匹配错误
  9. PHPCMS 模板标签
  10. PHP中去除换行解决办法小结(PHP_EOL)
  11. cannot+connect+mysql_mysqlnd cannot connect to MySQL 4.1+ using the old insecure
  12. 计算机怎么硬盘重做系统,怎么直接从硬盘装系统 直接从硬盘安装系统教程
  13. [51nod 1051 最大子矩阵和]前缀和+dp
  14. 冒险岛开服服务端教程自己搭建服务器需要那些东西
  15. 多伦多大学计算机专音乐专业,终于懂了加拿大音乐专业学院推荐
  16. Docker部署免安装版tomcat+mysql+其它乱七八糟软件(包含解释为什么这样安装及同理安装的其他方式)
  17. matlab求ra,RA调度算法及Matlab计算程序
  18. python 视频硬字幕提取 内嵌字幕提取工具
  19. 列表 元祖 字典
  20. GitHub使用教程详解(下)——Git的安装以及Git命令详解

热门文章

  1. qlabel显示图片同时鼠标点击画线_怎样将CAJ文档转成JPG图片?
  2. 路由器截获微信消息_猫(Modem)和路由器有什么区别?
  3. 恐龙机器人钢索恐龙形态_恐龙有的四脚行走有的两脚行走,有的会飞有的会游,差别咋这么大...
  4. webpack的CommonsChunkPlugin分析与优化
  5. Java处理Json数据
  6. ssh框架的构成分析和代码构架小结 .
  7. Visual Studio 2008 Designer.cs不能更新/自动添加控件声明的解决办法
  8. 在昆山的日子终于要结束了
  9. pytest框架(三)
  10. logback日志回顾整理--2018年8月8日