Updates a watermark template.

Usage notes

  • You can call this operation to update the information about a watermark template based on the ID of the watermark template. For example, you can update the name and configuration of a watermark template.
  • A watermark template cannot be updated if it is being used by a job that has been submitted.

Limits on QPS

You can call this operation up to 100 times per second. If the number of the 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 UpdateWaterMarkTemplate

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

WaterMarkTemplateId String Yes 3780bd69b2b74540bc7b1096f564****

The ID of the watermark template that you want to update. To obtain the ID of the watermark template, you can log on to the ApsaraVideo Media Processing (MPS) console and choose Global Settings > Watermark Templates in the left-side navigation pane.

Name String Yes example-watermark-****

The new name of the watermark template. The value can contain letters and digits and can be up to 128 bytes in size.

Config String Yes null

The updated configuration of the watermark template. The value is a JSON object. For more information, see Watermark template configuration.

Response parameters

Parameter Type Example Description
WaterMarkTemplate Object

The details of the watermark template.

Type String Image

The type of the watermark. Valid values:

  • Image
  • Text
Note Only watermarks of the Image types are supported.
RatioRefer Object

The values of the Height, Width, Dx, and Dy parameters relative to the reference edges. If the values of the Height, Width, Dx, and Dy parameters are decimals between 0 and 1, the values are calculated by referring to the following edges in sequence:

  • Width: the width edge.
  • Height: the height edge.
  • Long: the long edge.
  • Short: the short edge.
Dx String 0.51

The horizontal offset of the watermark image relative to the output video. Default value: 0. The default value indicates no offset. The value can be an integer or a decimal.

  • Integer: the horizontal offset. Unit: pixel.
  • Decimal: the ratio of the horizontal offset to the width of the output video. Four decimal places are supported, such as 0.9999. More decimal places are discarded.
Width String 0.36

The width of the watermark image in the output video. The value can be an integer or a decimal.

  • Integer: the width of the watermark image. Unit: pixel.
  • Decimal: the ratio of the width of the watermark image to the width of the output video. Four decimal places are supported, such as 0.9999. More decimal places are discarded.
Height String 0.33

The height of the watermark image in the output video. The value can be an integer or a decimal.

  • Integer: the height of the watermark image. Unit: pixel.
  • Decimal: the ratio of the height of the watermark image to the height of the output video. Four decimal places are supported, such as 0.9999. More decimal places are discarded.
Dy String 0.28

The vertical offset of the watermark image relative to the output video. Default value: 0. The default value indicates no offset. The value can be an integer or a decimal.

  • Integer: the vertical offset. Unit: pixel.
  • Decimal: the ratio of the vertical offset to the height of the output video. Four decimal places are supported, such as 0.9999. More decimal places are discarded.
ReferPos String TopRight

The position of the watermark. Valid values:

  • TopRight: the upper-right corner.
  • TopLeft: the upper-left corner.
  • BottomRight: the lower-right corner.
  • BottomLeft: the lower-left corner.
State String Normal

The status of the watermark template. Default value: Normal.

Dx String 10

The horizontal offset. Unit: pixel.

Width String 10

The width of the watermark image. Unit: pixel.

Height String 30

The height of the watermark image. Unit: pixel.

Timeline Object

The timeline of the watermark.

Start String 0

The beginning of the time range in which the watermark is displayed.

  • Unit: seconds.
  • Default value: 0.
Duration String 10

The time range in which the watermark is displayed. Default value: ToEND. The default value indicates that the watermark is displayed until the video ends.

Name String example-watermark-****

The name of the watermark template.

Dy String 5

The vertical offset. Unit: pixel.

Id String 3780bd69b2b74540bc7b1096f564****

The ID of the watermark template. We recommend that you keep this ID for subsequent operation calls.

RequestId String E558894E-40D9-57C6-B5CC-0F5CDF23614E

The ID of the request.

Examples

Sample requests

http(s)://mts.cn-shanghai.aliyuncs.com/?Action=UpdateWaterMarkTemplate
&ResourceOwnerId=0
&WaterMarkTemplateId=3780bd69b2b74540bc7b1096f564****
&Name=example-watermark-****
&Config={"Width":"10px","Height":"30px","Dx":"10px","Dy":"5px","Type":"Image","Timeline":{"Start":"0","Duration":"10"}}
&<Common request parameters>

Sample success responses

XML format

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

<UpdateWaterMarkTemplateResponse>
    <WaterMarkTemplate>
        <Type>Image</Type>
        <RatioRefer>
            <Dx>0.51</Dx>
            <Width>0.36</Width>
            <Height>0.33</Height>
            <Dy>0.28</Dy>
        </RatioRefer>
        <ReferPos>TopRight</ReferPos>
        <State>Normal</State>
        <Dx>10</Dx>
        <Width>10</Width>
        <Height>30</Height>
        <Timeline>
            <Start>0</Start>
            <Duration>10</Duration>
        </Timeline>
        <Name>example-watermark-****</Name>
        <Dy>5</Dy>
        <Id>3780bd69b2b74540bc7b1096f564****</Id>
    </WaterMarkTemplate>
    <RequestId>E558894E-40D9-57C6-B5CC-0F5CDF23614E</RequestId>
</UpdateWaterMarkTemplateResponse>

JSON format

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

{
  "WaterMarkTemplate" : {
    "Type" : "Image",
    "RatioRefer" : {
      "Dx" : "0.51",
      "Width" : "0.36",
      "Height" : "0.33",
      "Dy" : "0.28"
    },
    "ReferPos" : "TopRight",
    "State" : "Normal",
    "Dx" : "10",
    "Width" : "10",
    "Height" : "30",
    "Timeline" : {
      "Start" : "0",
      "Duration" : "10"
    },
    "Name" : "example-watermark-****",
    "Dy" : "5",
    "Id" : "3780bd69b2b74540bc7b1096f564****"
  },
  "RequestId" : "E558894E-40D9-57C6-B5CC-0F5CDF23614E"
}

Error codes

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