All Products
Search
Document Center

AddTranscodeTemplateGroup

Last Updated: Jul 11, 2019

Description

You can call this operation to add transcoding configurations. Specifically, you can create a transcoding template group or add a transcoding template to the specified template group.

Note:

  • You cannot perform custom operations on transcoding template groups that are locked in the ApsaraVideo for VOD console. To operate such transcoding template groups, contact ApsaraVideo for VOD technical support.
  • An OSS bucket is required for storing the files involved in transcoding. You can create a transcoding template group only after ApsaraVideo for VOD has allocated a bucket to you.
  • You cannot add any transcoding templates to the No Transcoding template group.
  • You can create a maximum of 20 transcoding template groups.
  • You can add a maximum of 20 transcoding templates to a transcoding template group.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set this parameter to AddTranscodeTemplateGroup.
TranscodeTemplateGroupId String No The ID of the transcoding template group.
Name String No The name of the transcoding template group.
  • Length constraint: Maximum length of 128 bytes.
  • Encoding: UTF-8.
TranscodeTemplateList TranscodeTemplate[] No The transcoding template configuration information. The value is a JSON-formatted string.

Note:

  • If the TranscodeTemplateList parameter is not contained in the request, no transcoding process is initiated. That is, transcoding is not triggered after a video file is uploaded.
  • Either the TranscodeTemplateGroupId or Name parameter must be contained in the request.

Response parameters

Parameter Type Description
RequestId String The ID of the request.
TranscodeTemplateGroupId String The ID of the transcoding template group.

API examples

Sample request

https://vod.cn-shanghai.aliyuncs.com?Action=AddTranscodeTemplateGroup&Name=transcodetemplate&TranscodeTemplateList=[{"Video":{"Bitrate":"400","Codec":"H. 264","Fps":"30"},"Audio":{"Codec":"AAC","Bitrate":"64","Definition":"SD","EncryptType":"Private","Container":{"Format":"m3u8"},"PackageType":"HLSPackage"}}]

Sample response

JSON format

{
  "RequestId": "25818875-5F78-4A13-BEF6-D7393642CA58",
  "TranscodeTemplateGroupId":"34e908aa4024a9ae4df7821c31f93a2a"
}

Error codes

This operation also returns common errors. For more information about errors common to all operations, see common errors.

Error code Error message HTTP status code Description
InvalidStorage.NotFound The storage info does not exist. 404 The error message returned because no bucket has been allocated by ApsaraVideo for VOD.
InvalidTranscodeTemplateGroup.NotFound The transcode template group does not exist 404 The error message returned because the specified transcoding template group does not exist.
Forbidden.LockedTemplateGroup The transcode template group has been locked. 403 The error message returned because the specified transcoding template group is locked and cannot be operated. To operate the transcoding template group, contact ApsaraVideo for VOD technical support.
Forbidden.SpecialTemplateGroup The transcode template group is using for special purpose. 403 The error message returned because the specified transcoding template group is a special one, such as the No Transcoding or Storage Only template group, where no transcoding template can be added.
TrasncodeTemplateGroupExceededMax The transcode template group size exceeded maximum. 400 The error message returned because the number of transcoding template groups exceeds the upper limit. You can create a maximum of 20 transcoding template groups.
TranscodeTemplateExceededMax The template transcode template config size exceeded maximum. 400 The error message returned because the number of transcoding templates added to the specified transcoding template group exceeds the upper limit. You can add a maximum of 20 transcoding templates to a transcoding template group.
WatermarkExceededMax The watermark size exceeded maximum. 400 The error message returned because the number of watermark IDs associated with a single transcoding template in the transcoding template group exceeds the upper limit. You can associate a maximum of four watermark IDs with a transcoding template.

SDK examples

We recommend that you use a server SDK to call this operation. For more information about the sample code used to call this operation in various languages, see the following topics: