AddMediaConvertTemplateGroup

Updated at:

Creates a MediaConvert transcoding template group, or appends transcoding template configurations to an existing MediaConvert transcoding template group.

Operation description

  • Specify Name to create a new transcoding template group. Specify TranscodeTemplateGroupId to append transcoding template configurations to the specified transcoding template group. The total number of existing and new templates cannot exceed 20.

  • GroupConfig is not supported in append mode. To modify group-level configurations, call the UpdateMediaConvertTemplateGroup operation.

  • Creating a transcoding template group requires a valid and available storage address. If no available storage address exists, template creation fails. You can activate the VOD system bucket to obtain an available storage address by navigating to ApsaraVideo VOD console > Configuration Management > Media Asset Management Settings > Storage Management.

  • The queries per second (QPS) limit per user is 5. If this limit is exceeded, API calls are throttled, which may affect your services. Call this operation at a reasonable frequency.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vod:AddMediaConvertTemplateGroup

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Name

string

No

The name of the transcoding template group.

  • Required when creating a new transcoding template group. Optional when appending transcoding templates to an existing template group by specifying TranscodeTemplateGroupId.

  • The name must be 1 to 128 characters in length and can contain Chinese characters, letters, digits, underscores (_), number signs (#), hyphens (-), and spaces.

  • The name must be encoded in UTF-8.

mcTemplateGroup

TranscodeTemplateGroupId

string

No

The ID of the transcoding template group. If you specify this parameter, transcoding template configurations are appended to the specified transcoding template group. If you do not specify this parameter, a new transcoding template group is created.

Note

You can only append configurations to transcoding template groups created by using this operation (MediaConvert pipeline).

4c71a339fe52b4fa6f4527****

TranscodeTemplateList

string

No

The transcoding template configurations in JSON string format. You must specify this parameter when you invoke the operation. A transcoding template group supports up to 20 transcoding template configurations, which is the sum of existing and new templates in append mode. Each transcoding template supports the following fields:

  • TemplateName: the name of the transcoding template.

  • Type: the templatetype. Valid values: Normal (normal transcoding template) and VideoPackage (video packaging template). Default value: Normal.

  • Video: the transcoding parameters for the video stream, including Codec (default value: H.264), Profile, Bitrate, Crf, Width, Height, Fps, Gop, and PixFmt.

  • Audio: the transcoding parameters for the audio stream, including Codec (default value: AAC), Samplerate, Bitrate, and Channels (default value: 2).

  • Container.Format: the container format. Valid values: mp4, m3u8, and mpd.

  • MuxConfig: the muxing parameters. When generating an m3u8 file, you can set the segment duration by using Segment.Duration.

  • EncryptSetting: the encryption settings, including EncryptType and EncryptConfig.

  • WatermarkIds: the list of watermark template IDs.

Note

If you do not need to set a property, omit the property instead of passing an empty string.

[{"Definition":"HD","TemplateName":"hd-720p","Type":"Normal","Video":{"Codec":"H.264","Bitrate":"2000","Width":"1280","Height":"720","Fps":"30"},"Audio":{"Codec":"AAC","Bitrate":"128","Samplerate":"44100","Channels":"2"},"Container":{"Format":"m3u8"},"MuxConfig":{"Segment":{"Duration":"10"}}}]

GroupConfig

string

No

The group-level configurations in JSON string format. Currently, AutoStreamName is supported. You can use it to customize the file name of the master playlist generated by adaptive bitrate streaming packaging. You can use the {RunId} placeholder in the value.

Note

This parameter is supported only when creating a new transcoding template group. To modify group-level configurations, call the UpdateMediaConvertTemplateGroup operation.

{"AutoStreamName":"{RunId}_master"}

AppId

string

No

The application ID. Default value: app-1000000. For more information, see Multi-application.

app-****

Response elements

Element

Type

Description

Example

object

TranscodeTemplateGroupId

string

The ID of the transcoding template group.

34e908aa4024af7821c31f93a2a****

RequestId

string

The request ID.

25818875-5F78-4AF6-D7393642CA58****

Examples

Success response

JSON format

{
  "TranscodeTemplateGroupId": "34e908aa4024af7821c31f93a2a****",
  "RequestId": "25818875-5F78-4AF6-D7393642CA58****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.