Skip to main content

Create / Update Template

Service Address

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

Request Method

POST

Request Parameters

ParameterDescriptionTypeRequired
accessKeyThe user access keyStringRequired
actionAPI name, this api is "templateGroup"StringRequired
versionAPI version, currently must be 2.0StringRequired
timestampInvoke time in milliseconds since january 1 1970, eg: 1466488681033StringRequired
signatureSignature generated by signature rule.StringRequired
idTranscoding 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 groupStringRequired
transcodeTemplatesThe 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}]StringRequired
nameThe name of the transcoding template groupStringRequired
typeThis template group is either a regular video template group or a VR video template group, 0: normal template, 1: vr templatesIntegerRequired
trailorWhether to transcode the trial clip additionally, false: no, true: yesBooleanRequired
trailorDurationTrial duration, in secondsLongRequired
logoGroupIdThe id of the station logo group IntegerRequired

transcodeTemplates parameter description:

namethe name of the template StringRequired
videoWidthvideo width IntegerRequired
videoHeightvideo height IntegerRequired
videoBitratevideo bitrate, 1000 is 1000kbps IntegerRequired
audioBitrateaudio bitrate, 64000 is 64kbps IntegerRequired
formattranscoding format, 0 hls, 1 mp4, 2 flv, 3 ts IntegerRequired
encryptTypeEncryption type, 0 not encryption, 6 AES encryption, 7 danghong encryption, currently AES encryption only works for hls IntegerRequired
defaultVideo1 default playback template, 0 not default, Ensure that there is only one defaultVideo=1IntegerRequired
advancedArgumentsadvanced parameters, example: {"rc":"CBR","gopSize":4000,"bFrame":0,"refFrame":1,"qualityLevel":null,"interlace":-1,"smartBorder":1}StringOptional

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

CodeMessage
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