海康监控视频对接

您所在的位置:网站首页 视频监控端口是指 海康监控视频对接

海康监控视频对接

2023-03-21 23:00| 来源: 网络整理| 查看: 265

1.引用

com.hikvision.ga artemis-http-client 1.1.3

2.工具类(海康)

/** * 分页获取监控点资源 * @param pageNo * @param pageSize * @param treeCode * @return */ public static JSONArray getCameras(Integer pageNo, Integer pageSize, String treeCode) { System.out.println("getCameras="); /** * STEP1:设置平台参数,根据实际情况,设置host appkey appsecret 三个参数. */ ArtemisConfig.host = "host"; // 平台的ip端口 ArtemisConfig.appKey = "appKey"; // 密钥appkey ArtemisConfig.appSecret = "appSecret";// 密钥appSecret /** * STEP2:设置OpenAPI接口的上下文 */ final String ARTEMIS_PATH = "/artemis"; /** * STEP3:设置接口的URI地址 */ final String previewURLsApi = ARTEMIS_PATH + "/api/resource/v1/cameras"; Map path = new HashMap(2) { { put("https://", previewURLsApi);//根据现场环境部署确认是http还是https } }; /** * STEP4:设置参数提交方式 */ String contentType = "application/json"; /** * STEP5:组装请求参数 */ JSONObject jsonBody = new JSONObject(); jsonBody.put("pageNo", pageNo); jsonBody.put("pageSize",pageSize); jsonBody.put("treeCode", treeCode); String body = jsonBody.toJSONString(); /** * STEP6:调用接口 */ String result = ArtemisHttpUtil.doPostStringArtemis(path, body, null, null, contentType, null);// post请求application/json类型参数 System.out.println("result="+result); if (null != result && !"".equals(result)) { JSONObject jsonObject = JSONObject.parseObject(result); if (jsonObject.getJSONObject("data") != null) { return jsonObject.getJSONObject("data").getJSONArray("list"); } else { return null; } } else { return null; } }

3.前端

(1)直接把官网下载即可,联调的时候只能在内网进行

(2)把demo复制到服务器,直接跑,装个插件即可

(3)将demo里面的html,改成自己需要的文件,比如 vue

4.具体文档

下载插件

下载地址:https://open.hikvision.com/download/5c67f20bb254d61550c2f63e?type=10

安装视频播放插件:

运行demo,以视频预览为例: 修改demo中的ip、ak、sk

用谷歌浏览器打开网页:



【本文地址】


今日新闻


推荐新闻


    CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3