Creates a watermark template.

Usage notes

You can call this operation to create a watermark template and specify the watermark content and layout in the template.

The watermark feature is available only in the China (Shanghai), China (Beijing), China (Shenzhen), and Singapore (Singapore) regions.

Limits on QPS

You can call this operation up to 60 times per second per account. 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 limit on an API operation in ApsaraVideo Live.

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 AddLiveStreamWatermark

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

Height Integer Yes 200

The height of the watermark. Unit: pixel. The height of the watermark is scaled in proportion to the height of the background video.

Name String Yes livewatermark****

The name of the watermark.

OffsetCorner String Yes TopRight

The location of the watermark. Valid values:

  • TopLeft: the upper-left corner.
  • TopRight: the upper-right corner.
  • BottomLeft: the lower-left corner.
  • BottomRight: the lower-right corner.
PictureUrl String Yes http://example.com

The URL of the watermark.

RefHeight Integer Yes 1080

The height of the background video. Unit: pixel.

RefWidth Integer Yes 1920

The width of the background video. Unit: pixel.

Transparency Integer Yes 255

The transparency of the watermark. A smaller value indicates a more transparent watermark. Valid values: 0 to 255.

Type Integer Yes 0

The type of the watermark. Valid values:

  • 0: image.
  • 1: text. Only image watermarks are supported.
XOffset Float Yes 50.0

The offset of the watermark along the x-axis. Unit: pixel.

Note In this case, the value of the RefWidth parameter is used as the reference. If the OffsetCorner parameter is set to TopLeft, the value of the XOffset parameter indicates the x-axis offset of the upper-left corner of the watermark relative to that of the background video. The directions from the coordinate axes to the center of the background video are positive. In other words, the x-axis is positive toward the right.
YOffset Float Yes 100.0

The offset of the watermark along the y-axis. Unit: pixel.

Note In this case, the value of the RefHeight parameter is used as the reference. If the OffsetCorner parameter is set to TopLeft, the value of the YOffset parameter indicates the y-axis offset of the upper-left corner of the watermark relative to that of the background video. The directions from the coordinate axes to the center of the background video are positive. In other words, the y-axis is positive downward.
RegionId String No cn-shanghai

The ID of the region in which the domain name resides. Valid values:

  • cn-beijing: China (Beijing)
  • cn-shanghai: China (Shanghai)
  • cn-shenzhen: China (Shenzhen)
  • ap-southeast-1: Singapore (Singapore)
Description String No my watermark

The description of the watermark.

Response parameters

Parameter Type Example Description
RequestId String 5c6a2a0df228-4a64- af62-20e91b9676b3

The ID of the request.

TemplateId String 445409ec-7eaa-461d-8f29-4bec2eb9****

The ID of the watermark template.

Examples

Sample requests

http(s)://live.aliyuncs.com/?Action=AddLiveStreamWatermark
&Height=200
&Name=livewatermark****
&OffsetCorner=TopRight
&PictureUrl=http://example.com
&RefHeight=1080
&RefWidth=1920
&Transparency=255
&Type=0
&XOffset=50.0
&YOffset=100.0
&<Common request parameters>

Sample success responses

XML format

<AddLiveStreamWatermarkResponse>
  <RequestId>5c6a2a0df228-4a64- af62-20e91b9676b3</RequestId>
  <TemplateId>445409ec-7eaa-461d-8f29-4bec2eb9****</TemplateId>
</AddLiveStreamWatermarkResponse>

JSON format

{
    "RequestId": "5c6a2a0df228-4a64- af62-20e91b9676b3",
    "TemplateId": "445409ec-7eaa-461d-8f29-4bec2eb9****"
}

Error codes

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