linkingvision

Similar documents
linkingvision

linkingvision

linkingvision

linkingvision


¬¬

B

暴风云视点播解决方案

ebook71-13

目 录 概 述 背 景 社 会 背 景 行 业 背 景 需 求 分 析..6 3 优 势 分 析 资 源 优 势 品 牌 优 势 技 术 优 势 用 户 体 验.....

<4D F736F F D20C8EDBCFEB9A4B3CCCFEEC4BFD0E8C7F3B5F7D1D0B1A8B8E6B7B6B1BE>

WebSphere Studio Application Developer IBM Portal Toolkit... 2/21 1. WebSphere Portal Portal WebSphere Application Server stopserver.bat -configfile..

来 正 式 组 织 关 系 转 出 后 未 收 到 组 织 关 系 介 绍 信 回 执 的 党 员 排 查 的 主 要 任 务 是, 核 查 党 员 身 份 信 息, 摸 清 流 动 党 员 底 数, 理 顺 党 员 组 织 关 系, 健 全 完 善 党 员 档 案, 对 与 党 组 织 失 去 联

關於本書 l 3 PhoneGap Appcelerator Titanium Sencha Touch (wrapper framework) Native App PhoneGap Build Native App Hybrid App Java Objective-C Android SDK

FileMaker 15 WebDirect 指南

IC-900W Wireless Pan & Tilt Wireless Pan & Tilt Remote Control / Night Vision FCC ID:RUJ-LR802UWG

專業式報告

專業式報告

要 及 时 为 入 党 积 极 分 子 确 定 两 名 培 养 联 系 人, 进 行 联 络 帮 助 要 定 期 ( 每 季 度 至 少 一 次 ) 听 取 培 养 联 系 人 的 思 想 和 工 作 情 况 汇 报, 及 时 完 成 入 党 积 极 分 子 登 记 表 ( 见 附 件 2) 的 填

jdbc:hsqldb:hsql: jdbc:hsqldb:hsqls: jdbc:hsqldb:http: jdbc:hsqldb:https: //localhost // :9500 / /dbserver.somedomain.com /an_alias /enrollme


1

ebook140-9

Adobe AIR 安全性

bingdian001.com

¬¬

Microsoft Word - AQSI doc

湖北省政府采购中心

<4D F736F F D203120BBA5C1AACDF8BBF9B4A1B1EAD7BC2E646F63>

汉王PDF转换RTF文档

自由軟體教學平台

自由軟體教學平台

Kubenetes 系列列公开课 2 每周四晚 8 点档 1. Kubernetes 初探 2. 上 手 Kubernetes 3. Kubernetes 的资源调度 4. Kubernetes 的运 行行时 5. Kubernetes 的 网络管理理 6. Kubernetes 的存储管理理 7.

1

哈尔滨应用职业技术学院2012年教育教学质量报告

untitled

<4D F736F F D B9E3B6ABCAA1CBAEC0FBB9A4B3CCCAD3C6B5BCE0BFD8CFB5CDB3BCBCCAF5B9E6B7B6A3A8CAD4D0D0A3A9C7A9B7A22E646F63>

生命科学学院 学年度学风建设实施方案

运用多媒体提升实验教学有效性的研究.doc

1.加入党组织主要经过哪些程序?

SA29 Simplified Chinese user manual

目 录 1. 前 言 为 什 么 要 用 ESB 技 术 发 展 业 务 需 求 IT 需 求 IT 与 业 务 一 致 性 要 求 TongIntegrator ESB v5 简 介..

untitled

untitled

0 1!, 10,,,,,, ( 1) 1 ( ) ( ) ( ) ( ) , , 7 10, 600,

P4i45GL_GV-R50-CN.p65

專業式報告

26 头 孢 他 啶 注 射 剂 27 头 孢 他 美 酯 口 服 常 释 剂 型 28 头 孢 吡 肟 注 射 剂 29 头 孢 硫 脒 注 射 剂 30 头 孢 唑 肟 注 射 剂 31 头 孢 替 安 注 射 剂 32 头 孢 哌 酮 注 射 剂 33 头 孢 哌 酮 舒 巴 坦 注 射 剂


口 行 政 管 理 部 门 进 行 安 全 条 件 审 查 未 经 安 全 条 件 审 查 通 过, 港 口 建 设 项 目 不 得 开 工 建 设 第 六 条 交 通 运 输 部 指 导 监 督 全 国 港 口 建 设 项 目 安 全 条 件 审 查 工 作 国 务 院 国 家 发 展 改 革 委

Basic System Administration

投 身 基 层 建 功 立 业 政 治 部 主 任 李 继 耐 上 将 的 批 示 ( 照 片 ) 国 防 生, 梦 想 之 翼 能 飞 多 远? 对 清 华 大 学 国 防 生 走 基 层 之 路 的 追 踪 与 思 考 清 华 学 子 国 防 生 岱 天 荣 摄 - 1 -

PL600 IPPBX 用户手册_V2.0_.doc

PIC_SERVER (11) SMTP ( ) ( ) PIC_SERVER (10) SMTP PIC_SERVER (event driven) PIC_SERVER SMTP 1. E-

Microsoft Word - 正文.doc

精 神 與 自 然 : 楊 慈 湖 心 學 研 究 趙 燦 鵬 哲 學 博 士 嶺 南 大 學 二 零 零 五 年

SA1MXX Chinese user manual

安 全 信 息 此 摄 像 机 适 用 于 室 内 安 装 使 用 若 要 安 装 于 室 外, 需 要 配 合 使 用 室 外 防 护 罩 ( 不 提 供 ) 开 启 摄 像 机 前, 请 确 保 所 用 电 源 符 合 要 求 使 用 不 适 当 的 电 源 可 能 会 损 坏 摄 像 机 请

VioCard-300 user manual

untitled

untitled

<30312E20B9EFB7C5AF66BEC7A4A4A175A5CDAC7ABE69B3B1A176AABABDD7AA522E706466>

Microsoft Word - 小心翼翼的二十一點N.doc

手册 doc

User ID 150 Password - User ID 150 Password Mon- Cam-- Invalid Terminal Mode No User Terminal Mode No User Mon- Cam-- 2

六盘水人资社保发〔2013〕137号

一 土 地 市 场 1 土 地 供 应 2016 年 第 19 周 (2016 年 5 月 2 日 2016 年 5 月 8 日 ), 北 京 供 应 土 地 0 宗 2016 年 第 19 周 北 京 房 地 产 市 场 土 地 供 应 一 览 表 地 块 面 积 宗 地 号 / 名 称 交 易

untitled

警告 Segway PT PT PT PT PT PT PT PT PT PT PT PT PT PT PT PT PT PT LeanSteer PT PT PT Segway PT PT PT / Segway PT PT / PT 1.5 5

自由軟體教學平台



untitled

ext-web-auth-wlc.pdf

chapter 2 HTML5 目錄iii HTML HTML HTML HTML HTML canvas

KDC-U5049 KDC-U4049 Made for ipod, and Made for iphone mean that an electronic accessory has been designed to connect specifically to ipod, or iphone,

Avigilon Control Center 6 ACC High Definition Stream Management (HDSM) ACC 6 ( Avigilon Appearance Search ) Avigilon Appearance Search ACC NVR HD Vide

Cisco WebEx Meetings Server 2.6 版常见问题解答

产品手册

untitled

(Real-time) (Local Host) (Buffer) (Video Conference) (VoD) (NetRadio) ,000 [1]( ) ( ) 1400 (2001 ) 75 (2005 ) DFC Intelligence [2] 1

温州市政府分散采购

MASQUERADE # iptables -t nat -A POSTROUTING -s / o eth0 -j # sysctl net.ipv4.ip_forward=1 # iptables -P FORWARD DROP #

0 配置 Host MIB 设备 V ( 简体版 ) 0 Update: 2016/1/30

2

(Methods) Client Server Microsoft Winsock Control VB 1 VB Microsoft Winsock Control 6.0 Microsoft Winsock Control 6.0 1(a). 2

工程师培训

IP505SM_manual_cn.doc

AXIS P7224 Video Encoder Blade – Installation Guide

3. 企 业 债 券 : 公 司 债 券 : 5. 证 券 公 司 债 券 : 6. 企 业 短 期 融 资 券 : 7. 中 期 票 据 : 8. 资 产 支 持 证 券 : 9. 国 际 开 发 机 构 人 民 币 债 券 : 10. 中 小 非 金 融 企 业 集 合 票 据 例 题? 判 断

epub 61-2

“一带一路”(江苏南通)建设集合债券

Partition Key: 字 符 串 类 型, 表 示 当 前 Entity 的 分 区 信 息 这 个 Property 对 于 Table Service 自 动 纵 向 和 横 向 扩 展 至 关 重 要 Row Key: 字 符 串 类 型, 在 给 定 Partition Key 的

深圳市跨境易电子商务有限公司

ebook140-8

Microsoft Word - VC2K_ _cht.doc


新建 Microsoft Word 文档.doc

(%) (%) 14 [ ] [] [] [] [] [] [] [] [] [] [] [] []


Transcription:

linkingvision H5STREAM API 手册 Copyright 2018 All rights reserved h5stream 用户手册, 版本 1.00 页 1

版本记录 版本日期描述 1.00 2018/04/03 第一个版本 1.01 2018/04/25 r4.2 1.02 2018/05/05 r5.0 1.0.3 2018/07/14 r6.0 拆分 API 手册 1.0.4 2019/04/96 r8.0 加入设备 SDK api h5stream 用户手册, 版本 1.00 页 2

h5stream 用户手册, 版本 1.00 页 3

内容 1.0 发布说明... 5 1.1 版本 1.00... 5 2.0 范围... 5 3.0 参考链接... 5 4.0 常用术语... 6 5.0 HTTP/HTTPS RESTFUL 接口... 7 5.1 协议格式... 7 5.2 系统... 8 5.3 视频源和设备管理... 12 5.4 扩展 ONVIF 支持... 28 5.5 录像管理... 31 5.6 云推流管理... 43 5.7 流管理... 45 6.0 JS API 接口... 47 6.1 JS 对象参数... 47 6.2 Websocket... 48 6.3 WebRTC... 48 6.4 HLS... 49 6.5 RTMP... 49 h5stream 用户手册, 版本 1.00 页 4

1.0 发布说明 1.1 版本 1.00 初始版本. 2.0 范围 文档包含 h5stream 互联网直播方案的 API 定义 3.0 参考链接 ONVIF https://www.onvif.org/ h5stream 用户手册, 版本 1.00 页 5

4.0 常用术语 h5stream 用户手册, 版本 1.00 页 6

5.0 HTTP/HTTPS RESTFUL 接口 RESTFUL 接口是基于 HTTP 的简单的无状态的协议, 所有的请求采取 GET 方法,HTTP 返回都 采用 JSON 格式. 调试的时候可以使用 HTTP, 在实际的生产环境中建议使用 HTTPS 为了方便 后续的例子都是用 HTTP, 如果换 HTTPS, 只需要把对应的 http 换成 https 即可 5.1 协议格式 所有的请求都采用 HTTP GET, 返回采用 JSON 格式, 具体返回的 JSON 格式根据不同的命令 而不同, 下表是基本的格式和例子, 为了让大家更容易理解, 有些命令介绍中直接使用 代表性的值 格式 : Request : http://server/api/v1/<resources>?para=xxx &< >=< > "bstatus": true/false, "strcode": "xxxxxx" < >=< > 代表多个请求参数. 例子 : Request : http://localhost:8080/api/v1/addsrconvif?name=name1&token=token4&user=ad min&password=12345&ip=192.168.0.234&port=80&onvifaddr=/onvif/device_serv ice&session=c1782caf-b670-42d8-ba90-2244d0b0ee83 "bstatus": true, "strcode": "Add successfully" h5stream 用户手册, 版本 1.00 页 7

5.2 系统 5.2.1 登录 URL: /api/v1/login Request :http://server/api/v1/login?user=xxx&password=xxx "bstatus": true, "strsession": "c1782caf-b670-42d8-ba90-2244d0b0ee83", "ntimeout": 600 or "bstatus": false, "strcode": "xxxxxx" 参数是否可选描述 user 必须用户名默认为 admin password 必须密码默认为 12345 5.2.2 登出 URL: /api/v1/logout h5stream 用户手册, 版本 1.00 页 8

Request :http://server/api/v1/logout?session=xxxxxxxxxxxxxxxx "bstatus": true/false, "strcode": "xxxxxx" 参数是否可选描述 5.2.3 保活 URL: /api/v1/keepalive Request :http://server/api/v1/keepalive?session=xxxxxxxxxxxxxxxx "bstatus": true/false, "strcode": "xxxxxx" 参数是否可选描述 5.2.4 获取系统信息 URL: /api/v1/getsysteminfo h5stream 用户手册, 版本 1.00 页 9

Request :http://server/api/v1/getsysteminfo?session=xxxxxxxxxxxxxxxx "strversion": "r4.0.0403.18", "strhostid": "xxxxxxxxx", "strlicensetype": "None", "strlicensefull": "", "strchannellimit": "unlimited", "strendtime": "unlimited" 参数是否可选描述 5.2.5 获取编解码信息 URL: /api/v1/ GetCodecInfo Request :http://server/api/v1/getcodecinfo?session=xxxxxxxxxxxxxxxx "strcpumodel": "Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz", "strhwencoders": "H.264 H.265 VP9", "strhwdecoders": "H.264 H.265 VP8 VP9", "strswencoders": "H.264 VP8 VP9", "strswdecoders": "H.264 H.265 VP8 VP9" h5stream 用户手册, 版本 1.00 页 10

参数是否可选描述 5.2.6 获取运行信息 URL: /api/v1/getruninfo Request :http://server/api/v1/getruninfo?session=xxxxxxxxxxxxxxxx "strruntime": "0H 23MIN", "strcpu": "16%", "strmemory": "39%", "strnetworkin": "0kpbs", "strnetworkout": "0kpbs" 参数是否可选描述 5.2.7 更改用户名密码 URL: /api/v1/ UpdateUser h5stream 用户手册, 版本 1.00 页 11

Request :http://server/api/v1/ UpdateUser?user=admin&oldpassword=827ccb0eea8a706c4c34a16891f84e7b&newpa ssword=xxxxxx&session=xxxxxx "bstatus": true, "strcode": "Update user successfully" user 必须 user name oldpassword 必须 原来的密码 (MD5) newpassword 必须 新的密码 (MD5) 5.3 视频源和设备管理 5.3.1 获取源列表 URL: /api/v1/getsrc h5stream 用户手册, 版本 1.00 页 12

Request :http://server/api/v1/getsrc?token=xxx&session=xxxxxxx "src": [ "ntype": "H5_ONVIF", "strname": "name1", "strtoken": "token1", "strurl": "rtsp://192.168.0.1/stream", "struser": "admin", "strpasswd": "******", "bpasswdencrypt": false, "benableaudio": false, "nconnecttype": "H5_AUTO", "nrtsptype": "H5_RTSP_AUTO", "strsrcipaddress": "192.168.100.184", "strsrcport": "80", "nchannelnumber": 1, "bonvifprofileauto": true, "stronvifaddr": "/onvif/device_service", "stronvifprofilemain": "Profile_1", "stronvifprofilesub": "Profile_2", "bonline": true, "strsnapshoturl": "/api/v1/getimage?token=token1", "brec": false, "strservertoken": "",// 该 token 为注册的 h5stream token "stroriginaltoken": "", "strserveruuid": "" ] or "bstatus": false, "strcode": "xxxxxx" getonline 可选 true/false 是否获取在线状态, 默认是获取, 由于有些设备 SDK 如果有离线设备的话获取在线状态比较慢, 可以设置为 false 加速该 API token 可选 获取源的 token, 如果空表示所有 h5stream 用户手册, 版本 1.00 页 13

5.3.2 添加文件源 URL: /api/v1/addsrcfile Request :http://server/api/v1/ AddSrcFile?name=xxx&token=xxx&url=xxx&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx" token 必须 添加源的 token name 必须 该源的名字 url 必须 文件在服务器上路径, 路径需要转义, 可以使用 在线转义工具 http://tool.chinaz.com/tools/urlencode.aspx C:\xdev\h5s-r4.0.0403.18-win64- release\h5ssample.mp4 转义成 : C%3a%5cxdev%5ch5s-r4.0.0403.18-win64- release%5ch5ssample.mp4 servertoken 可选添加到注册的 h5stream( 下个版本 ) 添加后该源的 token 会映射一个新的 token, 需要重新 GetSrc 获取 audio 可选 true 或者 false, 默认是 false h5stream 用户手册, 版本 1.00 页 14

5.3.3 添加 RTSP RTMP 源 URL: /api/v1/addsrcrtsp Request :http://server/api/v1/addsrcrtsp?name=xxx&token=xxx &user=admin&password=12345&url=rtsp://192.168.0.1/stream&session=x xxxxx "bstatus": true/false, "strcode": "xxxxxx" h5stream 用户手册, 版本 1.00 页 15

token 必须 添加源的 token name 必须 该源的名字 user 可选 RTSP 用户名 password 必须 RTSP 密码 url 必须 RTSP RTMP 地址需要转义, 可以使用在线转义 工具 http://tool.chinaz.com/tools/urlencode.aspx rtsp://192.168.0.23:554/streaming/channels/101?transportmode=unicast&profile=profile_1 转义成 : rtsp%3a%2f%2f192.168.0.23%3a554%2fstreaming %2fChannels%2f101%3ftransportmode%3dunicast %26profile%3dProfile_1 servertoken 可选 添加到注册的 h5stream( 下个版本 ) playback 可选 true/false 默认 false speed 可选 0.5,1.0,2.0,4.0 默认 1.0 audio 可选 true 或者 false, 默认是 false 5.3.4 添加 ONVIF 源 URL: /api/v1/addsrconvif h5stream 用户手册, 版本 1.00 页 16

Request :http://server/api/v1/addsrconvif?name=name1&token=token1 &user=admin&password=12345&ip=192.168.0.1 &port=80&onvifaddr=/onvif/device_service&main=profile_1&sub=profile_2&se ssion=xxxxxx "bstatus": true/false, "strcode": "xxxxxx" token 必须 添加源的 token name 必须 该源的名字 user 必须 ONVIF 用户名 password 必须 ONVIF 密码 ip 必须 ONVIF 设备地址 port 必须 ONVIF 设备端口 onvifaddr 可选 ONIVF 服务地址, 默认 /onvif/device_service main 可选 主码流 token sub 可选 辅码流 token servertoken 可选 添加到注册的 h5stream( 下个版本 ) audio 可选 true 或者 false, 默认是 false 5.3.5 添加 RTMP 推流源 URL: /api/v1/addrtmppush h5stream 用户手册, 版本 1.00 页 17

Request :http://server/api/v1/addrtmppush?name=xxx&token=xxxsession=xxxx xx "bstatus": true/false, "strcode": "xxxxxx" token 必须 添加源的 token name 必须 该源的名字 5.3.6 删除源 URL: /api/v1/delsrc Request :http://server/api/v1/delsrc?token=token1&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx" 参数是否可选描述 token 必须删除源 h5stream 用户手册, 版本 1.00 页 18

5.3.7 获取设备列表 URL: /api/v1/getdevice Request :http://server/api/v1/getdevice?token=xxx&session=xxxxxxx "dev": [ "ntype": "H5_DEV_HIK", "strname": "Device 1", "strtoken": "device1", "struser": "admin", "strpasswd": "12345", "bpasswdencrypt": false, "strdevipaddress": "192.168.100.103", "strdevport": "8000", "bonline": true ] or "bstatus": false, "strcode": "xxxxxx" getonline 可选 true/false 是否获取在线状态, 默认是获取, 由于有些设备 SDK 如果有离线设备的话获取在线状态比较慢, 可以设置为 false 加速该 API token 可选 获取设备的 token, 如果空表示所有 h5stream 用户手册, 版本 1.00 页 19

5.3.8 获取设备源列表 URL: /api/v1/getdevicesrc Request :http://server/api/v1/getdevicesrc?token=xxx&session=xxxxxxx "src": [ "ntype": "H5_CH_DEV", "strname": "Camera 01", "strtoken": "device1--33", "strurl": "", "struser": "", "strpasswd": "", "bpasswdencrypt": false, "benableaudio": false, "nconnecttype": "H5_ALWAYS", "nrtsptype": "H5_RTSP_TCP", "strsrcipaddress": "", "strsrcport": "", "nchannelnumber": 0, "bonvifprofileauto": false, "stronvifaddr": "", "stronvifprofilemain": "", "stronvifprofilesub": "", "brtspplayback": false, "nrtspplaybackspeed": 0, "bonline": true, "strsnapshoturl": "/api/v1/getimage?token=device1--33", "brec": false, "strservertoken": "", "stroriginaltoken": "", "strserveruuid": "", "noriginaltype": "H5_ZERO" ] or "bstatus": false, "strcode": "xxxxxx" h5stream 用户手册, 版本 1.00 页 20

getonline 可选 true/false 是否获取在线状态, 默认是获取, 由于有些设备 SDK 如果有离线设备的话获取在线状态比较慢, 可以设置为 false 加速该 API token 必须 获取源列表设备的 token 5.3.9 获取 GB 设备列表 URL: /api/v1/getgbdevice Request :http://server/api/v1/getgbdevice?token=xxx&session=xxxxxxx "dev": [ "ntype": "H5_DEV_GB", "strname": "34020000001180000012", "strtoken": "34020000001180000012", "struser": "", "strpasswd": "", "bpasswdencrypt": false, "strdevipaddress": "", "strdevport": "", "benableaudio": false, "bonline": true ] or "bstatus": false, "strcode": "xxxxxx" h5stream 用户手册, 版本 1.00 页 21

token 可选 获取设备的 token, 如果空表示所 有 5.3.10 获取 GB 设备源列表 URL: /api/v1/getgbdevicesrc h5stream 用户手册, 版本 1.00 页 22

Request :http://server/api/v1/getgbdevicesrc?token=xxx&session=xxxxxxx "src": [ "ntype": "H5_CH_GB", "strname": " 海康枪机 ", "strtoken": "34020000121320000001", "strurl": "", "struser": "", "strpasswd": "", "bpasswdencrypt": false, "benableaudio": false, "nconnecttype": "H5_ALWAYS", "nrtsptype": "H5_RTSP_TCP", "strsrcipaddress": "", "strsrcport": "", "nchannelnumber": 0, "bonvifprofileauto": false, "stronvifaddr": "", "stronvifprofilemain": "", "stronvifprofilesub": "", "brtspplayback": false, "nrtspplaybackspeed": 0, "bonline": true, "strsnapshoturl": "/api/v1/getimage?token=34020000121320000001", "brec": false, "strpushurl": "", "strservertoken": "", "stroriginaltoken": "", "strserveruuid": "", "noriginaltype": "H5_ZERO" ] or "bstatus": false, "strcode": "xxxxxx" 参数是否可选描述 token 可选获取源列表 GB 设备的 token h5stream 用户手册, 版本 1.00 页 23

5.3.11 添加海康设备 URL: /api/v1/ AddDeviceHik Request :http://server/api/v1/adddevicehik?name=name1&token=token1 &user=admin&password=12345&ip=192.168.0.1&port=8000&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx" token 必须 添加设备的 token name 必须 该源的名字 user 必须 设备用户名 password 必须 设备密码 ip 必须 设备设备地址 port 必须 设备设备端口 audio 可选 true 或者 false, 默认是 false 5.3.12 添加大华设备 URL: /api/v1/ AddDeviceDh h5stream 用户手册, 版本 1.00 页 24

Request :http://server/api/v1/adddevicedh?name=name1&token=token1 &user=admin&password=12345&ip=192.168.0.1&port=37777&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx" token 必须 添加设备的 token name 必须 该源的名字 user 必须 设备用户名 password 必须 设备密码 ip 必须 设备设备地址 port 必须 设备设备端口 audio 可选 true 或者 false, 默认是 false 5.3.13 删除设备 URL: /api/v1/deldevice h5stream 用户手册, 版本 1.00 页 25

Request :http://server/api/v1/deldevice?token=token1&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx" 参数是否可选描述 token 必须删除源 5.3.14 云台操作 URL: /api/v1/ptz Request :http://server/api/v1/ Ptz?token=token1&action=left&speed=0.5&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx" h5stream 用户手册, 版本 1.00 页 26

token 必须 ONIVF 视频源 token action 必须 云台指令 up/down/left/right/ zoomin/zoomout/stop / preset speed 可选 stop 指令可以不带 speed 范围为 0-1 可以是小数 preset 可选 指定的预置点 5.3.15 设置预置点 URL: /api/v1/ SetPreset Request :http://server/api/v1/ SetPreset?token=token1& &presetname=2&presettoken=2&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx" h5stream 用户手册, 版本 1.00 页 27

token 必须 ONIVF 视频源 token presetname 必须 preset 名字比如 1,2,3 presettoken 必须 preset token 比如 1,2,3 5.3.16 删除预置点 URL: /api/v1/ DelPreset Request :http://server/api/v1/ DelPreset?token=token1& & presettoken=2&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx" token 必须 ONIVF 视频源 token presettoken 必须 preset token 比如 1,2,3 5.4 扩展 ONVIF 支持 5.4.1 搜索 ONVIF 设备 URL: /api/v1/onvifsearch h5stream 用户手册, 版本 1.00 页 28

Request :http://server/api/v1/onvifsearch?timeout=10&session=xxxxxx "device": [ "strip": "192.168.0.23", "strport": "80", "stronvifaddr": "/onvif/device_service", "strmodel": "xxx-xxx" ] timeout 可选 搜索时长, 单位是秒默认 10 秒 servertoken 可选 在注册的 h5stream 搜索 ( 下个版本 ) 5.4.2 探测 ONVIF 设备 URL: /api/v1/onvifprobe h5stream 用户手册, 版本 1.00 页 29

Request :http://server/api/v1/ OnvifProbe?ip=192.168.0.1&port=80&user=admin&password=12345&onvifaddr=/o nvif/device_service&session=xxxxxx "profile": [ "strtoken": "Profile_1", "strcodecname": "H264", "strname": "H264 1920 x 1080 25fps 3072bps", "strrtspurl": "rtsp://192.168.0.23:554/streaming/channels/101?transportmode=unicast&pr ofile=profile_1", "nwidth": 1920, "nheight": 1080, "nfps": 25, "nbandwidth": 0, "bgoturl": true ] Or "bstatus": false, "strcode": "can't connect device" user 必须 ONVIF 设备用户名 password 必须 ONVIF 设备密码 ip 必须 ONVIF 设备 IP 地址 port 必须 ONVIF 设备端口 onvifaddr 可选 ONVIF 服务地址 servertoken 可选 在注册的 h5stream 探测 ( 下个版本 ) h5stream 用户手册, 版本 1.00 页 30

5.5 录像管理 5.5.1 录像 (deprecated 使用 ManualRecordStart 代替 ) URL: /api/v1/record Request :http://server/api/v1/record?token=token1&duration=100&filename= xxxxx&&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx", "strfilename": "token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.mp4", "strurl": "/mediastore/record/token1/2019-05-10tz08/16-02-19/ token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.mp4" token 必须 视频源 token duration 必须 录像时长 filename 可选 录像文件名, 如果空, 自动生成文件名, 文件名不用带文件扩展 5.5.2 手动录像开始 URL: /api/v1/ ManualRecordStart h5stream 用户手册, 版本 1.00 页 31

Request :http://server/api/v1/ ManualRecordStart?token=token1& session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx", "strfilename": "token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.mp4", "strurl": "/mediastore/record/token1/2019-05-10tz08/16-02-19/ token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.mp4" token 必须 视频源 token alwayscreate 可选 true/false 是否创建新的 session limittime 可选 如果一直创建 session, 录像到这个时间自动停止, 单位是秒 5.5.3 手动录像停止 URL: /api/v1/ ManualRecordStop Request :http://server/api/v1/ ManualRecordStop?token=token1& session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx" h5stream 用户手册, 版本 1.00 页 32

token 必须 视频源 token filename 可选 如果一直创建 session 的时候可以使用返回的 filename 停止对应的 session 5.5.4 指定路径录像 (deprecated 使用 ManualRecordStart 代替 ) URL: /api/v1/pathrecord Request :http://server/api/v1/pathrecord?token=token1&start1=2019-5- 10&start2=16-2-19&duration=100&tz=8&filename=xxxxx& alwayscreate=true &session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx", "strfilename": "token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.mp4", "strurl": "/mediastore/record/token1/2019-05-10tz08/16-02-19/ token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.mp4" h5stream 用户手册, 版本 1.00 页 33

参数是否可选描述 token 必须视频源 token duration 必须录像时长 start1 必须开始时间 1 2018-3-29 年 - 月 - 日 start2 必须开始时间 2 20-3-29 小时 - 分钟 - 秒 可以按下面路径直接访问录像 /mediastore/record/token1/2018-3-29tz8/20-3-29/filename.mp4 tz 可选 8 或者 -8, 如果没有此参数默认使用服务器所在的时区 filename 必须 录像文件名, 文件名不用带文件扩展 alwayscreate 可选 true 或者 false, 默认 flase, 是否永远创建新文件, 如果没有该选项, 如果录像正在进行, 则会在原来的 基础上延长对应的时长 5.5.5 快照 URL: /api/v1/snapshot h5stream 用户手册, 版本 1.00 页 34

Request :http://server/api/v1/ Snapshot?token=token1&filename=xxxxx&&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx", "strfilename": "token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.jpg", "strurl": "/mediastore/snapshot/token1/2019-05-10tz08/15-59-42/ token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.jpg" token 必须 视频源 token filename 可选 快照文件名, 如果空, 自动生成文件名, 文件名不用带文件扩展 5.5.6 按路径快照 (deprecated 使用 Snapshot 代替 ) URL: /api/v1/pathsnapshot Request :http://server/api/v1/ PathSnapshot?token=token1&start1=2019-5- 10&start2=15-59-42&tz=8&filename=xxxxx&&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx", "strfilename": "token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.jpg", "strurl": "/mediastore/snapshot/token1/2019-05-10tz08/15-59-42/ token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.jpg" h5stream 用户手册, 版本 1.00 页 35

参数是否可选描述 token 必须视频源 token start1 必须开始时间 1 2018-3-29 年 - 月 - 日 start2 必须开始时间 2 20-3-29 小时 - 分钟 - 秒 可以按下面路径直接访问快照 /mediastore/snapshot/token1/20 18-3-29TZ8/20-3- 29/filename.jpg tz 可选 8 或者 -8, 如果没有此参数默认使 用服务器所在的时区 filename 必须快照文件名, 文件名不用带文件扩 展 5.5.7 回放快照 URL: /api/v1/pbsnapshot Request :http://server/api/v1/ PbSnapshot?token=token1& pbsession=xxxxxx&&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx", "strfilename": "token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.jpg", "strurl": "/mediastore/snapshot/token1/2019-05-10tz08/15-59-42/ token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.jpg" h5stream 用户手册, 版本 1.00 页 36

token 必须 视频源 token pbsession 必须 回放 session id, 回放接口可以回调改 id 5.5.8 归档 URL: /api/v1/archive Request :http://server/api/v1/archive?token=34020000001320010201&start1= 2019-5-10&start2=10-37-6&duration=100&tz=8&session=xxxxxx "bstatus": true/false, "strcode": "xxxxxx", "strfilename": "34020000001320010201-15040fb4-f51c-465d-a335- b539a72893a7.mp4", "strurl": "/mediastore/archive/34020000001320010201/2019-05-14tz08/10-37-15/34020000001320010201-15040fb4-f51c-465d-a335-b539a72893a7.mp4" h5stream 用户手册, 版本 1.00 页 37

参数是否可选描述 token 必须视频源 token duration 必须录像时长 start1 必须开始时间 1 2018-3-29 年 - 月 - 日 start2 必须开始时间 2 20-3-29 小时 - 分钟 - 秒 可以按下面路径直接访问录像 /mediastore/record/token1/2018-3-29tz8/20-3-29/filename.mp4 speed 可选 1,2,4,8,16 默认是 1 forceh264 可选 true /false 是否强制转码 H.265 到 H.264 tz 可选 8 或者 -8, 如果没有此参数默认使 用服务器所在的时区 5.5.9 归档状态获取 URL: /api/v1/ GetArchiveStatus h5stream 用户手册, 版本 1.00 页 38

Request :http://server/api/v1/getarchivestatus?token=device1-- 33&&filename=device1--33-4f2b2fd1-2615-43cd-b69eecb0796e1eae.mp4&&session=xxxxxx "strcode": "Archive status successfully", "npercentage": 100 (1-100,100 表示完成 ) token 必须 视频源 token filename 必须 Archive 返回的文件名 5.5.10 搜索 URL: /api/v1/search h5stream 用户手册, 版本 1.00 页 39

Request :http://server/api/v1/ Search?type=xxx&start=2018-03- 07T120101%2b08&end=2018-04-26T130101%2b08&token=xxx&session=xxxxxx "record": [ "strtoken": "token1", "strstarttime": "2018-04-25T19:32:05+08:00", "strduration": "301", "strpath": "/mediastore/record/token1/2018-4-25tz8/19-32- 5/1234.mp4", "strtoken": "token1", "strstarttime": "2018-04-25T19:37:05+08:00", "strduration": "0", "strpath": "/mediastore/record/token1/2018-4-25tz8/19-37- 5/1234.mp4" ] token 必须 视频源 token type 必须 record 或者 snapshot 或者 archive start 必须 ISO8601 格式时间 2018-03-07T120101+08 end 必须 ISO8601 格式时间 2018-03-07T130101+08 5.5.11 按文件名搜索 URL: /api/v1/searchbyfilename h5stream 用户手册, 版本 1.00 页 40

Request :http://server/ api/v1/searchbyfilename?type=record&token=token1&filename=token1- bf06fe80-0e0c-4b77-a337-296ae8eaaaaa&session=xxxxxx "record": [ "strtoken": "token1", "strstarttime": "2019-05-06T10:57:11Z", "strduration": "0", "strpath": "/mediastore/record/token1/2019-05-06tz08/10-57- 11/token1-984bebd4-c9a5-49f1-aa09-b44cd79d8c6d.mp4" ] token 必须 视频源 token type 必须 record 或者 snapshot 或者 archive filename 必须 录像返回的 strfilename 5.5.12 搜索设备录像 URL: /api/v1/searchdevicerecordbytime h5stream 用户手册, 版本 1.00 页 41

Request :http://server/api/v1/searchdevicerecordbytime?token=device1-- 33&start=2018-05-14T070101%2b08&end=2019-06- 20T080101%2b08&session=xxxxxx "bfinished": true, "record": [ "strstarttime": "2019-06-14T07:59:40+08:00", "strendtime": "2019-06-14T10:05:59+08:00", "ntype": "H5_REC_MANUAL", "strstarttime": "2019-06-14T10:05:59+08:00", "strendtime": "2019-06-14T12:26:28+08:00", "ntype": "H5_REC_MANUAL" ] token 必须 视频源 token start 必须 ISO8601 格式时间 2018-03-07T120101+08 end 必须 ISO8601 格式时间 2018-03-07T130101+08 5.5.13 搜索设备录像日历 URL: /api/v1/ SearchDeviceRecordCalendar h5stream 用户手册, 版本 1.00 页 42

Request :http://server/api/v1/ SearchDeviceRecordCalendar?token=device1- -33&year=2019&month=6&session=xxxxxx "record": [ "nday": 1, "bhasrec": true, "bhasalarmrec": false, "nday": 2, "bhasrec": true, "bhasalarmrec": false, token 必须 视频源 token year 必须 年 month 必须月 1-12 5.6 云推流管理 5.6.1 本地端注册信息获取 URL: /api/v1/getcloudclientinfo 用于获取内网 H5Stream 注册状态 h5stream 用户手册, 版本 1.00 页 43

Request :http://server/api/v1/ GetCloudClientInfo&session=xxxxxx "benable": true, "strservername": "Server 1", "strcloudip": "10.0.0.1", "strcloudport": "8080", "bssl": false, "struser": "admin", "bonline": true 参数是否可选描述 5.6.2 云端注册 Server 获取 URL: /api/v1/ GetServerList 用于获取云端注册上的 H5Stream server 列表 Request :http://server/api/v1/getserverlist&session=xxxxxx "server": [ "strservertoken": "fc2f0aa4-86ca-4d75-ad29-59b91326dfae", "strserverip": "192.168.0.1", "bonline": true ] h5stream 用户手册, 版本 1.00 页 44

参数是否可选描述 5.7 流管理 5.7.1 WS 连接信息获取 URL: /api/v1/h5swsapi/status Request :http://server/api/v1/h5swsapi/status&session=xxxxxx "nconnectcount": 2 参数是否可选描述 5.7.2 RTC 连接信息获取 URL: /api/v1/h5srtcapi/status h5stream 用户手册, 版本 1.00 页 45

Request :http://server/api/v1/h5srtcapi/status&session=xxxxxx "nconnectcount": 2 参数是否可选描述 h5stream 用户手册, 版本 1.00 页 46

6.0 JS API 接口 6.1 JS 对象参数 /** * @param var pbconf1 = begintime: '2019-03-23T120101+08',//string begintime endtime: '2019-03-23T150101+08',//string endtime serverpb: 'false', //'true' or 'false' playback from h5stream record, default false filename: 'device1--35-db72f624-050a-42b9-92fa-453875804453.mp4', // file name need to playback ; callback: PlaybackCB, //function(event(string), userdata(object)) userdata: user data // user data var conf = videoid:'h5svideo1', //string - id of the video element tag videodom: h5svideodom1, //object - video dom. if there has videoid, just use the videoid protocol: window.location.protocol, // string - 'http:' or 'https:' host: window.location.host, //string - 'localhost:8080' rootpath:window.location.pathname, // string - path of the app running token:'token1', // string - token of stream pbconf: pbconf1, //This is optional, if no pbconf, this will be live. hlsver:'v1', //string - v1 is for ts, v2 is for fmp4 session:'c1782caf-b670-42d8-ba90-2244d0b0ee83' //string - session got from login ; */ 当 pbconf 不存在的时候表示实时视频 当 serverpb 为 false 或者不存在的时候表示从 NVR 中回放, 从 NVR 中回放都采用按时间回放, 当 serverpb 为 true 表示从 h5s 的录像记录中回放, 从 h5s 回放有两种方式 : 按时间回放和按文件名回放, 当 begintime 和 endtime 都为 0 时表示按文件名回放, 按文件名回放的时候 h5stream 用户手册, 版本 1.00 页 47

filename 为录像指令返回的文件名, 比如 "strfilename": "107-e88c9fae-2c56-4329-b9e2- ec99dd36ab9d.mp4" 6.2 Websocket /** * Interface with h5s websocket player API * @constructor */ function H5sPlayerWS(conf) H5sPlayerWS.prototype.connect H5sPlayerWS.prototype.disconnect 回放 API H5sPlayerWS.prototype. start H5sPlayerWS.prototype. pasue H5sPlayerWS.prototype. resume H5sPlayerWS.prototype. speed(x) //x 0.5 1 2 4 8 16 H5sPlayerWS.prototype. seek(x) //x 相对开始回放时间的偏移单位为秒 6.3 WebRTC /** * Interface with h5s WebRTC player API * @constructor */ function H5sPlayerRTC(conf) H5sPlayerRTC.prototype.connect H5sPlayerRTC.prototype.disconnect 回放 API H5sPlayerWS.prototype. start H5sPlayerWS.prototype. pasue H5sPlayerWS.prototype. resume H5sPlayerWS.prototype. speed(x) //x 0.5 1 2 4 8 16 H5sPlayerWS.prototype. seek(x) //x 相对开始回放时间的偏移单位为秒 h5stream 用户手册, 版本 1.00 页 48

6.4 HLS /** * Interface with h5s websocket player API * @constructor */ function H5sPlayerHls(conf) H5sPlayerHls.prototype.connect H5sPlayerHls.prototype.disconnect 6.5 RTMP 为了支持老版本的一些浏览器,H5Stream 支持基于 Flash 的 RTMP 视频播放采用的播 放器是 videojs, 具体使用方法可以参考 www/rtmp.html, 如果需要支持双击全 h5stream 用户手册, 版本 1.00 页 49