获取视频流信息
功能介绍
此接口用于获取指定视频流的详细信息。
URI
- URI格式
GET /v1/{project_id}/streams/{stream_name}
- 参数说明
参数
是否必选
类型
说明
project_id
是
String
项目ID,获取方法请参见获取项目ID。
stream_name
是
String
视频流名称。
请求消息
请求样例:
GET /v1/{project_id}/streams/stream1
响应消息
- 响应样例1(接入类型为RTMP)
{ "access_type": "RTMP", "updated_at": "2018-12-25T12:59:37Z", "share_type": "PUBLIC", "stream_id": "stream-qGjdxQZM", "access_key": "xxxxxx", "name": "stream1", "created_at": "2018-12-25T12:59:37Z", "description": "", "state": "ACTIVE", "tag": [ { "key": "group", "value": "number1" } ], "retention": { "bucket": "iva-lyest", "path": "estRetention/", "timezone": "GMT+08:00", "retention_in_hour": 1, "retention_forever": false, "store_type": "OBS", "state": "ACTIVE", "slice_in_minute": 5 }, "stream_flow_info": { "bw_out": "100 Kb/s", "bw_in": "100 Kb/s", "bytes_out": "131.469 MB", "bw_video": "100 Kb/s", "bytes_in": "110.28 MB", "num_play_clients": "2", "bw_audio": "100 Kb/s", "is_publishing": true, "meta": { "video": { "codec": "H264", "width": "400", "hieght": "600" } } }, "encode_type": "H264" }
- 响应样例2(接入类型为HTTP-FLV)
{ "access_type": "HTTP-FLV", "updated_at": "2018-12-25T12:59:37Z", "share_type": "PUBLIC", "stream_id": "stream-qGjdxQZM", "url": " https://xxxxxxxx.com/live", "name": "stream1", "created_at": "2018-12-25T12:59:37Z", "description": "", "state": "ACTIVE", "tag": [ { "key": "group", "value": "number1" } ], "retention": { "bucket": "iva-lyest", "path": "estRetention/", "timezone": "GMT+08:00", "retention_in_hour": 1, "retention_forever": false, "store_type": "OBS", "state": "ACTIVE", "slice_in_minute": 5 }, "stream_flow_info": { "bytes_out": "131.469 MB", "bytes_in": "110.28 MB", "is_publishing": false }, "encode_type": "H264" }
- 响应样例3(接入类型为GB28181设备)
{ "access_type": "GB28181", "created_at": "2019-01-28T07:57:21Z", "description": "", "stream_flow_info": { "bw_out": "0 Kb/s", "bw_in": "102.883 Kb/s", "bytes_out": "15.775 GB", "bw_video": "102.883 Kb/s", "bytes_in": "17.412 GB", "meta": { "video": { "codec": "H264", "width": "704", "height": "576" } }, "num_play_clients": "0", "bw_audio": "0 Kb/s", "is_publishing": true }, "updated_at": "2019-01-28T07:57:21Z", "share_type": "PUBLIC", "stream_id": "stream-WUj44AxR", "access_key": "xxxxxx", "name": "channel_98123990461320078447", "state": "ACTIVE", "retention_state": "ACTIVE", "transfer_protocol": "TCP", "tag": [], "retention": { "bucket": "obs-j323", "path": "", "timezone": "GMT+08:00", "retention_in_hour": 3, "retention_forever": false, "store_type": "OBS", "slice_in_minute": 5 }, "encode_type": "" }
- 参数说明
参数
类型
说明
access_type
String
视频接入类型(例如HTTP-FLV、RTMP、GB28181)。
updated_at
String
视频流更新时间。
share_type
String
视频流共享类型:- PRIVATE:非共享。
- PUBLIC:共享。
stream_id
String
视频流ID。
access_key
String
RTMP视频流的密钥。接入类型(access_type)为RTMP时,才有该参数。
url
String
HTTP-FLV视频流的地址。接入类型(access_type)为HTTP-FLV时,才有该参数。
transfer_protocol
String
GB视频传输协议(TCP|UDP)。只有当视频介入类型为GB28181时,才有该参数。
name
String
视频流名称。
created_at
String
视频流创建时间。
description
String
视频流描述信息。
state
String
视频流状态:- ACTIVE:表示已激活。
- STOPPED:表示已停用。
默认为STOPPED。
tag
Array of tag objects
和视频流关联的标签,参见Tag参数结构说明。
retention
Object
转储信息,参见retention参数说明。
stream_flow_info
Object
视频流推流信息,参见stream_flow_info参数说明。
encode_type
String
视频流编码格式。
retention_state
String
按视频流转储状态过滤,可选值为
- ACTIVE:表示已启用转储。
- STOPPED:表示未启用转储。
不区分大小写。
- retention参数说明
参数
类型
说明
retention_in_hour
Float
保存时长,以小时为单位。
Retention_forever
Boolbean
是否永久保存。
store_type
String
转储位置,可为“obs”,即存储到华为云对象存储OBS上。
bucket
String
OBS桶名。
path
String
OBS目录。
timezone
String
时区信息。
slice_in_minute
Float
分片长度,以分钟为单位。
取值范围为1~60,默认为5。
- stream_flow_info参数说明
参数
类型
说明
is_publishing
Boolean
视频流是否在推流/拉流:
- 如果是RTMP类型,则表示是否正在推流。
- 如果是HTTP-FLV类型,则表示是否正在从URL中拉取视频数据。
bw_out
String
出流带宽。
正在推流(即is_publishing为true)时会返回该字段。
bw_in
String
入流带宽。
正在推流(即is_publishing为true)时会返回该字段。
bw_video
String
视频带宽。
正在推流(即is_publishing为true)时会返回该字段。
bw_audio
String
音频带宽。
正在推流(即is_publishing为true)时会返回该字段。
bytes_out
String
出流总量。
bytes_in
String
入流总量。
num_play_clients
Integer
正在拉取该视频流数据的客户端数量。
正在推流(即is_publishing为true)时会返回该字段。
meta
Object
实时推流视频流元数据。
正在推流(即is_publishing为true)时会返回该字段。
video
Object
推流视频流视频相关数据。
codec
String
视频编码格式。
width
String
视频分辨率水平方向像素。
height
String
视频分辨率垂直方向像素。
返回值
- 正常
- 异常
返回值
说明
400 Bad Request
请求错误。具体返回错误码请参考错误码说明。
401 Unauthorized
鉴权失败。
403 Forbidden
没有操作权限。
404 Not Found
找不到资源或没有开通服务。
500 Internal Server Error
服务内部错误。
503 Service Unavailable
服务不可用。
