Updates the basic information about a media file.

Usage notes

The basic information that you can update by calling this operation includes the title, description, and category of a media file. This operation applies to a full update. You must set all the parameters unless you want to replace the value of a specific parameter with a NULL value.

Limits on QPS

You can call this operation up to 100 times per second. If the number of calls per second exceeds the limit, throttling is triggered. As a result, your business may be affected. We recommend that you take note of the limit when you call this operation. For more information, see QPS limits.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateMedia

The operation that you want to perform. Set the value to UpdateMedia.

MediaId String Yes 3e1cd21131a94525be55acf65888****

The ID of the media file whose basic information you want to update. To obtain the ID of the media file, you can log on to the ApsaraVideo Media Processing (MPS) console and choose Media Management > Media List in the left-side navigation pane.

Title String No hello

The title of the media file. Multiple character types, such as letters and digits, are supported.

  • If you do not specify this parameter, the value is NULL.
  • The value is encoded in UTF-8 and can be up to 128 bytes in length.
Description String No example description

The description of the media file. Multiple character types, such as letters and digits, are supported.

  • If you do not specify this parameter, the value is NULL.
  • The value is encoded in UTF-8 and can be up to 1,024 bytes in length.
CoverURL String No http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/test****.jpg

The storage location of the thumbnail that you want to specify for the media file. To obtain the URL, you can log on to the MPS console and choose Workflows > Media Buckets. Alternatively, you can log on to the Object Storage Service (OSS) console and click My OSS Paths.

  • The value can be up to 3,200 bytes in length.
  • The URL complies with RFC 2396 and is encoded in UTF-8, with reserved characters being percent-encoded.
CateId Long No 1

The ID of the category to which the media file belongs. The value must be an integer.

  • If you do not specify this parameter, the value is NULL.
  • The value cannot be negative.
Tags String No tag1,tag2

The tags that you want to add for the media file.

  • Separate multiple tags with commas (,). You can specify up to 16 tags for a media file.
  • Each tag can be up to 32 bytes in length.
  • The value is encoded in UTF-8.

Response parameters

Parameter Type Example Description
RequestId String 6A88246F-C91F-42BD-BABE-DB0DF993F960

The ID of the request.

Media Object

The detailed information about the media file.

CreationTime String 2016-09-14T08:30:33Z

The time when the media file was created.

CateId Long 1

The ID of the category to which the media file belongs.

Height String 1080

The height of the media file.

CensorState String Initiated

The review status of the video. Valid values:

  • Initiated: The media file is uploaded but not reviewed.
  • Pass: The media file is uploaded and passes the review.
Tags Array of String tag1,tag2

The tags of the media file.

Bitrate String 2659.326

The bitrate of the media file.

MediaId String 3e1cd21131a94525be55acf65888****

The ID of the media file.

File Object

The information about the input file.

State String Normal

The status of the input file. Valid values:

  • Normal: The input file is normal.
  • Deleted: The input file is deleted.
URL String http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4

The URL of the input file.

PublishState String Published

The publishing status of the media file. Valid values:

  • Initiated: The media file is in the initial state.
  • UnPublish: The media file has not been published, and the playback permission on the OSS object is Private.
  • Published: The media file has been published, and the playback permission on the OSS object is Default.
  • Deleted: The media file is deleted.
Description String example description

The description of the media file.

Width String 1920

The width of the media file.

Size String 2647692

The size of the media file.

CoverURL String http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/example-****.jpg

The storage location of the media thumbnail.

RunIdList Array of String null

The IDs of the media workflow execution instances.

Duration String 7.965000

The duration of the media file.

Fps String 25.0

The frame rate of the media file.

Title String hello

The title of the media file.

Format String mov

The format of the media file. Valid values: mov, mp4, m4a, 3gp, 3g2, and mj2.

Examples

Sample requests

http(s)://mts.cn-hangzhou.aliyuncs.com/?Action=UpdateMedia
&MediaId=3e1cd21131a94525be55acf65888****
&Title=hello
&Description=example description
&CoverURL=http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com/test****.jpg
&CateId=1
&Tags=tag1,tag2
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateMediaResponse>
    <RequestId>6A88246F-C91F-42BD-BABE-DB0DF993F960</RequestId>
    <Media>
        <CreationTime>2016-09-14T08:30:33Z</CreationTime>
        <CateId>1</CateId>
        <Height>1080</Height>
        <CensorState>Initiated</CensorState>
        <Tags>tag1,tag2</Tags>
        <Bitrate>2659.326</Bitrate>
        <MediaId>3e1cd21131a94525be55acf65888****</MediaId>
        <File>
            <State>Normal</State>
            <URL>http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4</URL>
        </File>
        <PublishState>Published</PublishState>
        <Description>example description</Description>
        <Width>1920</Width>
        <Size>2647692</Size>
        <CoverURL>http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/example-****.jpg</CoverURL>
        <RunIdList>{"RunId":["47b42486019c4f688bf144c1a6ba****"]}</RunIdList>
        <Duration>7.965000</Duration>
        <Fps>25.0</Fps>
        <Title>hello</Title>
        <Format>mov</Format>
    </Media>
</UpdateMediaResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "6A88246F-C91F-42BD-BABE-DB0DF993F960",
  "Media" : {
    "CreationTime" : "2016-09-14T08:30:33Z",
    "CateId" : 1,
    "Height" : "1080",
    "CensorState" : "Initiated",
    "Tags" : [ "tag1,tag2" ],
    "Bitrate" : "2659.326",
    "MediaId" : "3e1cd21131a94525be55acf65888****",
    "File" : {
      "State" : "Normal",
      "URL" : "http://example-bucket-****.oss-cn-hangzhou.aliyuncs.com//example-****.mp4"
    },
    "PublishState" : "Published",
    "Description" : "example description",
    "Width" : "1920",
    "Size" : "2647692",
    "CoverURL" : "http://example-bucket-****.oss-cn-shanghai.aliyuncs.com/example-****.jpg",
    "RunIdList" : [ "{\"RunId\":[\"47b42486019c4f688bf144c1a6ba****\"]}" ],
    "Duration" : "7.965000",
    "Fps" : "25.0",
    "Title" : "hello",
    "Format" : "mov"
  }
}

Error codes

For a list of error codes, visit the API Error Center.