All Products
Search
Document Center

ApsaraVideo VOD:RegisterMedia

Last Updated:Jul 21, 2026

Registers media assets. Existing media files stored in your own OSS bucket that is connected to ApsaraVideo VOD must be registered to generate the associated data required by VOD before you can use VOD features such as transcoding and snapshotting.

Operation description

  • For audio and video files already stored in an OSS bucket connected to ApsaraVideo VOD, you must call this operation to generate the associated data required by VOD before you can initiate transcoding, snapshotting, AI processing, and other operations on these files by media ID.

  • You can register up to 10 OSS media files at a time, and all media files submitted in a single request must correspond to the same storage address.

  • For media files uploaded through VOD, if no transcoding template group ID is specified, the default template group is used for transcoding. In contrast, after media asset registration, transcoding is not automatically triggered if no transcoding template group ID is specified. If a transcoding template group ID is specified, transcoding is performed based on the specified template group.

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

  • Make sure that the media file you want to register has a valid file name extension. 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 register. The value is a JSON string. You can specify 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 transcoding template group 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 Processing > Transcoding Template Groups to view the transcoding template group ID.

  • Obtain the value of TranscodeTemplateGroupId from the response when you call the CreateTranscodeTemplateGroup operation.

  • Obtain the value of TranscodeTemplateGroupId from the response when you call the ListTranscodeTemplateGroup operation.

Note
  • If transcoding is not required, set this parameter to VOD_NO_TRANSCODE (the no-transcoding template group). Otherwise, the video status is UploadSucc and the video cannot be played by using the playback service. If transcoding is required, specify the corresponding transcoding template group ID.

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

  • This parameter triggers an asynchronous task. After submission, the task enters a background queue for asynchronous execution.

ca3a8f6e49c87b65806709586****

UserData

string

No

The custom settings. The value is a JSON string that supports settings such as message callbacks. For more information, see UserData.

Note

This operation does not support callbacks. Even if you configure a message callback in this parameter, no callback message is generated after media asset registration is complete. When you subsequently initiate media processing such as transcoding or snapshotting on the registered media asset, if you specify a message callback in UserData at that time, that callback URL takes precedence. Otherwise, the callback URL specified in UserData during media asset registration is used.

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

WorkflowId

string

No

The workflow ID. Log on to the ApsaraVideo VOD console and choose Configuration Management > Media Processing > Workflow Management to view the workflow ID.

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

  • This parameter triggers an asynchronous task. After submission, the task enters a background queue for asynchronous execution.

637adc2b7ba51a83d841606f8****

EnableFirstFrameCover

boolean

No

GenerateThumbnail

boolean

No

RegisterMetadata

Specifies the metadata of the media assets to register.

NameTypeRequiredDescription
FileURLStringYesThe URL of the source file. You can obtain this value by calling the GetMezzanineInfo operation.
The URL cannot exceed 1024 bytes. 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 URL is in the format of the public endpoint of the OSS bucket + ObjectName (file name).

TitleStringYesThe title. The title cannot exceed 128 bytes. UTF-8 encoded.
DescriptionStringNoThe description. The description cannot exceed 1024 bytes. UTF-8 encoded.
TagsStringNoThe tags. Each tag cannot exceed 32 bytes. You can specify up to 16 tags. Separate multiple tags with commas (,). UTF-8 encoded.
CoverURLStringNoThe cover URL. The URL cannot exceed 1024 bytes.
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 > Category Management to view the category ID.
Obtain the value of CateId from the response when you call the AddCategory operation.
Obtain the value of CateId from the response when you call the GetCategories operation.







ReferenceIdStringNoThe custom ID. Only lowercase letters, uppercase letters, digits, hyphens (-), and underscores (_) are supported. The value must be 6 to 64 characters in length and must be unique for each user.

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

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

FailedFileURLs

array

The list of file URLs that failed to be registered.

string

The list of file URLs 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, including both newly registered files and previously registered files.

object

The registration details.

NewRegister

boolean

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

  • true: newly registered.

  • false: repeatedly registered.

false

FileURL

string

The OSS file URL.

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

MediaId

string

The VOD media ID. If the registered media file is an audio or video file, this value 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.