Registers a media asset with Intelligent Media Services (IMS). IMS assigns an ID to the media asset. This operation asynchronously accesses the media asset service in which the media asset is stored to obtain the file information of the media asset based on the input URL. You can also specify basic information, such as the title, tags, and description, for the media asset. This operation returns the ID of the media asset. You can call the GetMediaInfo operation based on the ID to query the details of the media asset. You can set InputURL only to the URL of an Object Storage Service (OSS) file or an ApsaraVideo VOD media asset.
Operation description
Registering a media asset is an asynchronous job that takes 2 to 3 seconds. When the operation returns the ID of the media asset, the registration may have not be completed. If you call the GetMediaInfo operation at this time, you may fail to obtain the information about the media asset.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ice:RegisterMediaInfo |
create |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InputURL |
string |
Yes |
The URL of the media asset in another service. The URL is associated with the ID of the media asset in IMS. The URL cannot be modified once registered. The following types of URLs are supported:
http(s)://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4 oss://example-bucket/example.mp4: In this format, it is considered by default that the region of the OSS bucket in which the media asset resides is the same as the region in which IMS is activated.
vod://***20b48fb04483915d4f2cd8ac**** |
http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.mp4 或 vod://****20b48fb04483915d4f2cd8ac**** |
| MediaType |
string |
No |
The type of the media asset. Valid values:
We recommend that you specify this parameter based on your business requirements. If you set InputURL to an OSS URL, the media asset type can be automatically determined based on the file name extension. For more information . |
video |
| BusinessType |
string |
No |
The business type of the media asset. Valid values:
|
opening |
| Title |
string |
No |
The title. If you do not specify this parameter, a default title is automatically generated based on the date.
|
defaultTitle |
| Description |
string |
No |
The description of the media asset.
|
defaultDescription |
| MediaTags |
string |
No |
The tags of the media asset.
|
tag1,tag2 |
| CoverURL |
string |
No |
The thumbnail URL of the media asset.
|
http://example-bucket.oss-cn-shanghai.aliyuncs.com/example.png |
| UserData |
string |
No |
The user data. You can specify a custom callback URL. For more information.
|
{"NotifyAddress":"http://xx.xx.xxx"} 或{"NotifyAddress":"https://xx.xx.xxx"} 或{"NotifyAddress":"ice-callback-demo"} |
| Overwrite |
boolean |
No |
Specifies whether to overwrite the media asset that has been registered by using the same URL. Default value: false. Valid values: - true: If a media asset has been registered by using the same URL, the original media asset is deleted and the new media asset is registered. - false: If a media asset has been registered by using the same URL, the new media asset is not registered. A URL cannot be used to register multiple media assets. |
true |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. The value must be a UUID that contains 32 characters. |
****0311a423d11a5f7dee713535**** |
| RegisterConfig |
string |
No |
The registration configurations. By default, a sprite is generated for the media asset. You can set NeedSprite to false to disable automatic sprite generation. By default, a snapshot is generated for the media asset. You can set NeedSnapshot to false to disable automatic snapshot generation. |
{ "NeedSprite": "false", "CoverConfig": { "StartTime": 1.0 }, "SearchLibName": "test" } |
| CateId |
integer |
No |
The category ID. |
3048 |
| WorkflowId |
string |
No |
The workflow ID. |
******b4fb044839815d4f2cd8****** |
| ReferenceId |
string |
No |
The custom ID. The ID can be 6 to 64 characters in length and can contain only letters, digits, hyphens (-), and underscores (_). Make sure that the ID is unique among users. |
123-123 |
| SmartTagTemplateId |
string |
No |
The ID of the smart tagging template. Valid values:
After you configure this parameter, a smart tag analysis task is automatically initiated after the media asset is registered. For more information about the billable items. |
S00000101-300080 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
******5A-CAAC-4850-A3AF-B74606****** |
| MediaId |
string |
The ID of the media asset in IMS. |
******b48fb04483915d4f2cd8****** |
Examples
Success response
JSON format
{
"RequestId": "******5A-CAAC-4850-A3AF-B74606******",
"MediaId": "******b48fb04483915d4f2cd8******"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 403 | Forbidden | User not authorized to operate on the specified resource. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.