All Products
Search
Document Center

ApsaraVideo VOD:RegisterMedia

Last Updated:Dec 09, 2025

Registers media assets. You must register media files from your Object Storage Service (OSS) buckets to use ApsaraVideo VOD features, such as transcoding and snapshotting. Registration generates the associated data that VOD requires to process your files.

Operation description

  • You must register audio and video files that are stored in an OSS bucket integrated with VOD. This process generates the data that VOD needs. You can then use the resulting media ID to start jobs such as transcoding, snapshotting, and AI processing.

  • You can register up to 10 OSS media files in a single request. All files in the request must have the same storage address.

  • Unlike files uploaded to VOD, registered media assets are not automatically transcoded. When you upload a file, it is transcoded using the default template group if no transcoding template group ID is specified. For a registered asset, you must specify a transcoding template group ID to trigger transcoding.

  • If you try to register a file that is already registered, the operation returns its unique media ID and takes no other action.

  • Ensure the media files you register have valid file extensions. Otherwise, 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. This 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 ID of the transcoding template group. You can obtain the ID in the following ways:

  • Log on to the ApsaraVideo VOD console. In the navigation pane, choose Configuration Management > Media Processing > Transcoding Template Groups to view the ID.

  • Call the AddTranscodeTemplateGroup operation. The value of the TranscodeTemplateGroupId parameter in the response is the transcoding template group ID.

  • Call the ListTranscodeTemplateGroup operation. The value of the TranscodeTemplateGroupId parameter in the response is the transcoding template group ID.

Note
  • If you do not need to transcode the media, set this parameter to VOD_NO_TRANSCODE. Otherwise, the video status remains UploadComplete, and you cannot use the playback service. To transcode the media, specify the ID of the desired transcoding template group.

  • If you specify both WorkflowId and TemplateGroupId, WorkflowId takes precedence. For more information, see Workflows.

ca3a8f6e49c87b65806709586****

UserData

string

No

Custom settings. This 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 the media asset is registered. When you later initiate media processing such as transcoding or snapshotting on the registered asset, the system checks for a callback address. If a callback address is specified in the UserData for that specific transcoding or snapshotting request, that address is used. If not, the callback address specified in the UserData during registration is used.

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

WorkflowId

string

No

The ID of the workflow. Log on to the ApsaraVideo VOD console. In the navigation pane, choose Configuration Management > Media Processing > Workflows to view the workflow ID.

Note

If you specify both WorkflowId and TemplateGroupId, WorkflowId takes precedence. For more information, see Workflows.

637adc2b7ba51a83d841606f8****

RegisterMetadata

Specifies the metadata of the media asset to register.

NameTypeRequiredDescription
FileURLStringYesThe URL of the source file. You can obtain this URL by calling the GetMezzanineInfo operation.
The URL can be up to 1,024 bytes in length. The filename must be globally unique. If you add a file with the same name, it is associated with the unique media ID. The URL consists of the public endpoint of the OSS bucket and the object name.

TitleStringYesThe title. The title can be up to 128 bytes in length. It must be UTF-8 encoded.
DescriptionStringNoThe description. The description can be up to 1,024 bytes in length. It must be UTF-8 encoded.
TagsStringNoThe tags. A single tag can be up to 32 bytes in length. You can specify a maximum of 16 tags. Separate multiple tags with commas (,). The tags must be UTF-8 encoded.
CoverURLStringNoThe URL of the thumbnail. The URL can be up to 1,024 bytes in length.
CateIdLongNoThe ID of the category. You can obtain the ID in the following ways:
Log on to the ApsaraVideo VOD console. In the navigation pane, choose Configuration Management > Media Management > Categories to view the category ID.
Call the AddCategory operation. The value of the CateId parameter in the response is the category ID.
Call the GetCategories operation. The value of the CateId parameter in the response is the category ID.







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

Response elements

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The ID of the request.

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

FailedFileURLs

array

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

string

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

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

RegisteredMediaList

array<object>

A list of media assets that were successfully registered in this request. This includes newly registered files and files that were already registered.

object

The registration details.

NewRegister

boolean

Indicates whether the file is newly registered or was already registered.

  • true: The file is newly registered.

  • false: The file was already registered.

false

FileURL

string

The URL of the OSS file.

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

MediaId

string

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