Create / Update Template
Service Address
http://api-az-cn.danghongyun.com/rest
Request Method
POST
Request Parameters
Parameter | Description | Type | Required |
---|---|---|---|
accessKey | The user access key | String | Required |
action | API name, this api is "templateGroup" | String | Required |
version | API version, currently must be 2.0 | String | Required |
timestamp | Invoke time in milliseconds since january 1 1970, eg: 1466488681033 | String | Required |
signature | Signature generated by signature rule. | String | Required |
id | Transcoding template group id, When not passing this parameter, it is to add a template group, and when passing this parameter, it is to modify the corresponding template group | String | Required |
transcodeTemplates | The target parameter in the template group, eg: [{"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}] | String | Required |
name | The name of the transcoding template group | String | Required |
type | This template group is either a regular video template group or a VR video template group, 0: normal template, 1: vr templates | Integer | Required |
trailor | Whether to transcode the trial clip additionally, false: no, true: yes | Boolean | Required |
trailorDuration | Trial duration, in seconds | Long | Required |
logoGroupId | The id of the station logo group | Integer | Required |
transcodeTemplates parameter description:
name | the name of the template | String | Required |
videoWidth | video width | Integer | Required |
videoHeight | video height | Integer | Required |
videoBitrate | video bitrate, 1000 is 1000kbps | Integer | Required |
audioBitrate | audio bitrate, 64000 is 64kbps | Integer | Required |
format | transcoding format, 0 hls, 1 mp4, 2 flv, 3 ts | Integer | Required |
encryptType | Encryption type, 0 not encryption, 6 AES encryption, 7 danghong encryption, currently AES encryption only works for hls | Integer | Required |
defaultVideo | 1 default playback template, 0 not default, Ensure that there is only one defaultVideo=1 | Integer | Required |
advancedArguments | advanced parameters, example: {"rc":"CBR","gopSize":4000,"bFrame":0,"refFrame":1,"qualityLevel":null,"interlace":-1,"smartBorder":1} | String | Optional |
advancedArguments: rc:bitrate control refFrame: reference frame gopSize: GOP size bframe: B frame interlace: frame field mode -1-follow the source 0-frame 3-MBAFF gopType: gop unit:0-frame(default) 1-time(millisecond) smartBorder: aspect and height conversion mode 0-linear stretching 1-smart black bars 2-auto cropping
Response Example
{
"result": 1015,
"code": 0,
"success": true,
"message": "success"
}
Error Codes
Code | Message |
---|---|
0 | success |
10000 | exception |
10003 | account_not_exists |
10050 | sub_can_not_modify_transcode_template |
10061 | transcode_template_is_not_correct |
10081 | transcode_template_group_not_exist |
10082 | can_not_modify_this_template_group |
10095 | can_not_modify_default_template_group_type |