跳到主要内容

新建或更新模板

服务地址

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

请求方法

POST

请求参数

参数说明类型是否必须
accessKey访问API用的accessKeyString必选
actionAPI名称,此接口为 "templateGroup"String必选
versionAPI版本,目前必须为2.0 String必选
timestampAPI调用时间戳,1970年1月1日以来的毫秒数,如1466488681033String必选
signature签名,请参考签名规则String必选
id转码模板组id,不传该参数时为增加模板组,传该参数的时候为修改对应模板组String必选
transcodeTemplates模板组内的目标参数,请参考模板说明String必选
name转码模板组名String必选
type该模板组为普通视频模板组或者VR视频模板组, 0:普通模板,1:VR模板Integer必选
trailor是否额外再转码试看片段,false:否,true:是Boolean必选
trailorDuration试看时长,单位秒Long必选
logoGroupId台标组idInteger必选

模板说明

参数说明类型是否必选
name模板名字String必选
videoWidth视频宽度Integer必选
videoHeight视频高度Integer必选
videoBitrate视频比特率,1000为1000kbpsInteger必选
audioBitrate音频比特率,64000为64kbpsInteger必选
format转码格式,0: hls,1: mp4,2: flv,3: tsInteger必选
encryptType加密类型,0: 不加密,6: AES加密,7: 当虹加密,其中AES加密只对hls起作用Integer必选
defaultVideo是否为默认播放模板,0: 否,1: 是,确保列表中默认播放模板有且只有一个Integer必选
advancedArguments高级参数,参见高级参数说明String可选

模板示例

[{"name":"high-quality","videoWidth":1280,"videoHeight":720,"videoBitrate":1000,"audioBitrate":192000,"format":0,"encryptType":6,"defaultVideo":1},{"name":"high-definition","videoWidth":640,"videoHeight":480,"videoBitrate":500,"audioBitrate":192000,"format":1,"encryptType":7,"defaultVideo":0},{"name":"standard-definition","videoWidth":480,"videoHeight":360,"videoBitrate":250,"audioBitrate":192000,"format":2,"encryptType":0,"defaultVideo":0}]

高级参数说明

字段说明类型
rc码率控制,VBR 或 CBRString
refFrame参考帧数量Integer
gopSizeGOP大小Integer
gopTypeGOP单位,0:帧,1:毫秒,默认为0Integer
bframeB帧数量Integer
interlace帧场模式,-1: 跟随源, 0: 帧, 3: MBAFFInteger
smartBorder宽高变换模式, 0: 线性拉伸, 1: 智能黑边, 2: 自动裁剪Integer

高级参数示例

{"rc": "CBR","gopSize": 4000,"bFrame": 0, "refFrame": 1, "qualityLevel": null, "interlace": -1, "smartBorder": 1}

响应示例

{
"result": 1015,
"code": 0,
"success": true,
"message": "success"
}

响应错误码

错误码说明
0success
10000exception
10003account_not_exists
10050sub_can_not_modify_transcode_template
10061transcode_template_is_not_correct
10081transcode_template_group_not_exist
10082can_not_modify_this_template_group
10095can_not_modify_default_template_group_type