All Products
Search
Document Center

ApsaraVideo VOD:RegisterMedia

Last Updated:Oct 13, 2026

Registers media assets. If you have existing media asset files stored in your own OSS buckets integrated with ApsaraVideo VOD, you must register the media assets to generate the associated data required by ApsaraVideo VOD before you can use features such as transcoding and snapshot generation.

Operation description

  • For audio and video media files already stored in OSS buckets integrated with ApsaraVideo VOD, you must call the media asset registration operation to generate the associated data required by ApsaraVideo VOD. Then, you can initiate transcoding, snapshot generation, and AI processing for these media files by using their media IDs in ApsaraVideo VOD.

  • You can register up to 10 OSS media files at a time, and the storage addresses of the media files submitted at a time must be the same.

  • For media files uploaded to ApsaraVideo VOD, if no transcoding template group ID is specified, the default template group is used for transcoding. In contrast, after you register media assets, if no transcoding template group ID is specified, transcoding is not automatically triggered. If a transcoding template group ID is specified, the specified template group is used for transcoding.

  • For repeatedly registered media files, only the unique media ID associated with the file is returned, and no other processing is performed.

  • Make sure that the media asset files you want to register have valid file name extensions. Otherwise, the registration fails.

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:RegisterMedia

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegisterMetadatas

string

Yes

The metadata of the media assets to be registered. The value is a JSON string. You can specify the metadata for up to 10 media assets at a time. For more information about the parameter structure, see the RegisterMetadata table below.

[{"FileURL":"https://****.oss-cn-shanghai.aliyuncs.com/video/test/video123.m3u8","Title":"VideoName"}]

TemplateGroupId

string

No

The ID of the transcoding template group. You can obtain the ID by using one of the following methods:

  • Log on to the ApsaraVideo VOD console and choose Configuration Management > Media Processing Configuration > Transcoding Template Groups to view the ID of the transcoding template group.

  • When you create a transcoding template group by calling the Create a transcoding template group operation, the ID of the transcoding template group is the value of the TranscodeTemplateGroupId response parameter.

  • When you query transcoding template groups by calling the Query transcoding configurations operation, the ID of the transcoding template group is the value of the TranscodeTemplateGroupId response parameter.

Note
  • If transcoding is not required, set this parameter to VOD_NO_TRANSCODE, which specifies the no-transcoding template group. Otherwise, the video status is Upload Completed, and you cannot use the playback service to play the audio or video. If transcoding is required, specify the ID of the corresponding transcoding template group.

  • If both WorkflowId and TemplateGroupId are specified, WorkflowId takes precedence. For more information, see Media workflows.

  • The task for this parameter is an asynchronous task. After the task is submitted, it is not immediately completed but queued for asynchronous execution in the background.

ca3a8f6e49c87b65806709586****

UserData

string

No

The custom settings. The value is a JSON string. You can configure settings such as message callbacks. For more information about the parameter, see UserData.

Note

This operation does not support callbacks. Even if a message callback is configured in this parameter, no callback message is generated after the media asset registration is completed. When you subsequently initiate media processing such as transcoding and snapshot generation for the registered media assets, if you separately configure a message callback in UserData when initiating the transcoding or snapshot generation, that callback URL takes precedence. If no callback is separately configured, the callback URL configured in UserData during the media asset registration is used.

{"Extend":{"localId":"****","test":"www"}}

WorkflowId

string

No

The ID of the media workflow. You can log on to the ApsaraVideo VOD console and choose Configuration Management > Media Processing Configuration > Workflow Management to view the workflow ID.

Note
  • If both WorkflowId and TemplateGroupId are specified, WorkflowId takes precedence. For more information, see Media workflows.

  • The task for this parameter is an asynchronous task. After the task is submitted, it is not immediately completed but queued for asynchronous execution in the background.

637adc2b7ba51a83d841606f8****

EnableFirstFrameCover

boolean

No

Specifies whether to use the first frame of the video as the thumbnail.

GenerateThumbnail

boolean

No

Specifies whether to generate a thumbnail for the video.

RegisterMetadata

The metadata of the media assets to be registered.

NameTypeRequiredDescription
FileURLStringYesThe URL of the source file. You can obtain the URL by calling the Get source file information operation.
The URL can be up to 1,024 bytes in length. The file name must be globally unique. If you add a file with the same name, it is associated with the unique media ID. The format is the public endpoint of the OSS bucket + ObjectName (file name).

TitleStringYesThe title. The title can be up to 128 bytes in length. It must be encoded in UTF-8.
DescriptionStringNoThe description. The description can be up to 1,024 bytes in length. It must be encoded in UTF-8.
TagsStringNoThe tags. A single tag can be up to 32 bytes in length. You can specify up to 16 tags. Separate multiple tags with commas (,). It must be encoded in UTF-8.
CoverURLStringNoThe thumbnail URL. The URL can be up to 1,024 bytes in length.
CateIdLongNoThe category ID. You can obtain the ID by using one of the following methods:
Log on to the ApsaraVideo VOD console and choose Configuration Management > Media Asset Management Configuration > Category Management to view the category ID.
When you create a category by calling the Create a category operation, the category ID is the value of the CateId response parameter.
When you query categories by calling the Get categories and subcategories operation, the category ID is the value of the CateId response parameter.







ReferenceIdStringNoThe custom ID. The ID can be 6 to 64 characters in length and can contain only lowercase letters, uppercase letters, digits, hyphens (-), and underscores (_). The ID must be unique per user.

Response elements

Element

Type

Description

Example

object

The response.

RequestId

string

The ID of the request.

14F43C5C-8033-448B-AD04F64E5098****

FailedFileURLs

array

The list of URLs of the files that failed to be registered.

string

The list of URLs of the files that failed to be registered.

["http://****.oss-cn-shanghai.aliyuncs.com/vod_sample_03.mp4"]

RegisteredMediaList

array<object>

The list of media assets that are successfully registered in this request, including newly registered files and previously registered files.

object

The registration details.

NewRegister

boolean

Specifies whether the media asset is newly registered or repeatedly registered.

  • true: The media asset is newly registered.

  • false: The media asset is repeatedly registered.

false

FileURL

string

The URL of the OSS file.

http://****.oss-cn-shanghai.aliyuncs.com/vod_sample_01.mp4

MediaId

string

The media ID in ApsaraVideo VOD. If the registered media file is an audio or video file, this parameter corresponds to the VideoId in ApsaraVideo VOD.

d97af32828084d1896683b1aa38****

Examples

Success response

JSON format

{
  "RequestId": "14F43C5C-8033-448B-AD04F64E5098****",
  "FailedFileURLs": [
    "[\"http://****.oss-cn-shanghai.aliyuncs.com/vod_sample_03.mp4\"]"
  ],
  "RegisteredMediaList": [
    {
      "NewRegister": false,
      "FileURL": "http://****.oss-cn-shanghai.aliyuncs.com/vod_sample_01.mp4",
      "MediaId": "d97af32828084d1896683b1aa38****"
    }
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.