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
Test
RAM authorization
|
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:
Note
|
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.
| Name | Type | Required | Description |
| FileURL | String | Yes | The 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. |
| Title | String | Yes | The title. The title can be up to 128 bytes in length. It must be UTF-8 encoded. |
| Description | String | No | The description. The description can be up to 1,024 bytes in length. It must be UTF-8 encoded. |
| Tags | String | No | The 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. |
| CoverURL | String | No | The URL of the thumbnail. The URL can be up to 1,024 bytes in length. |
| CateId | Long | No | The 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. |
| ReferenceId | String | No | A 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.
|
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.