Skip to main content

Create Channel

Service Address

http://api-az-cn.danghongyun.com/rest

Request Method

POST

Request Parameters

ParameterDescriptionTypeRequired
accessKeyThe user access keyStringRequired
actionAPI name, this api is "liveCreateChannel"StringRequired
versionapi version,it must be at the moment 2.0StringRequired
signatureSignature generated by signature rule.StringRequired
timestampapi call timestamp,Invoke time in milliseconds since january 1 1970,eg 1466488681033StringRequired

In addition pass the parameters created by the live channel in the form of json in the body of the http packet and set the content type in the http header to application json and the specific parameters are as follows

ParameterRequiredDescription
nametrueString,the name of the channel
signalTypetrueString,source stream type 1 push stream 2 pull stream
pullStreamfalseString,stream pulling address which is required if the source stream type is set to stream pulling
liveTypefalseInteger,live broadcast type 0 normal live broadcast 2 vr live broadcast 3 advanced live broadcast do not pass the default follow template type
typeNamefalseString, type name
typefalseString, the type of channel(categorize your live streams id==typeid)
outputGroupList.protocolTypetrueInteger,live output group protocol type 1 hls 2 rtmp
outputGroupList.rtmpThirdPartyOutputUrlfalseString,the third party ingest address can be optionally entered under the rtmp protocol
outputGroupList.rotationfalseString,the degree of rotation of the picture, the value is 0 90 or 270
outputGroupList.isRecordfalseString,whether to enable recording,0 is not enabled 1 is enabled default is 0
outputGroupList.needToMp4falseString,whether the recorded file is converted to mp4,0 no 1 yes default 0
outputGroupList.isTimeShiftfalseString,whether to enable time shifting,0 do not enable 1 enable default 0 . time shifting can only be enabled under the hls protocol
outputGroupList.timeShiftDurationfalseString,Time Shifting Duration Which Is Required If Time Shifting Is Enabled(units hours)
outputGroupList.isLiveEncryptfalseString,whether encryption is enabled,0 do not enable 1 enable default 0 . encryption can only be enabled under the hls protocol
outputGroupList.logoIdfalseString,live broadcast logoId
outputGroupList.outputTemplateList.templateIdtrueString,live streaming templates id
outputGroupList.outputTemplateList.isDefaulttrueString,default or not 0 no 1 yes

Request Example

{
"name": "added a normal channel to the test",
"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"
}]
}]
}

Response Example

{
"code": 0,
"message": "operation success",
"result": {
"id": "377fc5664a8a4af189d3cec73aef1d76",
"name": "added a normal channel to the test",
"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": "sd",
"transcodeType": 0,
"videoWidth": 720,
"videoHeight": 576,
"videoBitrate": 450,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 3,
"updateTime": null,
"name": "sd/450kbps/720x576"
},
{
"templateId": null,
"isDefault": null,
"id": "6c01632990dc412b911cc7ba0b45885a",
"displayName": "ordinary",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "ordinary/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": "ordinary",
"transcodeType": 0,
"videoWidth": 640,
"videoHeight": 352,
"videoBitrate": 270,
"audioBitrate": 64,
"frameRate": 30,
"type": "2",
"userId": null,
"createTime": 2,
"updateTime": null,
"name": "ordinary/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
}

Response Fields

See Channel.