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