约定
- 所有接口使用http协议进行交互
- 所有接口的返回数据格式为json, code为0时表示操作成功,其它值表示操作失败,失败原因可以通过message获取
错误码说明
错误码 | 描述 |
---|---|
10201111 | 操作失败 |
10200001 | 对象不存在 |
10200002 | 对象已存在 |
10200003 | 检测到非法参数,请确认参数传递是否正确 |
10200004 | 操作数据库异常 |
10200005 | 获取用户信息失败 |
10200006 | 没有对应资源权限 |
10200007 | 操作太频繁,请稍后再试 |
10200101 | 频道名称重复 |
10001 | 频道不存在 |
10005 | 创建频道失败 |
10009 | 频道直播中 |
10200105 | 频道未在直播中 |
10010 | 频道直播中或没有源流 |
10011 | 频道没有源流 |
10015 | 超过最大输出限制 |
10016 | 频道启动中,请勿重复操作 |
10017 | 没有直播权限 |
10200111 | 直播缩略图间隔非法 |
10200112 | 输入源解析失败 |
10200113 | 修改频道失败 |
10200114 | 删除频道失败 |
10200115 | 启动频道失败 |
10200116 | 创建在线转码任务失败 |
10200201 | 频道记录修改失败 |
10200301 | 频道logo名称重复 |
10200302 | 频道logo创建失败 |
10200303 | 频道logo修改失败 |
10200304 | 频道logo删除失败 |
10200401 | 频道未在直播中,无法进行录制 |
10200402 | 无录制权限 |
10200403 | 录制任务已存在 |
10200404 | 录制任务不存在 |
10200405 | 频道不存在,无法进行录制 |
10200406 | 输出组未配置录制 |
10200407 | 录制任务id为空 |
10200408 | 录制时间较短,未生成点播视频 |
10200701 | 模版名称重复 |
10200702 | 模版创建失败 |
10200703 | 模版修改失败 |
10200704 | 模版删除失败 |
10200705 | 模版在使用中,无法操作 |
10200801 | 时移任务为空 |
10200802 | 无时移权限 |
10201001 | 类型名称重复 |
10201002 | 类型创建失败 |
10201003 | 类型修改失败 |
10201004 | 类型删除失败 |
10200707 | 当前分辨率或帧率超过普通编码上限,请切换其他编码类型 |
10200708 | 当前分辨率或帧率超过上限,请降低参数 |
直播频道管理
创建频道
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveCreateChannel | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
另外在HTTP数据包的body中以JSON的形式传入直播频道创建的参数,将Http header中的Content-Type设置为application/json,具体参数如下:
参数名称 | 是否必须 | 描述 |
name | 是 | String, 频道名称 |
signalType | 是 | String,源流类型 1.推流 2.拉流 |
pullStream | 否 | String,拉流地址,源流类型为拉流时必填 |
liveType | 否 | Integer,直播类型,0.普通直播 2.VR直播 3.进阶直播,不传默认跟随模版类型 |
typeName | 否 | String, 类型名称 |
type | 否 | String, 频道类型(为直播分类id==typeid) |
outputGroupList.protocolType | 是 | Integer,直播输出组协议类型 1.hls 2.rtmp |
outputGroupList.rtmpThirdPartyOutputUrl | 否 | String,第三方推流地址,rtmp协议下可以选填 |
outputGroupList.rotation | 否 | String,画面旋转度数。取值0或90或270 |
outputGroupList.isRecord | 否 | String,是否启用录制,0.不启用 1.启用,默认0 |
outputGroupList.needToMp4 | 否 | String,录制的文件是否转mp4,0.否 1.是,默认0 |
outputGroupList.isTimeShift | 否 | String,是否启用时移,0.不启用 1.启用,默认0。只有HLS协议下才可以启用时移 |
outputGroupList.timeShiftDuration | 否 | String,时移时长,在启用时移的情况下必填(单位小时) |
outputGroupList.isLiveEncrypt | 否 | String,是否启用加密,0.不启用 1.启用,默认0。,只有HLS协议下才可以启用加密 |
outputGroupList.logoId | 否 | String,直播logoId |
outputGroupList.outputTemplateList.templateId | 是 | String,直播模板id |
outputGroupList.outputTemplateList.isDefault | 是 | String,是否默认,0.否 1.是 |
请求参数示例:
{
"name": "测试新增普通频道",
"signalType": 1,
"liveType": 0,
"outputGroupList": [{
"protocolType": "1",
"isRecord": "1",
"isTimeShift": "1",
"timeShiftDuration": "2",
"isLiveEncrypt": "0",
"logoId": "",
"outputTemplateList": [{
"templateId": "786ee85ebb7c4dad8e75bc836a55a948",
"isDefault": "0"
},
{
"templateId": "6c01632990dc412b911cc7ba0b45885a",
"isDefault": "1"
}]
},
{
"protocolType": "2",
"isRecord": "1",
"outputTemplateList": [{
"templateId": "6c01632990dc412b911cc7ba0b45885a",
"isDefault": "1"
}]
}]
}
返回数据:
{
"code": 0,
"message": "操作成功",
"result": {
"id": "377fc5664a8a4af189d3cec73aef1d76",
"name": "测试新增普通频道",
"description": null,
"authCode": "R5CG75",
"type": null,
"typeName": null,
"signalType": "1",
"stream": "p1u0enox_h27zhXg5",
"pullStream": null,
"pullTaskId": null,
"status": 0,
"streamStatus": 2,
"userId": 106,
"streamWidth": null,
"streamHeight": null,
"streamBitrate": null,
"streamAudioBitrate": null,
"streamFrameRate": null,
"createTime": null,
"updateTime": null,
"startTime": null,
"endTime": null,
"autoEndTime": null,
"thumbnailUrl": "http://p1u0enox.images.danghongyun.local/thumbnail/377fc5664a8a4af189d3cec73aef1d76.jpg",
"pushUrl": "rtmp://rtmp-push.danghongyun.dev/live/p1u0enox_h27zhXg5",
"publicPlayUrl": "rtmp://172.17.230.223/live/p1u0enox_h27zhXg5",
"publicFlvPlayUrl": "http://172.17.230.223:1936/live/p1u0enox_h27zhXg5.flv",
"liveType": 0,
"deviceId": null,
"fillInfo": null,
"outputGroupList": [{
"id": "56ddd4ae7657409a8e11e0965d6daac4",
"name": null,
"protocolType": 1,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"taskId": null,
"isLiveEncrypt": "0",
"customerId": null,
"contentId": null,
"createTime": null,
"updateTime": null,
"liveLogoId": "",
"liveLogo": null,
"logoId": "",
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": null,
"isTimeShift": "1",
"timeShiftDuration": "2",
"timeShiftTaskId": null,
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "786ee85ebb7c4dad8e75bc836a55a948",
"displayName": "标清",
"transcodeType": 0,
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 3,
"updateTime": null,
"name": "标清/450kbps/720x576"
},
{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "674651cba44a4d5581b8b30cfce57e2c",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/377fc5664a8a4af189d3cec73aef1d76/56ddd4ae7657409a8e11e0965d6daac4.m3u8",
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"liveOutputGroupId": "56ddd4ae7657409a8e11e0965d6daac4",
"liveTemplateId": "786ee85ebb7c4dad8e75bc836a55a948",
"createTime": 1542693039000,
"updateTime": null,
"isDefault": "0"
},
{
"id": "74b371f694fe4367b6fada19de172476",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/377fc5664a8a4af189d3cec73aef1d76/56ddd4ae7657409a8e11e0965d6daac4.m3u8",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"liveOutputGroupId": "56ddd4ae7657409a8e11e0965d6daac4",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542693039000,
"updateTime": null,
"isDefault": "1"
}]
},
{
"id": "07072e7335e743a8a6d2221ef0f8a1b1",
"name": null,
"protocolType": 2,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"taskId": null,
"isLiveEncrypt": null,
"customerId": null,
"contentId": null,
"createTime": null,
"updateTime": null,
"liveLogoId": null,
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": null,
"isTimeShift": null,
"timeShiftDuration": null,
"timeShiftTaskId": null,
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "daeddb298ba543e4a3b323b5d8afee1e",
"publicOutputUrl": "rtmp://172.17.230.223/live/p1u0enox_07072e7335e743a8a6d2221ef0f8a1b1",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 2,
"userId": 106,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"liveOutputGroupId": "07072e7335e743a8a6d2221ef0f8a1b1",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542693039000,
"updateTime": null,
"isDefault": "1"
}]
}]
},
"success": true
}
返回字段说明
code:状态码
message:状态描述
result:返回实体信息
success:成功/失败
id:频道id
name:频道名称
description:频道描述
authCode:授权码
type:频道类型Id
typeName:类型名称
signalType:源流类型 1.推流 2.拉流
app:推流端app
stream:流名称
clientId:推流客户端id
thumbnailUrl:源流图片地址
status:频道状态 0. 初始化 1.就绪 2.直播中 3.拉流中 5启动中
streamStatus:流状态 1-正常 2-无源
userId:用户id
streamWidth:源流宽
streamHeight:源流高
streamBitrate:源流码率
streamAudioBitrate:源音频码率
createTime:创建时间
updateTime:更新时间
startTime:直播开始时间
endTime:直播结束时间
autoEndTime:直播自动结束时间
pushUrl:推流地址
publicPlayUrl:源流rtmp播放地址
publicFlvPlayUrl:源流flv播放地址
liveType:直播类型,0:普通直播、2:VR直播、3:1080P直播
deviceId:设备id-与库管系统的设备进行绑定
fillInfo:垫片信息
outputGroupList:输出组信息列表
id:id,直播输出组唯一标识符
name:直播输出组名称
protocolType:直播输出组协议类型 1.hls 2.rtmp
channelId:所属频道id
taskId:任务Id
isLiveEncrypt:是否加密 1加密 0不加密
customerId:加密秘钥1
contentId:加密秘钥2
createTime:创建时间
updateTime:更新时间
liveLogoId:直播Logo id
liveLogo:直播logo信息
logoId:直播Logo id
rtmpThirdPartyOutputUrl:rtmp第三方输出地址
isRecord:是否录制,0.否 1.是
recordTaskId:当前录制任务id
recordStartTime:录制开始时间
needToMp4:录制的文件是否转mp4,1.是 0.否
isTimeShift:是否时移,0.否 1.是
timeShiftDuration:时移时长,单位小时
timeShiftTaskId:时移任务Id
rotation:旋转度数
outputTemplateList:直播模板列表
id:直播模版id
name:模版名称/码率/宽x高
displayName:模版名称
transcodeType:直播类型,0:普通直播、2:VR直播、3:1080P直播,
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
frameRate:视频帧率
type:模板类型 1.用户模板 2.系统模板
userId:用户id,如果是系统的模板,此项为空
createTime:创建时间
updateTime:更新时间
liveOutputs:输出信息
id:唯一标识
publicOutputUrl:输出播放地址
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
protocolType:直播分组协议类型 1.hls 2.rtmp
userId:用户id
channelId:所属直播频道id
liveOutputGroupId:所属直播输出组id
liveTemplateId:直播模板Id
createTime:创建时间
updateTime:更新时间
isDefault:1. 默认 0.不默认
修改频道
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveUpdate | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
另外在HTTP数据包的body中以JSON的形式传入直播频道修改的参数,将Http header中的Content-Type设置为application/json,具体参数如下:
参数名称 | 是否必须 | 描述 |
id | 是 | String, 频道id |
name | 是 | String, 频道名称 |
signalType | 是 | String,源流类型 1.推流 2.拉流 |
pullStream | 否 | String,拉流地址,源流类型为拉流时必填 |
liveType | 否 | Integer,直播类型,0.普通直播 2.VR直播 3.进阶直播,不传默认跟随模版类型 |
typeName | 否 | String, 类型名称 |
type | 否 | String, 频道类型(为直播分类id==typeid) |
outputGroupList.id | 否 | String,输出组Id,不填时会把原输出组清除并创建新的输出组,如需保持原播放地址不变必须带上此Id |
outputGroupList.protocolType | 是 | Integer,直播输出组协议类型 1.hls 2.rtmp |
outputGroupList.rtmpThirdPartyOutputUrl | 否 | String,第三方推流地址,rtmp协议下可以选填 |
outputGroupList.rotation | 否 | String,画面旋转度数。取值0或90或270 |
outputGroupList.isRecord | 否 | String,是否启用录制,0.不启用 1.启用,默认0 |
outputGroupList.needToMp4 | 否 | String,录制的文件是否转mp4,0.否 1.是,默认0 |
outputGroupList.isTimeShift | 否 | String,是否启用时移,0.不启用 1.启用,默认0。只有HLS协议下才可以启用时移 |
outputGroupList.timeShiftDuration | 否 | String,时移时长,在启用时移的情况下必填(单位小时) |
outputGroupList.isLiveEncrypt | 否 | String,是否启用加密,0.不启用 1.启用,默认0。,只有HLS协议下才可以启用加密 |
outputGroupList.logoId | 否 | String,直播logoId |
outputGroupList.outputTemplateList.templateId | 是 | String,直播模板id |
outputGroupList.outputTemplateList.isDefault | 是 | String,是否默认,0.否 1.是 |
请求参数示例:
{
"id":"377fc5664a8a4af189d3cec73aef1d76",
"name": "测试修改普通频道",
"signalType": 1,
"liveType": 0,
"outputGroupList": [{
"protocolType": "1",
"isRecord": "1",
"isTimeShift": "1",
"timeShiftDuration": "2",
"isLiveEncrypt": "0",
"logoId": "",
"outputTemplateList": [{
"id":"0cc3b075ff2f49f7bd2bae698adee749",
"templateId": "786ee85ebb7c4dad8e75bc836a55a948",
"isDefault": "0"
},
{
"templateId": "6c01632990dc412b911cc7ba0b45885a",
"isDefault": "1"
}]
},
{
"protocolType": "2",
"isRecord": "1",
"outputTemplateList": [{
"templateId": "6c01632990dc412b911cc7ba0b45885a",
"isDefault": "1"
}]
}]
}
返回数据:
{
"code": 0,
"message": "操作成功",
"result": {
"id": "377fc5664a8a4af189d3cec73aef1d76",
"name": "测试修改普通频道",
"description": null,
"authCode": "R5CG75",
"type": null,
"typeName": null,
"signalType": "1",
"stream": "p1u0enox_h27zhXg5",
"pullStream": null,
"pullTaskId": null,
"status": 0,
"streamStatus": 2,
"userId": 106,
"streamWidth": null,
"streamHeight": null,
"streamBitrate": null,
"streamAudioBitrate": null,
"streamFrameRate": null,
"createTime": 1542693039000,
"updateTime": 1542695148000,
"startTime": null,
"endTime": null,
"autoEndTime": null,
"thumbnailUrl": "http://p1u0enox.images.danghongyun.local/thumbnail/377fc5664a8a4af189d3cec73aef1d76.jpg",
"pushUrl": "rtmp://rtmp-push.danghongyun.dev/live/p1u0enox_h27zhXg5",
"publicPlayUrl": "rtmp://172.17.230.223/live/p1u0enox_h27zhXg5",
"publicFlvPlayUrl": "http://172.17.230.223:1936/live/p1u0enox_h27zhXg5.flv",
"liveType": 0,
"deviceId": null,
"fillInfo": null,
"outputGroupList": [{
"id": "049c1e882cea4faca68cfddcb54b845e",
"name": null,
"protocolType": 2,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"taskId": null,
"isLiveEncrypt": null,
"customerId": null,
"contentId": null,
"createTime": 1542695148000,
"updateTime": 1542695148000,
"liveLogoId": null,
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": null,
"isTimeShift": null,
"timeShiftDuration": null,
"timeShiftTaskId": null,
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "11c398e6e4a94bb8b0798128eb9ebc51",
"publicOutputUrl": "rtmp://172.17.230.223/live/p1u0enox_049c1e882cea4faca68cfddcb54b845e",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 2,
"userId": 106,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"liveOutputGroupId": "049c1e882cea4faca68cfddcb54b845e",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695148000,
"updateTime": null,
"isDefault": "1"
}]
},
{
"id": "7327f98aca74472286b217f66ed8e3c0",
"name": null,
"protocolType": 1,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"taskId": null,
"isLiveEncrypt": "0",
"customerId": null,
"contentId": null,
"createTime": 1542695148000,
"updateTime": 1542695148000,
"liveLogoId": "",
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": null,
"isTimeShift": "1",
"timeShiftDuration": "2",
"timeShiftTaskId": null,
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "786ee85ebb7c4dad8e75bc836a55a948",
"displayName": "标清",
"transcodeType": 0,
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 3,
"updateTime": null,
"name": "标清/450kbps/720x576"
},
{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "2816f1bdbcf24214aa80faa1f880dd8e",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/377fc5664a8a4af189d3cec73aef1d76/7327f98aca74472286b217f66ed8e3c0.m3u8",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"liveOutputGroupId": "7327f98aca74472286b217f66ed8e3c0",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695148000,
"updateTime": null,
"isDefault": "1"
},
{
"id": "a1646f60bc05431d89f0d878372357ff",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/377fc5664a8a4af189d3cec73aef1d76/7327f98aca74472286b217f66ed8e3c0.m3u8",
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "377fc5664a8a4af189d3cec73aef1d76",
"liveOutputGroupId": "7327f98aca74472286b217f66ed8e3c0",
"liveTemplateId": "786ee85ebb7c4dad8e75bc836a55a948",
"createTime": 1542695148000,
"updateTime": null,
"isDefault": "0"
}]
}]
},
"success": true
}
返回字段说明
code:状态码
message:状态描述
result:返回实体信息
success:成功/失败
id:频道id
name:频道名称
description:频道描述
authCode:授权码
type:频道类型Id
typeName:类型名称
signalType:源流类型 1.推流 2.拉流
app:推流端app
stream:流名称
clientId:推流客户端id
thumbnailUrl:源流图片地址
status:频道状态 0. 初始化 1.就绪 2.直播中 3.拉流中 5启动中
streamStatus:流状态 1-正常 2-无源
userId:用户id
streamWidth:源流宽
streamHeight:源流高
streamBitrate:源流码率
streamAudioBitrate:源音频码率
createTime:创建时间
updateTime:更新时间
startTime:直播开始时间
endTime:直播结束时间
autoEndTime:直播自动结束时间
pushUrl:推流地址
publicPlayUrl:源流rtmp播放地址
publicFlvPlayUrl:源流flv播放地址
liveType:直播类型,0:普通直播、2:VR直播、3:1080P直播
deviceId:设备id-与库管系统的设备进行绑定
fillInfo:垫片信息
outputGroupList:输出组信息列表
id:id,直播输出组唯一标识符
name:直播输出组名称
protocolType:直播输出组协议类型 1.hls 2.rtmp
channelId:所属频道id
taskId:任务Id
isLiveEncrypt:是否加密 1加密 0不加密
customerId:加密秘钥1
contentId:加密秘钥2
createTime:创建时间
updateTime:更新时间
liveLogoId:直播Logo id
liveLogo:直播logo信息
logoId:直播Logo id
rtmpThirdPartyOutputUrl:rtmp第三方输出地址
isRecord:是否录制,0.否 1.是
recordTaskId:当前录制任务id
recordStartTime:录制开始时间
needToMp4:录制的文件是否转mp4,1.是 0.否
isTimeShift:是否时移,0.否 1.是
timeShiftDuration:时移时长,单位小时
timeShiftTaskId:时移任务Id
rotation:旋转度数
outputTemplateList:直播模板列表
id:直播模版id
name:模版名称/码率/宽x高
displayName:模版名称
transcodeType:直播类型,0:普通直播、2:VR直播、3:1080P直播,
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
frameRate:视频帧率
type:模板类型 1.用户模板 2.系统模板
userId:用户id,如果是系统的模板,此项为空
createTime:创建时间
updateTime:更新时间
liveOutputs:输出信息
id:唯一标识
publicOutputUrl:输出播放地址
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
protocolType:直播分组协议类型 1.hls 2.rtmp
userId:用户id
channelId:所属直播频道id
liveOutputGroupId:所属直播输出组id
liveTemplateId:直播模板Id
createTime:创建时间
updateTime:更新时间
isDefault:1. 默认 0.不默认
删除频道,批量删除
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveDelete | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
ids | 待删除的直播频道id,多个用逗号分隔 | String | 必选 |
返回数据:
{
"code": 0,
"message": "操作成功",
"success": true
}
返回字段说明
code:状态码
message:状态描述
success:成功/失败
开始直播
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveStartChannel | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
id | 需要启动的直播频道id | String | 必选 |
返回数据:
{
"code": 0,
"message": "操作成功",
"result": {
"id": "b29f64a6796f4268ab980c869587fbe5",
"name": "测试修改普通频道",
"description": null,
"authCode": "R5CG75",
"type": null,
"typeName": null,
"signalType": "1",
"stream": "p1u0enox_92CpuDqb",
"pullStream": null,
"pullTaskId": null,
"status": 2,
"streamStatus": 1,
"userId": 106,
"streamWidth": 1280,
"streamHeight": 720,
"streamBitrate": 2560000,
"streamAudioBitrate": 163840,
"streamFrameRate": null,
"createTime": 1542695555000,
"updateTime": 1542695626000,
"startTime": 1542695626717,
"endTime": null,
"autoEndTime": 0,
"thumbnailUrl": "http://p1u0enox.images.danghongyun.local/thumbnail/b29f64a6796f4268ab980c869587fbe5.jpg",
"pushUrl": "rtmp://rtmp-push.danghongyun.dev/live/p1u0enox_92CpuDqb",
"publicPlayUrl": "rtmp://172.17.230.223/live/p1u0enox_92CpuDqb",
"publicFlvPlayUrl": "http://172.17.230.223:1936/live/p1u0enox_92CpuDqb.flv",
"liveType": 0,
"deviceId": null,
"fillInfo": null,
"outputGroupList": [{
"id": "67724a415cfa44c298945e891db4c2e8",
"name": null,
"protocolType": 1,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"taskId": "E6F5CBD1-6F21-4328-BE83-95608EC292ED",
"isLiveEncrypt": "0",
"customerId": null,
"contentId": null,
"createTime": 1542695567000,
"updateTime": 1542695625000,
"liveLogoId": "",
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": "8841C0CE-C5C4-4530-A4F1-1544074B3BD4",
"recordStartTime": 1542695624122,
"needToMp4": null,
"isTimeShift": "1",
"timeShiftDuration": "2",
"timeShiftTaskId": "http://172.17.230.223:8080/p1u0enox/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "786ee85ebb7c4dad8e75bc836a55a948",
"displayName": "标清",
"transcodeType": 0,
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 3,
"updateTime": null,
"name": "标清/450kbps/720x576"
},
{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "1a2277d64eb1418793e937e507b52f4a",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "67724a415cfa44c298945e891db4c2e8",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "1"
},
{
"id": "efafc802d7854acaa11d5e1852ae3be3",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "67724a415cfa44c298945e891db4c2e8",
"liveTemplateId": "786ee85ebb7c4dad8e75bc836a55a948",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "0"
}]
},
{
"id": "f1fdabf94e2e4653baccfc423a9cdca7",
"name": null,
"protocolType": 2,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"taskId": "7A6CD8D0-06CC-481C-8932-647E3E760DC8",
"isLiveEncrypt": null,
"customerId": null,
"contentId": null,
"createTime": 1542695567000,
"updateTime": 1542695626000,
"liveLogoId": null,
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": "5327DFEE-BDEC-40FD-A500-0D2C8B1A9A5F",
"recordStartTime": 1542695625873,
"needToMp4": null,
"isTimeShift": null,
"timeShiftDuration": null,
"timeShiftTaskId": null,
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "a5c0721fad3a4c83a3057223eccaf210",
"publicOutputUrl": "rtmp://172.17.230.223/live/p1u0enox_f1fdabf94e2e4653baccfc423a9cdca7",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 2,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "f1fdabf94e2e4653baccfc423a9cdca7",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "1"
}]
}]
},
"success": true
}
返回字段说明
code:状态码
message:状态描述
result:返回实体信息
success:成功/失败
id:频道id
name:频道名称
description:频道描述
authCode:授权码
type:频道类型Id
typeName:类型名称
signalType:源流类型 1.推流 2.拉流
app:推流端app
stream:流名称
clientId:推流客户端id
thumbnailUrl:源流图片地址
status:频道状态 0. 初始化 1.就绪 2.直播中 3.拉流中 5启动中
streamStatus:流状态 1-正常 2-无源
userId:用户id
streamWidth:源流宽
streamHeight:源流高
streamBitrate:源流码率
streamAudioBitrate:源音频码率
createTime:创建时间
updateTime:更新时间
startTime:直播开始时间
endTime:直播结束时间
autoEndTime:直播自动结束时间
pushUrl:推流地址
publicPlayUrl:源流rtmp播放地址
publicFlvPlayUrl:源流flv播放地址
liveType:直播类型,0:普通直播、2:VR直播、3:1080P直播
deviceId:设备id-与库管系统的设备进行绑定
fillInfo:垫片信息
outputGroupList:输出组信息列表
id:id,直播输出组唯一标识符
name:直播输出组名称
protocolType:直播输出组协议类型 1.hls 2.rtmp
channelId:所属频道id
taskId:任务Id
isLiveEncrypt:是否加密 1加密 0不加密
customerId:加密秘钥1
contentId:加密秘钥2
createTime:创建时间
updateTime:更新时间
liveLogoId:直播Logo id
liveLogo:直播logo信息
logoId:直播Logo id
rtmpThirdPartyOutputUrl:rtmp第三方输出地址
isRecord:是否录制,0.否 1.是
recordTaskId:当前录制任务id
recordStartTime:录制开始时间
needToMp4:录制的文件是否转mp4,1.是 0.否
isTimeShift:是否时移,0.否 1.是
timeShiftDuration:时移时长,单位小时
timeShiftTaskId:时移任务Id
rotation:旋转度数
outputTemplateList:直播模板列表
id:直播模版id
name:模版名称/码率/宽x高
displayName:模版名称
transcodeType:直播类型,0:普通直播、2:VR直播、3:1080P直播,
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
frameRate:视频帧率
type:模板类型 1.用户模板 2.系统模板
userId:用户id,如果是系统的模板,此项为空
createTime:创建时间
updateTime:更新时间
liveOutputs:输出信息
id:唯一标识
publicOutputUrl:输出播放地址
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
protocolType:直播分组协议类型 1.hls 2.rtmp
userId:用户id
channelId:所属直播频道id
liveOutputGroupId:所属直播输出组id
liveTemplateId:直播模板Id
createTime:创建时间
updateTime:更新时间
isDefault:1. 默认 0.不默认
停止直播
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveStopChannel | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
id | 需要停止的直播频道id | String | 必选 |
返回数据:
{
"code": 0,
"message": "操作成功",
"result": {
"id": "b29f64a6796f4268ab980c869587fbe5",
"name": "测试修改普通频道",
"description": null,
"authCode": "R5CG75",
"type": null,
"typeName": null,
"signalType": "1",
"stream": "p1u0enox_92CpuDqb",
"pullStream": null,
"pullTaskId": null,
"status": 1,
"streamStatus": 1,
"userId": 106,
"streamWidth": 1280,
"streamHeight": 720,
"streamBitrate": 2560000,
"streamAudioBitrate": 163840,
"streamFrameRate": null,
"createTime": 1542695555000,
"updateTime": 1542695775000,
"startTime": 1542695626717,
"endTime": 1542695775216,
"autoEndTime": 0,
"thumbnailUrl": "http://p1u0enox.images.danghongyun.local/thumbnail/b29f64a6796f4268ab980c869587fbe5.jpg",
"pushUrl": "rtmp://rtmp-push.danghongyun.dev/live/p1u0enox_92CpuDqb",
"publicPlayUrl": "rtmp://172.17.230.223/live/p1u0enox_92CpuDqb",
"publicFlvPlayUrl": "http://172.17.230.223:1936/live/p1u0enox_92CpuDqb.flv",
"liveType": 0,
"deviceId": null,
"fillInfo": null,
"outputGroupList": [{
"id": "67724a415cfa44c298945e891db4c2e8",
"name": null,
"protocolType": 1,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"taskId": "",
"isLiveEncrypt": "0",
"customerId": null,
"contentId": null,
"createTime": 1542695567000,
"updateTime": 1542695774000,
"liveLogoId": "",
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": 1542695624122,
"needToMp4": null,
"isTimeShift": "1",
"timeShiftDuration": "2",
"timeShiftTaskId": "",
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "786ee85ebb7c4dad8e75bc836a55a948",
"displayName": "标清",
"transcodeType": 0,
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 3,
"updateTime": null,
"name": "标清/450kbps/720x576"
},
{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "1a2277d64eb1418793e937e507b52f4a",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "67724a415cfa44c298945e891db4c2e8",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "1"
},
{
"id": "efafc802d7854acaa11d5e1852ae3be3",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "67724a415cfa44c298945e891db4c2e8",
"liveTemplateId": "786ee85ebb7c4dad8e75bc836a55a948",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "0"
}]
},
{
"id": "f1fdabf94e2e4653baccfc423a9cdca7",
"name": null,
"protocolType": 2,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"taskId": "",
"isLiveEncrypt": null,
"customerId": null,
"contentId": null,
"createTime": 1542695567000,
"updateTime": 1542695775000,
"liveLogoId": null,
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": null,
"isTimeShift": null,
"timeShiftDuration": null,
"timeShiftTaskId": null,
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "a5c0721fad3a4c83a3057223eccaf210",
"publicOutputUrl": "rtmp://172.17.230.223/live/p1u0enox_f1fdabf94e2e4653baccfc423a9cdca7",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 2,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "f1fdabf94e2e4653baccfc423a9cdca7",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "1"
}]
}]
},
"success": true
}
返回字段说明
code:状态码
message:状态描述
result:返回实体信息
success:成功/失败
id:频道id
name:频道名称
description:频道描述
authCode:授权码
type:频道类型Id
typeName:类型名称
signalType:源流类型 1.推流 2.拉流
app:推流端app
stream:流名称
clientId:推流客户端id
thumbnailUrl:源流图片地址
status:频道状态 0. 初始化 1.就绪 2.直播中 3.拉流中 5启动中
streamStatus:流状态 1-正常 2-无源
userId:用户id
streamWidth:源流宽
streamHeight:源流高
streamBitrate:源流码率
streamAudioBitrate:源音频码率
createTime:创建时间
updateTime:更新时间
startTime:直播开始时间
endTime:直播结束时间
autoEndTime:直播自动结束时间
pushUrl:推流地址
publicPlayUrl:源流rtmp播放地址
publicFlvPlayUrl:源流flv播放地址
liveType:直播类型,0:普通直播、2:VR直播、3:1080P直播
deviceId:设备id-与库管系统的设备进行绑定
fillInfo:垫片信息
outputGroupList:输出组信息列表
id:id,直播输出组唯一标识符
name:直播输出组名称
protocolType:直播输出组协议类型 1.hls 2.rtmp
channelId:所属频道id
taskId:任务Id
isLiveEncrypt:是否加密 1加密 0不加密
customerId:加密秘钥1
contentId:加密秘钥2
createTime:创建时间
updateTime:更新时间
liveLogoId:直播Logo id
liveLogo:直播logo信息
logoId:直播Logo id
rtmpThirdPartyOutputUrl:rtmp第三方输出地址
isRecord:是否录制,0.否 1.是
recordTaskId:当前录制任务id
recordStartTime:录制开始时间
needToMp4:录制的文件是否转mp4,1.是 0.否
isTimeShift:是否时移,0.否 1.是
timeShiftDuration:时移时长,单位小时
timeShiftTaskId:时移任务Id
rotation:旋转度数
outputTemplateList:直播模板列表
id:直播模版id
name:模版名称/码率/宽x高
displayName:模版名称
transcodeType:直播类型,0:普通直播、2:VR直播、3:1080P直播,
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
frameRate:视频帧率
type:模板类型 1.用户模板 2.系统模板
userId:用户id,如果是系统的模板,此项为空
createTime:创建时间
updateTime:更新时间
liveOutputs:输出信息
id:唯一标识
publicOutputUrl:输出播放地址
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
protocolType:直播分组协议类型 1.hls 2.rtmp
userId:用户id
channelId:所属直播频道id
liveOutputGroupId:所属直播输出组id
liveTemplateId:直播模板Id
createTime:创建时间
updateTime:更新时间
isDefault:1. 默认 0.不默认
开始直播拉流
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveStartChannelPull | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
id | 开始直播拉流的频道id | String | 必选 |
返回数据:
{
"code": 0,
"message": "操作成功",
"result": {
"id": "b29f64a6796f4268ab980c869587fbe5",
"name": "测试普通频道",
"description": null,
"authCode": "R5CG75",
"type": null,
"typeName": null,
"signalType": "1",
"stream": "p1u0enox_92CpuDqb",
"pullStream": null,
"pullTaskId": null,
"status": 1,
"streamStatus": 1,
"userId": 106,
"streamWidth": 1280,
"streamHeight": 720,
"streamBitrate": 2560000,
"streamAudioBitrate": 163840,
"streamFrameRate": null,
"createTime": 1542695555000,
"updateTime": 1542695775000,
"startTime": 1542695626717,
"endTime": 1542695775216,
"autoEndTime": 0,
"thumbnailUrl": "http://p1u0enox.images.danghongyun.local/thumbnail/b29f64a6796f4268ab980c869587fbe5.jpg",
"pushUrl": "rtmp://rtmp-push.danghongyun.dev/live/p1u0enox_92CpuDqb",
"publicPlayUrl": "rtmp://172.17.230.223/live/p1u0enox_92CpuDqb",
"publicFlvPlayUrl": "http://172.17.230.223:1936/live/p1u0enox_92CpuDqb.flv",
"liveType": 0,
"deviceId": null,
"fillInfo": null,
"outputGroupList": [{
"id": "67724a415cfa44c298945e891db4c2e8",
"name": null,
"protocolType": 1,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"taskId": "",
"isLiveEncrypt": "0",
"customerId": null,
"contentId": null,
"createTime": 1542695567000,
"updateTime": 1542695774000,
"liveLogoId": "",
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": 1542695624122,
"needToMp4": null,
"isTimeShift": "1",
"timeShiftDuration": "2",
"timeShiftTaskId": "",
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "786ee85ebb7c4dad8e75bc836a55a948",
"displayName": "标清",
"transcodeType": 0,
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 3,
"updateTime": null,
"name": "标清/450kbps/720x576"
},
{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "1a2277d64eb1418793e937e507b52f4a",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "67724a415cfa44c298945e891db4c2e8",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "1"
},
{
"id": "efafc802d7854acaa11d5e1852ae3be3",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "67724a415cfa44c298945e891db4c2e8",
"liveTemplateId": "786ee85ebb7c4dad8e75bc836a55a948",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "0"
}]
},
{
"id": "f1fdabf94e2e4653baccfc423a9cdca7",
"name": null,
"protocolType": 2,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"taskId": "",
"isLiveEncrypt": null,
"customerId": null,
"contentId": null,
"createTime": 1542695567000,
"updateTime": 1542695775000,
"liveLogoId": null,
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": null,
"isTimeShift": null,
"timeShiftDuration": null,
"timeShiftTaskId": null,
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "a5c0721fad3a4c83a3057223eccaf210",
"publicOutputUrl": "rtmp://172.17.230.223/live/p1u0enox_f1fdabf94e2e4653baccfc423a9cdca7",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 2,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "f1fdabf94e2e4653baccfc423a9cdca7",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "1"
}]
}]
},
"success": true
}
返回字段说明
code:状态码
message:状态描述
result:返回实体信息
success:成功/失败
id:频道id
name:频道名称
description:频道描述
authCode:授权码
type:频道类型Id
typeName:类型名称
signalType:源流类型 1.推流 2.拉流
app:推流端app
stream:流名称
clientId:推流客户端id
thumbnailUrl:源流图片地址
status:频道状态 0. 初始化 1.就绪 2.直播中 3.拉流中 5启动中
streamStatus:流状态 1-正常 2-无源
userId:用户id
streamWidth:源流宽
streamHeight:源流高
streamBitrate:源流码率
streamAudioBitrate:源音频码率
createTime:创建时间
updateTime:更新时间
startTime:直播开始时间
endTime:直播结束时间
autoEndTime:直播自动结束时间
pushUrl:推流地址
publicPlayUrl:源流rtmp播放地址
publicFlvPlayUrl:源流flv播放地址
liveType:直播类型,0:普通直播、2:VR直播、3:1080P直播
deviceId:设备id-与库管系统的设备进行绑定
fillInfo:垫片信息
outputGroupList:输出组信息列表
id:id,直播输出组唯一标识符
name:直播输出组名称
protocolType:直播输出组协议类型 1.hls 2.rtmp
channelId:所属频道id
taskId:任务Id
isLiveEncrypt:是否加密 1加密 0不加密
customerId:加密秘钥1
contentId:加密秘钥2
createTime:创建时间
updateTime:更新时间
liveLogoId:直播Logo id
liveLogo:直播logo信息
logoId:直播Logo id
rtmpThirdPartyOutputUrl:rtmp第三方输出地址
isRecord:是否录制,0.否 1.是
recordTaskId:当前录制任务id
recordStartTime:录制开始时间
needToMp4:录制的文件是否转mp4,1.是 0.否
isTimeShift:是否时移,0.否 1.是
timeShiftDuration:时移时长,单位小时
timeShiftTaskId:时移任务Id
rotation:旋转度数
outputTemplateList:直播模板列表
id:直播模版id
name:模版名称/码率/宽x高
displayName:模版名称
transcodeType:直播类型,0:普通直播、2:VR直播、3:1080P直播,
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
frameRate:视频帧率
type:模板类型 1.用户模板 2.系统模板
userId:用户id,如果是系统的模板,此项为空
createTime:创建时间
updateTime:更新时间
liveOutputs:输出信息
id:唯一标识
publicOutputUrl:输出播放地址
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
protocolType:直播分组协议类型 1.hls 2.rtmp
userId:用户id
channelId:所属直播频道id
liveOutputGroupId:所属直播输出组id
liveTemplateId:直播模板Id
createTime:创建时间
updateTime:更新时间
isDefault:1. 默认 0.不默认
停止直播拉流
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveStopChannelPull | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
id | 停止直播拉流的频道id | String | 必选 |
返回数据:
{
"code": 0,
"message": "操作成功",
"result": {
"id": "b29f64a6796f4268ab980c869587fbe5",
"name": "测试普通频道",
"description": null,
"authCode": "R5CG75",
"type": null,
"typeName": null,
"signalType": "1",
"stream": "p1u0enox_92CpuDqb",
"pullStream": null,
"pullTaskId": null,
"status": 1,
"streamStatus": 1,
"userId": 106,
"streamWidth": 1280,
"streamHeight": 720,
"streamBitrate": 2560000,
"streamAudioBitrate": 163840,
"streamFrameRate": null,
"createTime": 1542695555000,
"updateTime": 1542695775000,
"startTime": 1542695626717,
"endTime": 1542695775216,
"autoEndTime": 0,
"thumbnailUrl": "http://p1u0enox.images.danghongyun.local/thumbnail/b29f64a6796f4268ab980c869587fbe5.jpg",
"pushUrl": "rtmp://rtmp-push.danghongyun.dev/live/p1u0enox_92CpuDqb",
"publicPlayUrl": "rtmp://172.17.230.223/live/p1u0enox_92CpuDqb",
"publicFlvPlayUrl": "http://172.17.230.223:1936/live/p1u0enox_92CpuDqb.flv",
"liveType": 0,
"deviceId": null,
"fillInfo": null,
"outputGroupList": [{
"id": "67724a415cfa44c298945e891db4c2e8",
"name": null,
"protocolType": 1,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"taskId": "",
"isLiveEncrypt": "0",
"customerId": null,
"contentId": null,
"createTime": 1542695567000,
"updateTime": 1542695774000,
"liveLogoId": "",
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": 1542695624122,
"needToMp4": null,
"isTimeShift": "1",
"timeShiftDuration": "2",
"timeShiftTaskId": "",
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "786ee85ebb7c4dad8e75bc836a55a948",
"displayName": "标清",
"transcodeType": 0,
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 3,
"updateTime": null,
"name": "标清/450kbps/720x576"
},
{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "1a2277d64eb1418793e937e507b52f4a",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "67724a415cfa44c298945e891db4c2e8",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "1"
},
{
"id": "efafc802d7854acaa11d5e1852ae3be3",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "67724a415cfa44c298945e891db4c2e8",
"liveTemplateId": "786ee85ebb7c4dad8e75bc836a55a948",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "0"
}]
},
{
"id": "f1fdabf94e2e4653baccfc423a9cdca7",
"name": null,
"protocolType": 2,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"taskId": "",
"isLiveEncrypt": null,
"customerId": null,
"contentId": null,
"createTime": 1542695567000,
"updateTime": 1542695775000,
"liveLogoId": null,
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": null,
"isTimeShift": null,
"timeShiftDuration": null,
"timeShiftTaskId": null,
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "a5c0721fad3a4c83a3057223eccaf210",
"publicOutputUrl": "rtmp://172.17.230.223/live/p1u0enox_f1fdabf94e2e4653baccfc423a9cdca7",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 2,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "f1fdabf94e2e4653baccfc423a9cdca7",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "1"
}]
}]
},
"success": true
}
返回字段说明
code:状态码
message:状态描述
result:返回实体信息
success:成功/失败
id:频道id
name:频道名称
description:频道描述
authCode:授权码
type:频道类型Id
typeName:类型名称
signalType:源流类型 1.推流 2.拉流
app:推流端app
stream:流名称
clientId:推流客户端id
thumbnailUrl:源流图片地址
status:频道状态 0. 初始化 1.就绪 2.直播中 3.拉流中 5启动中
streamStatus:流状态 1-正常 2-无源
userId:用户id
streamWidth:源流宽
streamHeight:源流高
streamBitrate:源流码率
streamAudioBitrate:源音频码率
createTime:创建时间
updateTime:更新时间
startTime:直播开始时间
endTime:直播结束时间
autoEndTime:直播自动结束时间
pushUrl:推流地址
publicPlayUrl:源流rtmp播放地址
publicFlvPlayUrl:源流flv播放地址
liveType:直播类型,0:普通直播、2:VR直播、3:1080P直播
deviceId:设备id-与库管系统的设备进行绑定
fillInfo:垫片信息
outputGroupList:输出组信息列表
id:id,直播输出组唯一标识符
name:直播输出组名称
protocolType:直播输出组协议类型 1.hls 2.rtmp
channelId:所属频道id
taskId:任务Id
isLiveEncrypt:是否加密 1加密 0不加密
customerId:加密秘钥1
contentId:加密秘钥2
createTime:创建时间
updateTime:更新时间
liveLogoId:直播Logo id
liveLogo:直播logo信息
logoId:直播Logo id
rtmpThirdPartyOutputUrl:rtmp第三方输出地址
isRecord:是否录制,0.否 1.是
recordTaskId:当前录制任务id
recordStartTime:录制开始时间
needToMp4:录制的文件是否转mp4,1.是 0.否
isTimeShift:是否时移,0.否 1.是
timeShiftDuration:时移时长,单位小时
timeShiftTaskId:时移任务Id
rotation:旋转度数
outputTemplateList:直播模板列表
id:直播模版id
name:模版名称/码率/宽x高
displayName:模版名称
transcodeType:直播类型,0:普通直播、2:VR直播、3:1080P直播,
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
frameRate:视频帧率
type:模板类型 1.用户模板 2.系统模板
userId:用户id,如果是系统的模板,此项为空
createTime:创建时间
updateTime:更新时间
liveOutputs:输出信息
id:唯一标识
publicOutputUrl:输出播放地址
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
protocolType:直播分组协议类型 1.hls 2.rtmp
userId:用户id
channelId:所属直播频道id
liveOutputGroupId:所属直播输出组id
liveTemplateId:直播模板Id
createTime:创建时间
updateTime:更新时间
isDefault:1. 默认 0.不默认
设置直播频道状态回调地址
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为setLiveCallback | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
value | 设置的直播频道状态变化回调地址 | String | 必选 |
返回数据:
{
"code": 0,
"message": "操作成功",
"result": {
"userId": 607,
"name": "live-callback-url",
"value": "http://example.com/"
}
}
返回字段说明:
code:状态码
message:状态描述
result:返回实体信息
success:成功/失败
userId: 用户ID
value: 设置的直播频道状态变化回调地址
回调说明:
回调采用 POST
+ Content-Type: application/json
的方式,某次通知以 HTTP
响应 2xx
为成功标识,最多重试 3
次,5xx
响应会立即终止重试。
回调内容:
{
"channelId": "b29f64a6796f8738ab980c869587fbe5",
"channelStatus": 1
}
字段说明:
channelId: 频道ID
channelStatus: 当前直播频道状态,具体值含义参见 `根据频道id查询信息` 中返回字段 `status` 的说明
根据频道id查询信息
服务地址:
http://api.danghongyun.com/rest
请求方式:
GET
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveGetChannelById | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
id | 直播频道id | String | 必选 |
返回数据:
{
"code": 0,
"message": "操作成功",
"result": {
"id": "b29f64a6796f4268ab980c869587fbe5",
"name": "测试修改普通频道",
"description": null,
"authCode": "R5CG75",
"type": null,
"typeName": null,
"signalType": "1",
"stream": "p1u0enox_92CpuDqb",
"pullStream": null,
"pullTaskId": null,
"status": 1,
"streamStatus": 1,
"userId": 106,
"streamWidth": 1280,
"streamHeight": 720,
"streamBitrate": 2560000,
"streamAudioBitrate": 163840,
"streamFrameRate": null,
"createTime": 1542695555000,
"updateTime": 1542695775000,
"startTime": 1542695626717,
"endTime": 1542695775216,
"autoEndTime": 0,
"thumbnailUrl": "http://p1u0enox.images.danghongyun.local/thumbnail/b29f64a6796f4268ab980c869587fbe5.jpg",
"pushUrl": "rtmp://rtmp-push.danghongyun.dev/live/p1u0enox_92CpuDqb",
"publicPlayUrl": "rtmp://172.17.230.223/live/p1u0enox_92CpuDqb",
"publicFlvPlayUrl": "http://172.17.230.223:1936/live/p1u0enox_92CpuDqb.flv",
"liveType": 0,
"deviceId": null,
"fillInfo": null,
"outputGroupList": [{
"id": "67724a415cfa44c298945e891db4c2e8",
"name": null,
"protocolType": 1,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"taskId": "",
"isLiveEncrypt": "0",
"customerId": null,
"contentId": null,
"createTime": 1542695567000,
"updateTime": 1542695774000,
"liveLogoId": "",
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": 1542695624122,
"needToMp4": null,
"isTimeShift": "1",
"timeShiftDuration": "2",
"timeShiftTaskId": "",
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "786ee85ebb7c4dad8e75bc836a55a948",
"displayName": "标清",
"transcodeType": 0,
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 3,
"updateTime": null,
"name": "标清/450kbps/720x576"
},
{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "1a2277d64eb1418793e937e507b52f4a",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "67724a415cfa44c298945e891db4c2e8",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "1"
},
{
"id": "efafc802d7854acaa11d5e1852ae3be3",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "67724a415cfa44c298945e891db4c2e8",
"liveTemplateId": "786ee85ebb7c4dad8e75bc836a55a948",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "0"
}]
},
{
"id": "f1fdabf94e2e4653baccfc423a9cdca7",
"name": null,
"protocolType": 2,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"taskId": "",
"isLiveEncrypt": null,
"customerId": null,
"contentId": null,
"createTime": 1542695567000,
"updateTime": 1542695775000,
"liveLogoId": null,
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": null,
"isRecord": "1",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": null,
"isTimeShift": null,
"timeShiftDuration": null,
"timeShiftTaskId": null,
"rotation": null,
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "a5c0721fad3a4c83a3057223eccaf210",
"publicOutputUrl": "rtmp://172.17.230.223/live/p1u0enox_f1fdabf94e2e4653baccfc423a9cdca7",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 2,
"userId": 106,
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"liveOutputGroupId": "f1fdabf94e2e4653baccfc423a9cdca7",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542695567000,
"updateTime": null,
"isDefault": "1"
}]
}]
},
"success": true
}
返回字段说明
code:状态码
message:状态描述
result:返回实体信息
success:成功/失败
id:频道id
name:频道名称
description:频道描述
authCode:授权码
type:频道类型Id
typeName:类型名称
signalType:源流类型 1.推流 2.拉流
app:推流端app
stream:流名称
clientId:推流客户端id
thumbnailUrl:源流图片地址
status:频道状态 0. 初始化 1.就绪 2.直播中 3.拉流中 5启动中
streamStatus:流状态 1-正常 2-无源
userId:用户id
streamWidth:源流宽
streamHeight:源流高
streamBitrate:源流码率
streamAudioBitrate:源音频码率
createTime:创建时间
updateTime:更新时间
startTime:直播开始时间
endTime:直播结束时间
autoEndTime:直播自动结束时间
pushUrl:推流地址
publicPlayUrl:源流rtmp播放地址
publicFlvPlayUrl:源流flv播放地址
liveType:直播类型,0:普通直播、2:VR直播、3:1080P直播
deviceId:设备id-与库管系统的设备进行绑定
fillInfo:垫片信息
outputGroupList:输出组信息列表
id:id,直播输出组唯一标识符
name:直播输出组名称
protocolType:直播输出组协议类型 1.hls 2.rtmp
channelId:所属频道id
taskId:任务Id
isLiveEncrypt:是否加密 1加密 0不加密
customerId:加密秘钥1
contentId:加密秘钥2
createTime:创建时间
updateTime:更新时间
liveLogoId:直播Logo id
liveLogo:直播logo信息
logoId:直播Logo id
rtmpThirdPartyOutputUrl:rtmp第三方输出地址
isRecord:是否录制,0.否 1.是
recordTaskId:当前录制任务id
recordStartTime:录制开始时间
needToMp4:录制的文件是否转mp4,1.是 0.否
isTimeShift:是否时移,0.否 1.是
timeShiftDuration:时移时长,单位小时
timeShiftTaskId:时移任务Id
rotation:旋转度数
outputTemplateList:直播模板列表
id:直播模版id
name:模版名称/码率/宽x高
displayName:模版名称
transcodeType:直播类型,0:普通直播、2:VR直播、3:1080P直播,
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
frameRate:视频帧率
type:模板类型 1.用户模板 2.系统模板
userId:用户id,如果是系统的模板,此项为空
createTime:创建时间
updateTime:更新时间
liveOutputs:输出信息
id:唯一标识
publicOutputUrl:输出播放地址
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
protocolType:直播分组协议类型 1.hls 2.rtmp
userId:用户id
channelId:所属直播频道id
liveOutputGroupId:所属直播输出组id
liveTemplateId:直播模板Id
createTime:创建时间
updateTime:更新时间
isDefault:1. 默认 0.不默认
分页查询频道信息
服务地址:
http://api.danghongyun.com/rest
请求方式:
GET
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveGetChannelsByPage | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
start | 当前页码,不传时默认为1 | Integer | 可选 |
number | 每页展示数量,不传默认为15 | Integer | 可选 |
sort | 结果按该字段排序,只能为name, type, status, streamStatus, createTime | String | 可选 |
order | 2asc 顺序,desc 倒序 | String | 可选 |
searchType | 搜索类型,只能为name,type,all,分别为按name搜索,按type搜索,按name和type一起搜索,搜索时必须同时要输入参数keyword | String | 可选 |
keyword | 搜索的关键字 | String | 可选 |
返回数据:
{
"code": 0,
"message": "success",
"result": [{
"id": "3db23761f9824db6aa269323e04639b9",
"name": "测试频道2",
"description": null,
"authCode": "R5CG75",
"type": "bbe19a6a2c1148b78d2f46cfa9e6656f",
"typeName": "test",
"signalType": "1",
"stream": "p1u0enox_PHtY9KfM",
"pullStream": "",
"pullTaskId": null,
"status": 0,
"streamStatus": 2,
"userId": 106,
"streamWidth": null,
"streamHeight": null,
"streamBitrate": null,
"streamAudioBitrate": null,
"streamFrameRate": null,
"createTime": 1542696141000,
"updateTime": 1542696141000,
"startTime": null,
"endTime": null,
"autoEndTime": null,
"thumbnailUrl": "http://p1u0enox.images.danghongyun.local/thumbnail/3db23761f9824db6aa269323e04639b9.jpg",
"pushUrl": "rtmp://rtmp-push.danghongyun.dev/live/p1u0enox_PHtY9KfM",
"publicPlayUrl": "rtmp://172.17.230.223/live/p1u0enox_PHtY9KfM",
"publicFlvPlayUrl": "http://172.17.230.223:1936/live/p1u0enox_PHtY9KfM.flv",
"liveType": 0,
"deviceId": "",
"outputGroupList": [{
"id": "706067160fad4be28d7767ae2228be8f",
"name": null,
"protocolType": 2,
"channelId": "3db23761f9824db6aa269323e04639b9",
"taskId": null,
"isLiveEncrypt": "0",
"customerId": null,
"contentId": null,
"createTime": 1542696141000,
"updateTime": 1542696141000,
"liveLogoId": "",
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "普通",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "普通/270kbps/640x352"
}],
"liveOutputs": [{
"id": "f0f58d527161458a93959b7c0bf6372b",
"publicOutputUrl": "rtmp://172.17.230.223/live/p1u0enox_706067160fad4be28d7767ae2228be8f",
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"protocolType": 2,
"userId": 106,
"channelId": "3db23761f9824db6aa269323e04639b9",
"liveOutputGroupId": "706067160fad4be28d7767ae2228be8f",
"liveTemplateId": "6c01632990dc412b911cc7ba0b45885a",
"createTime": 1542696141000,
"updateTime": null,
"isDefault": "1"
}],
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": "",
"isRecord": "0",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": "0",
"isTimeShift": "0",
"timeShiftDuration": "",
"timeShiftTaskId": null,
"rotation": "0"
}],
"fillInfo": null
},
{
"id": "941a850390334c9cb77ba69d3cd1995c",
"name": "测试频道3",
"description": null,
"authCode": "R5CG75",
"type": "bbe19a6a2c1148b78d2f46cfa9e6656f",
"typeName": "test",
"signalType": "1",
"stream": "p1u0enox_0veBeQU0",
"pullStream": "",
"pullTaskId": null,
"status": 0,
"streamStatus": 2,
"userId": 106,
"streamWidth": null,
"streamHeight": null,
"streamBitrate": null,
"streamAudioBitrate": null,
"streamFrameRate": null,
"createTime": 1542696168000,
"updateTime": 1542696168000,
"startTime": null,
"endTime": null,
"autoEndTime": null,
"thumbnailUrl": "http://p1u0enox.images.danghongyun.local/thumbnail/941a850390334c9cb77ba69d3cd1995c.jpg",
"pushUrl": "rtmp://rtmp-push.danghongyun.dev/live/p1u0enox_0veBeQU0",
"publicPlayUrl": "rtmp://172.17.230.223/live/p1u0enox_0veBeQU0",
"publicFlvPlayUrl": "http://172.17.230.223:1936/live/p1u0enox_0veBeQU0.flv",
"liveType": 0,
"deviceId": "",
"outputGroupList": [{
"id": "e8cf04dc09634a20aeade2b8a1b739c3",
"name": null,
"protocolType": 1,
"channelId": "941a850390334c9cb77ba69d3cd1995c",
"taskId": null,
"isLiveEncrypt": "0",
"customerId": null,
"contentId": null,
"createTime": 1542696168000,
"updateTime": 1542696168000,
"liveLogoId": "",
"outputTemplateList": [{
"templateId": null,
"isDefault": null,
"id": "43ca60d4dc9143bcb7410a4444233e47",
"displayName": "高清",
"transcodeType": 0,
"videoWidth": 1280,
"videoHeight": 720,
"videoBitrate": 750,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 4,
"updateTime": null,
"name": "高清/750kbps/1280x720"
}],
"liveOutputs": [{
"id": "5d867189443d414599ff73ebfca38522",
"publicOutputUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/941a850390334c9cb77ba69d3cd1995c/e8cf04dc09634a20aeade2b8a1b739c3.m3u8",
"videoWidth": 1280,
"videoHeight": 720,
"videoBitrate": 750,
"audioBitrate": 64,
"protocolType": 1,
"userId": 106,
"channelId": "941a850390334c9cb77ba69d3cd1995c",
"liveOutputGroupId": "e8cf04dc09634a20aeade2b8a1b739c3",
"liveTemplateId": "43ca60d4dc9143bcb7410a4444233e47",
"createTime": 1542696168000,
"updateTime": null,
"isDefault": "1"
}],
"liveLogo": null,
"logoId": null,
"rtmpThirdPartyOutputUrl": "",
"isRecord": "0",
"recordTaskId": null,
"recordStartTime": null,
"needToMp4": "0",
"isTimeShift": "0",
"timeShiftDuration": "",
"timeShiftTaskId": null,
"rotation": "0"
}],
"fillInfo": null
}],
"count": 3,
"success": true
}
返回字段说明
code:状态码
message:状态描述
result:返回频道集合信息
count:总记录数
success:成功/失败
id:频道id
name:频道名称
description:频道描述
authCode:授权码
type:频道类型Id
typeName:类型名称
signalType:源流类型 1.推流 2.拉流
app:推流端app
stream:流名称
clientId:推流客户端id
thumbnailUrl:源流图片地址
status:频道状态 0. 初始化 1.就绪 2.直播中 3.拉流中 5启动中
streamStatus:流状态 1-正常 2-无源
userId:用户id
streamWidth:源流宽
streamHeight:源流高
streamBitrate:源流码率
streamAudioBitrate:源音频码率
createTime:创建时间
updateTime:更新时间
startTime:直播开始时间
endTime:直播结束时间
autoEndTime:直播自动结束时间
pushUrl:推流地址
publicPlayUrl:源流rtmp播放地址
publicFlvPlayUrl:源流flv播放地址
liveType:直播类型,0:普通直播、2:VR直播、3:1080P直播
deviceId:设备id-与库管系统的设备进行绑定
fillInfo:垫片信息
outputGroupList:输出组信息列表
id:id,直播输出组唯一标识符
name:直播输出组名称
protocolType:直播输出组协议类型 1.hls 2.rtmp
channelId:所属频道id
taskId:任务Id
isLiveEncrypt:是否加密 1加密 0不加密
customerId:加密秘钥1
contentId:加密秘钥2
createTime:创建时间
updateTime:更新时间
liveLogoId:直播Logo id
liveLogo:直播logo信息
logoId:直播Logo id
rtmpThirdPartyOutputUrl:rtmp第三方输出地址
isRecord:是否录制,0.否 1.是
recordTaskId:当前录制任务id
recordStartTime:录制开始时间
needToMp4:录制的文件是否转mp4,1.是 0.否
isTimeShift:是否时移,0.否 1.是
timeShiftDuration:时移时长,单位小时
timeShiftTaskId:时移任务Id
rotation:旋转度数
outputTemplateList:直播模板列表
id:直播模版id
name:模版名称/码率/宽x高
displayName:模版名称
transcodeType:直播类型,0:普通直播、2:VR直播、3:1080P直播,
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
frameRate:视频帧率
type:模板类型 1.用户模板 2.系统模板
userId:用户id,如果是系统的模板,此项为空
createTime:创建时间
updateTime:更新时间
liveOutputs:输出信息
id:唯一标识
publicOutputUrl:输出播放地址
videoWidth:分辨率:宽
videoHeight:分辨率:高
videoBitrate:视频码率
audioBitrate:音频码率
protocolType:直播分组协议类型 1.hls 2.rtmp
userId:用户id
channelId:所属直播频道id
liveOutputGroupId:所属直播输出组id
liveTemplateId:直播模板Id
createTime:创建时间
updateTime:更新时间
isDefault:1. 默认 0.不默认
获取频道播放地址
服务地址:
http://api.danghongyun.com/rest
请求方式:
GET
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveGetChannelsPlayUrl | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
channelId | 直播频道id | String | 必选 |
返回数据:
{
"code": 0,
"message": "操作成功",
"result": [{
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"channelGroupId": "67724a415cfa44c298945e891db4c2e8",
"channelGroupType": 1,
"playUrl": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8.m3u8",
"playUrlList": [{
"url": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8-2.m3u8",
"width": 640,
"height": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"defaultVideo": "1"
},
{
"url": "http://p1u0enox.live1.danghongyun.local/live/hls/b29f64a6796f4268ab980c869587fbe5/67724a415cfa44c298945e891db4c2e8-1.m3u8",
"width": 720,
"height": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"defaultVideo": "0"
}]
},
{
"channelId": "b29f64a6796f4268ab980c869587fbe5",
"channelGroupId": "f1fdabf94e2e4653baccfc423a9cdca7",
"channelGroupType": 2,
"playUrl": "rtmp://172.17.230.223/live/p1u0enox_f1fdabf94e2e4653baccfc423a9cdca7",
"playUrlList": [{
"url": "rtmp://172.17.230.223/live/p1u0enox_f1fdabf94e2e4653baccfc423a9cdca7",
"width": 640,
"height": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"defaultVideo": "1"
}]
}],
"success": true
}
返回字段说明
code:状态码
message:状态描述
result:返回该频道所有的输出组播放信息集合
success:成功/失败
channelId:直播频道Id
channelGroupId:输出组Id
channelGroupType:输出组协议类型 1.hls 2.rtmp
playUrl:父级播放地址
playUrlList:子级播放信息列表
url:子级播放地址
width:视频宽
height:视频高
videoBitrate:视频码率
audioBitrate:音频码率
defaultVideo:是否默认 0.否 1.是
开始录制
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveStartChannelRecord | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
channelId | 直播频道id | String | 必选 |
outputGroupId | 直播频道输出组id | String | 必选 |
返回数据:
{
"code":0,
"message":"操作成功",
"success":true
}
返回字段说明
code:状态码
message:状态描述
success:成功/失败
结束录制
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveStopChannelRecord | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
channelId | 直播频道id/td> | String | 必选 |
outputGroupId | 直播输出组id | String | 必选 |
返回数据:
{
"message": "操作成功",
"code": 0,
"success":true,
"result": {
"videoId": "da3794648c0f4baab00348136def9fd3"
}
}
返回字段说明
code:状态码
message:状态描述
success:成功/失败
result:录制的视频id
创建直播模板
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为 liveTemplateCreate | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必须 |
displayName | 显示名称 | String | 必须 |
type | 模板类型 1.用户模板 此处填 1 | Integer | 必选 |
transcodeType | 转码类型 0:普通直播、2:VR直播、3:高清直播 4.4K直播, 默认为0 | Integer | 可选 |
videoWidth | 分辨率:宽 | Integer | 必须 |
videoHeight | 分辨率:高 | Integer | 必须 |
videoBitrate | 视频码率 | Integer | 必须 |
audioBitrate | 音频码率 | Integer | 必须 |
frameRate | 视频帧率 | Integer | 必须 |
advancedArguments | 高级参数,样例:{"rc":"CBR","gopSize":4000,"bFrame":0,"refFrame":1,"qualityLevel":null,"interlace":-1,"smartBorder":1} | String | 可选 |
返回数据:
{
"result": {
"displayName": "直播模版测试",
"updateTime": null,
"templateId": null,
"type": "1",
"userId": 805,
"audioBitrate": 6400,
"videoHeight": 200,
"videoWidth": 200,
"videoBitrate": 800,
"frameRate": 25,
"isDefault": null,
"createTime": null,
"name": "显示名称33\/800kbps\/200x200",
"advancedArguments": "{\"rc\":\"CBR\",\"gopSize\":4000,\"bFrame\":0,\"refFrame\":1,\"qualityLevel\":null,\"interlace\":-1,\"smartBorder\":1}",
"advancedArgumentsObj": {
"rc": "CBR",
"refFrame": 1,
"gopSize": 4000,
"bframe": 0,
"interlace": -1,
"gopType": null,
"smartBorder": 1
},
"id": "1eb10a03562d4dcfab7d510366aa394c",
"transcodeType": 0,
"videoCodec": "h264"
},
"code": 0,
"success": true,
"message": "操作成功"
}
返回字段说明
code:状态码
message:状态描述
result:返回直播模版集合信息
success:成功/失败
id:唯一标识
name:模版名称/码率/宽x高
displayName:模版名称
videoWidth:视频宽
videoHeight:视频高
videoBitrate:视频码率
audioBitrate:音频码率
frameRate:视频帧率
transcodeType:所属直播类型。 0:普通直播、2:VR直播、3:进阶直播
type:模板类型 1.用户模板 2.系统模板
userId:用户id,如果是系统的模板,此项为空
createTime:创建时间
updateTime:更新时间
advancedArgumentsObj : 高级参数
rc:码率控制
refFrame: 参考帧
gopSize: GOP大小
bframe: B帧
interlace": 帧场模式 -1-跟随源 0-帧 3-MBAFF
gopType: gop单位:0-帧(默认) 1-时间(毫秒)
smartBorder: 宽高变换模式:0-线性拉伸 1-智能黑边 2-自动裁剪
修改直播模板
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为 liveTemplateUpdate | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必须 |
id | 直播模版唯一标识 | String | 必须 |
displayName | 显示名称 | String | 可选 |
type | 模板类型 1.用户模板 此处填 1 | Integer | 可选 |
transcodeType | 转码类型 0:普通直播、2:VR直播、3:高清直播 4.4K直播, 默认为0 | Integer | 可选 |
videoWidth | 分辨率:宽 | Integer | 可选 |
videoHeight | 分辨率:高 | Integer | 可选 |
videoBitrate | 视频码率 | Integer | 可选 |
audioBitrate | 音频码率 | Integer | 可选 |
frameRate | 视频帧率 | Integer | 可选 |
advancedArguments | 高级参数 | JSON对象 | 可选 |
返回数据:
{
"result": {
"displayName": "显示名称44",
"updateTime": null,
"templateId": null,
"type": "1",
"userId": 805,
"audioBitrate": 6400,
"videoHeight": 200,
"videoWidth": 200,
"videoBitrate": 800,
"frameRate": 25,
"isDefault": null,
"createTime": null,
"name": "显示名称44\/800kbps\/200x200",
"advancedArguments": "{\"rc\":\"CBR\",\"gopSize\":4000,\"bFrame\":0,\"refFrame\":1,\"qualityLevel\":null,\"interlace\":-1,\"smartBorder\":1}",
"advancedArgumentsObj": {
"rc": "CBR",
"refFrame": 1,
"gopSize": 4000,
"bframe": 0,
"interlace": -1,
"gopType": null,
"smartBorder": 1
},
"id": "1eb10a03562d4dcfab7d510366aa394c",
"transcodeType": null,
"videoCodec": "h264"
},
"code": 0,
"success": true,
"message": "操作成功"
}
返回字段说明
code:状态码
message:状态描述
result:返回直播模版集合信息
success:成功/失败
id:唯一标识
name:模版名称/码率/宽x高
displayName:模版名称
videoWidth:视频宽
videoHeight:视频高
videoBitrate:视频码率
audioBitrate:音频码率
frameRate:视频帧率
transcodeType:所属直播类型。 0:普通直播、2:VR直播、3:进阶直播
type:模板类型 1.用户模板 2.系统模板
userId:用户id,如果是系统的模板,此项为空
createTime:创建时间
updateTime:更新时间
advancedArgumentsObj : 高级参数
rc:码率控制
refFrame: 参考帧
gopSize: GOP大小
bframe: B帧
interlace": 帧场模式 -1-跟随源 0-帧 3-MBAFF
gopType: gop单位:0-帧(默认) 1-时间(毫秒)
smartBorder: 宽高变换模式:0-线性拉伸 1-智能黑边 2-自动裁剪
删除直播模板,批量删除
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为 liveTemplateDelete | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必须 |
id | 直播模版唯一标识,多个ID用“,”分隔 | String | 必须 |
返回数据:
{
"code": 0,
"message": "success",
"count": 0
}
返回字段说明
code:状态码
message:状态描述
success:成功/失败
查询直播模板
服务地址:
http://api.danghongyun.com/rest
请求方式:
GET
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为 liveGetTemplates | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
name | 直播模版名称 | String | 可选 |
type | 直播模版类型。1:用户模版,2:系统模版 | String | 可选 |
transcodeType | 所属直播类型。 0:普通直播、2:VR直播、3:进阶直播 | Integer | 可选 |
返回数据:
{
"code": 0,
"message": "操作成功",
"result": [{
"id": "abeef1197e4641728d4a837e7d54a759",
"displayName": "VR超清",
"transcodeType": 2,
"videoWidth": 2048,
"videoHeight": 1024,
"videoBitrate": 8000,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 10,
"updateTime": null,
"name": "VR超清/8000kbps/2048x1024"
},
{
"id": "e92e9feef23e49f5ababc70d7172b5f8",
"displayName": "2K",
"transcodeType": 3,
"videoWidth": 2560,
"videoHeight": 1440,
"videoBitrate": 4000,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 6,
"updateTime": null,
"name": "2K/4000kbps/2560x1440"
},
{
"id": "43ca60d4dc9143bcb7410a4444233e47",
"displayName": "高清",
"transcodeType": 0,
"videoWidth": 1280,
"videoHeight": 720,
"videoBitrate": 750,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 4,
"updateTime": null,
"name": "高清/750kbps/1280x720"
},
{
"id": "7d9b8e4f1af047b6b336bf6d17adce7c",
"displayName": "源流",
"transcodeType": 0,
"videoWidth": 0,
"videoHeight": 0,
"videoBitrate": 0,
"audioBitrate": 0,
"frameRate": 0,
"type": "2",
"userId": null,
"createTime": 1,
"updateTime": null,
"name": "PASSTHROUGH"
}],
"success": true
}
返回字段说明
code:状态码
message:状态描述
result:返回直播模版集合信息
success:成功/失败
id:唯一标识
name:模版名称/码率/宽x高
displayName:模版名称
videoWidth:视频宽
videoHeight:视频高
videoBitrate:视频码率
audioBitrate:音频码率
frameRate:视频帧率
transcodeType:所属直播类型。 0:普通直播、2:VR直播、3:进阶直播
type:模板类型 1.用户模板 2.系统模板
userId:用户id,如果是系统的模板,此项为空
createTime:创建时间
updateTime:更新时间
创建直播logo
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为 liveLogoCreate | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必须 |
name | logo名称 | String | 必须 |
uri | 台标路径,如:bj-hsy-images/kii721n6/watermarkLive/65112b7ae7394313a679020c3543cae9.jpg | String | 必须 |
width | 台标宽度 | Integer | 必须 |
height | 台标高度 | Integer | 必须 |
offsetWidth | 台标左上角顶点水平偏移 | Integer | 必须 |
offsetHeight | 台标左上角顶点垂直偏移 | Integer | 必须 |
opacity | 台标透明度,0~100,100代表不透明,默认100 | Integer | 可选 |
resize | 台标缩放比例,1~100,100代表不缩放,默认100 | Integer | 可选 |
返回数据:
{
"result": {
"httpUrl": "http://kii721n6.images.danghongyun.com/watermarkLive/65112b7ae7394313a679020c3543cae9.jpg",
"offsetHeight": 1,
"name": "测试logo",
"width": 200,
"offsetWidth": 1,
"resize": 100,
"id": "afe8c827f18044c8942524eb7738f693",
"opacity": 100,
"userId": 805,
"uri": "bj-hsy-images/kii721n6/watermarkLive/65112b7ae7394313a679020c3543cae9.jpg",
"height": 200
},
"code": 0,
"success": true,
"message": "操作成功"
}
返回字段说明
code:状态码
message:状态描述
success:成功/失败
修改直播logo
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为 liveLogoUpdate | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必须 |
id | logo唯一标识 | String | 必须 |
name | logo名称 | String | 可选 |
uri | 台标路径,如:bj-hsy-images/kii721n6/watermarkLive/65112b7ae7394313a679020c3543cae9.jpg | String | 可选 |
width | 台标宽度 | Integer | 可选 |
height | 台标高度 | Integer | 可选 |
offsetWidth | 台标左上角顶点水平偏移 | Integer | 可选 |
offsetHeight | 台标左上角顶点垂直偏移 | Integer | 可选 |
opacity | 台标透明度,0~100,100代表不透明 | Integer | 可选 |
resize | 台标缩放比例,1~100,100代表不缩放 | Integer | 可选 |
返回数据:
{
"message": "更新直播台标成功,id:0daa628c5e1944ce99e78c28f146e027",
"code": 0,
"success": true
}
返回字段说明
code:状态码
message:状态描述
success:成功/失败
删除直播logo,批量删除
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveLogoDelete | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必须 |
id | logo唯一标识,多个id用“,”分隔 | String | 必须 |
返回数据:
{
"code": 0,
"success": true,
"message": "操作成功"
}
返回字段说明
code:状态码
message:状态描述
success:成功/失败
查询直播logo
服务地址:
http://api.danghongyun.com/rest
请求方式:
GET
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveLogoList | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
name | 直播台标名称 | String | 可选 |
id | 直播台标id | String | 可选 |
返回数据:
{
"code": 0,
"message": "操作成功",
"result": [{
"id": "ccc6327ae86d476b9c39f7b73dcb687a",
"name": "测试台标1",
"userId": 106,
"width": 167,
"height": 50,
"offsetWidth": 449,
"offsetHeight": 18,
"opacity": 100,
"resize": 100,
"httpUrl": "http://p1u0enox.images.danghongyun.local/watermarkLive/3f65c896763e40219ac10c5266641a93.png"
},
{
"id": "fd59c92a54574fdd8ff874a86fe8ec51",
"name": "测试台标2",
"userId": 106,
"width": 512,
"height": 512,
"offsetWidth": 529,
"offsetHeight": 9,
"opacity": 100,
"resize": 18,
"httpUrl": "http://p1u0enox.images.danghongyun.local/watermarkLive/8537b53a15b247f4a82156df83de5e82.png"
}],
"success": true
}
返回字段说明
code:状态码
message:状态描述
result:返回直播台标集合信息
success:成功/失败
id:唯一标识
name:台标名称
userId:用户id
width:台标宽度
height:台标高度
offsetWidth:台标左上角距离视频左边的距离(宽度以640为基准,实际输出会按照倍率计算)
offsetHeight:台标左上角距离视频顶部的距离(高度以360为基准,实际输出会按照倍率计算)
opacity:透明度
resize:基于原图的放大倍数,例:100为保持原图大小 50为缩小一倍
httpUrl:台标访问地址
创建直播类型
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveChannelTypeCreate | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
name | 直播类型名称 | String | 必选 |
返回数据:
{
"code":0,
"message":"操作成功",
"result":
{
"id":"c2c6dbe434fd4ea795ccafe789f47008",
"name":"直播分类测试1",
"userId":943,
"createTime":null,
"updateTime":null
},
"success":true
}
返回字段说明
code:状态码
message:状态描述
result:返回实体信息
success:成功/失败
id:唯一标识
name:直播分类名称
userId:用户Id
createTime:创建时间
updateTime:更新时间
修改直播类型
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveChannelTypeUpdate | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
id | 直播类型Id | String | 必选 |
name | 直播类型名称 | String | 必选 |
返回数据:
{
"code":0,
"message":"操作成功",
"result":
{
"id":"58e8ccdb291b4cb5a6a3ffc38871eab7",
"name":"直播类型1",
"userId":229,
"createTime":null,
"updateTime":null
},
"success":true
}
返回字段说明
code:状态码
message:状态描述
result:返回实体信息
success:成功/失败
id:唯一标识
name:直播分类名称
userId:用户Id
createTime:创建时间
updateTime:更新时间
查询直播类型
服务地址:
http://api.danghongyun.com/rest
请求方式:
GET
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveChannelTypeList | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
id | 直播类型Id | String | 可选 |
name | 直播类型名称 | String | 可选 |
返回数据:
{
"code":0,
"message":"操作成功",
"result":
[
{
"id":"7a890dd49c0349f696a58d724cde03a6",
"name":"wjhTestLiveType2222",
"userId":229,
"createTime":1499935511000,
"updateTime":1499950525000
},
{
"id":"d05e1cc30e754c5a940c721eb9df0acf",
"name":"测试类型-dcz",
"userId":229,
"createTime":1503452451000,
"updateTime":null
},
{
"id":"58e8ccdb291b4cb5a6a3ffc38871eab7",
"name":"直播类型1",
"userId":229,
"createTime":1520930804000,
"updateTime":1520931684000
}
],
"success":true
}
返回字段说明
code:状态码
message:状态描述
result:返回直播类型集合
success:成功/失败
id:唯一标识
name:直播分类名称
userId:用户Id
createTime:创建时间
updateTime:更新时间
根据id删除直播频道类型
服务地址:
http://api.danghongyun.com/rest
请求方式:
POST
接收参数:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
accessKey | 用户访问key | String | 必选 |
action | api名称,此接口为liveChannelTypeDelete | String | 必选 |
version | api版本,目前必须为 2.0 | String | 必选 |
signature | 签名 | String | 必选 |
timestamp | api调用时间戳,1970年1月1日以来的毫秒数,如1466488681033 | String | 必选 |
id | 直播类型Id | String | 必选 |
返回数据:
{
"code":0,
"message":"操作成功",
"success":true
}
返回字段说明:
code:状态码
message:状态描述
success:成功/失败
当虹云直播时移说明
使用前提
1. 创建的直播频道勾选了时移功能
2. 频道处于直播中或已结束
服务地址:
时移的请求地址即直播的播放地址,通过"获取频道播放地址"接口拿到输出组中的具体某个分辨率的播放地址,例如:
{
"code":0,
"message":"操作成功",
"result":
[
{
"channelId":"159ef2c1a43c49539823c01c2c992e88",
"channelGroupId":"08b0d46174084af1993c535bd5a25af0",
"channelGroupType":1,
"playUrl":http://281y4liq.live1.danghongyun.com/live/hls/159ef2c1a43c49539823c01c2c992e88/08b0d46174084af1993c535bd5a25af0-1.m3u8",
"playUrlList":
[
{
"url":"http://281y4liq.live1.danghongyun.com/live/hls/159ef2c1a43c49539823c01c2c992e88/08b0d46174084af1993c535bd5a25af0-1.m3u8",
"width":720,
"height":576,
"videoBitrate":450,
"audioBitrate":64,
"defaultVideo":"0"
}
]
}
],
"success":true
}
参数说明:
参数 | 描述 | 数据类型 | 必选/可选 |
---|---|---|---|
timeshift | 要时移的时间点与当前时间的差值,负整数,单位秒 | int | 必选 |
beginTime | 时移回看的开始时间点(北京时区)格式为:yyyyMMddHHmmss | String | 可选 |
endTime | 时移回看的结束时间点(北京时区)格式为:yyyyMMddHHmmss | String | 可选 |
返回结果:
- 带有timeshift参数的返回的为hls直播流,且每次请求返回的直播内容不同
- 仅带有beginTime参数的返回为hls直播流,且每次请求返回的直播内容相同
- 带有beginTime及endTime参数的返回的为hls点播文件
请求范例
时移
观看1小时前的直播内容(时移时长需要大于1小时,否则返回异常):
正常响应结果为hls直播流:
#EXTM3U\n
#EXT-X-VERSION:3\n
#EXT-X-TARGETDURATION:4\n
#EXT-X-MEDIA-SEQUENCE:1\n
#EXT-X-PROGRAM-DATE-TIME:2016-10-13T06:51:22Z\n
#EXTINF:3.333\n994ae6e12a7d41a79ac501cb38e29fc9-1/201610130651/2016-10-13T06:51:22Z_3.333_1.ts\n
#EXT-X-PROGRAM-DATE-TIME:2016-10-13T06:51:26Z\n
#EXTINF:3.333\n994ae6e12a7d41a79ac501cb38e29fc9-1/201610130651/2016-10-13T06:51:26Z_3.333_2.ts\n
#EXT-X-PROGRAM-DATE-TIME:2016-10-13T06:51:29Z\n
#EXTINF:3.334\n994ae6e12a7d41a79ac501cb38e29fc9-1/201610130651/2016-10-13T06:51:29Z_3.334_3.ts\n
#EXT-X-PROGRAM-DATE-TIME:2016-10-13T06:51:32Z\n
#EXTINF:3.333\n994ae6e12a7d41a79ac501cb38e29fc9-1/201610130651/2016-10-13T06:51:32Z_3.333_4.ts\n
#EXT-X-PROGRAM-DATE-TIME:2016-10-13T06:51:36Z\n
#EXTINF:3.333\n994ae6e12a7d41a79ac501cb38e29fc9-1/201610130651/2016-10-13T06:51:36Z_3.333_5.ts\n
异常响应结果为json格式:
{
"code":1,
"message":"异常信息"
}
回看
回看2018-01-01 12:00:00 ~ 2018-01-01 12:30:00 半小时内的视频内容(直播开始时间需要 早于2018-01-01 12:00:00,否则返回异常):
正常响应结果为hls点播文件:
#EXTM3U\n
#EXT-X-VERSION:3\n
#EXT-X-TARGETDURATION:4\n
#EXTINF:3.333\n994ae6e12a7d41a79ac501cb38e29fc9-1/201610130651/2016-10-13T06:51:22Z_3.333_1.ts\n
#EXTINF:3.333\n994ae6e12a7d41a79ac501cb38e29fc9-1/201610130651/2016-10-13T06:51:26Z_3.333_2.ts\n
#EXTINF:3.334\n994ae6e12a7d41a79ac501cb38e29fc9-1/201610130651/2016-10-13T06:51:29Z_3.334_3.ts\n
#EXTINF:3.333\n994ae6e12a7d41a79ac501cb38e29fc9-1/201610130651/2016-10-13T06:51:32Z_3.333_4.ts\n
#EXTINF:3.333\n994ae6e12a7d41a79ac501cb38e29fc9-1/201610130651/2016-10-13T06:51:36Z_3.333_5.ts\n
#EXT-X-ENDLIST
异常响应结果为json格式:
{
"code":1,
"message":"异常信息"
}