Skip to main content

Secondary Transcoding V2

Service Address

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

Request Method

POST

Request Parameters

ParameterDescriptionTypeRequired
accessKeyThe user access keyStringRequired
actionAPI name, this api is "secondTranscodeV2"StringRequired
versionAPI version, currently must be 2.0StringRequired
timestampInvoke time in milliseconds since january 1 1970, eg: 1466488681033StringRequired
signatureSignature generated by signature rule.StringRequired
videoIdsvideo id, multiple IDs separated by ',', eg:"c82c3de31e594ab2ae58db37a92c1395,ff09ba247b9c432f8fe7527d7aaeb5a3"StringRequired
transcodeTemplatestranscoding templates, If using built-in templates, do not pass this parameter. This parameter is only used in the current transcoding and will not be recorded or affect the built-in template.StringOptional
videoTypethe type of video transcoding, 0 normal video transcoding, 1 vr transcoding; This parameter takes effect when the parameter transcodeTemplates is used.IntegerOptional
trailorwhether to transcode the trial clip additionally, false no, true yes, default false; This parameter takes effect when the parameter transcodeTemplates is used.BooleanOptional
trailorDurationTrial duration, in seconds, default 0; This parameter takes effect when the parameter transcodeTemplates is used.LongOptional
transcodeTemplateGroupIdbuilt in transcoding template group ID, can be obtained through the template group list interface. Choose between the parameters transcodeTemplates and transcodeTemplateGroupId, with transcodeTemplates taking priority; If neither is transmitted, use the built-in default regular transcoding template group IDIntegerOptional
replacereplace or save as, 0 save as, 1 replace. Save as will add a new item to the video list, and replace will delete all previous transcoding files after transcoding is completed. BooleanRequired

transcodeTemplates parameter description:

ParameterDescriptionTypeRequired
namethe name of the templateStringRequired
videoWidthvideo widthIntegerRequired
videoHeightvideo heightIntegerRequired
videoBitratevideo bitrate, eg: 1000 is 1000kbpsIntegerRequired
audioBitrateaudio bitrate, eg: 64000 is 64kbpsIntegerRequired
hlswhether to transcode the hls format, false or trueBooleanRequired
mp4whether to transcode mp4 format, false or trueBooleanRequired
flvwhether to transcode the flv format, false or trueBooleanRequired
tswhether to transcode the ts format, false or trueBooleanOptional
hlsEncryptTypehls encrypt type, 0 no encryption, 6 AES encryption, 7 danghong encryptionIntegerOptional
mp4EncryptTypemp4 encrypt type, 0 no encryption, 7 danghong encryptionIntegerOptional
flvEncryptTypeflv encrypt type, 0 no encryption, 7 danghong encryptionIntegerOptional
tsEncryptTypets encrypt type, 0 no encryption, 7 danghong encryptionIntegerOptional
defaultVideodefault video, 1 default playback template, 0 not defaultIntegerOptional
logoGroupIdlogo group id, Can be obtained through the interface for obtaining the list of logo groupsIntegerOptional
an example of a transcoding template:
String transcodeTemplates = "[{"name":"high-definition","videoWidth":1280,"videoHeight":720,"videoBitrate":1000,"audioBitrate":64000,"hls":true,"mp4":true,"flv":false,"ts":false,"hlsEncryptType":6,"mp4EncryptType":7,"flvEncryptType":0,"tsEncryptType":0,"defaultVideo":1}, {"name":"standard -definition","videoWidth":640,"videoHeight":480,"videoBitrate":500,"audioBitrate":64000,"hls":true,"mp4":true,"flv":false,"ts":false,"hlsEncryptType":6,"mp4EncryptType":7,"flvEncryptType":0,"tsEncryptType":0,"defaultVideo":0}]";

Or include the logo group ID:
String transcodeTemplates = "{"logoGroupId":2,"templates":[{"name":"high-definition","videoWidth":1280,"videoHeight":720,"videoBitrate":1000,"audioBitrate":64000,"hls":true,"mp4":true,"flv":false,"ts":false,"hlsEncryptType":6,"mp4EncryptType":7,"flvEncryptType":0,"tsEncryptType":0,"defaultVideo":1}, {"name":"standard -definition","videoWidth":640,"videoHeight":480, "videoBitrate":500,"audioBitrate":64000,"hls":true,"mp4":true,"flv":false,"ts":false,"hlsEncryptType":6,"mp4EncryptType":7,"flvEncryptType":0,"tsEncryptType":0,"defaultVideo":0}]}";

Response Example

{
"code":0, //the value is only 0 or 10000
"message":"success",
"result":
[
{
"id":"b007808b127b417cb7dfa28da0696fb0",
"code":0,
"message":""
},
{
"id":"46af996052f94dd69f7dad8f64c8e6e9",
"code":10012,
"message":"video_not_exists"
}
],
"success":true
}

Error Codes

CodeMessage
0success
10000Exception
10012video_not_exists
10017video_not_exists
10024no_user_transcode_template
10025create_transcode_task_failed
10033transcode_running
10043add_video_failed
10061transcode_template_is_not_correct
10067video_is_in_transcode_waitting_list
10081transcode_template_group_not_exist
10201api_not_exists