Creates a watermark template.
Usage notes
- You can call this operation to create a watermark template and configure information such as the watermark content and layout in the template.
- After you create a watermark template, you must also call the AddLiveStreamWatermarkRule operation to add a watermark rule. A live stream can contain the watermark only after the stream is re-ingested.
QPS limits
You can call this operation up to 60 times per second per account. Requests that exceed this limit are dropped and you may experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limit on an API operation in ApsaraVideo Live.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | AddLiveStreamWatermark | The operation that you want to perform. Set the value to AddLiveStreamWatermark. |
Type | Integer | Yes | 0 | The type of the watermark. Valid values:
|
Name | String | Yes | livewatermark**** | The name of the watermark. |
RefWidth | Integer | Yes | 1920 | The width of the background video. Unit: pixels. |
RefHeight | Integer | Yes | 1080 | The height of the background video. Unit: pixels. |
XOffset | Float | Yes | 50.0 | The offset of the watermark along the x-axis. Unit: pixels. 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: pixels. 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. |
Height | Integer | Yes | 200 | The height of the watermark. Unit: pixels. The height of the watermark is scaled in proportion to the height of the background video. |
Transparency | Integer | Yes | 255 | The transparency of the watermark. A smaller value indicates a more transparent watermark. Valid values: 0 to 255. |
OffsetCorner | String | Yes | TopRight | The location of the watermark. Valid values:
|
PictureUrl | String | Yes | http://example.com | The URL of the watermark image. |
Description | String | No | my watermark | The description of the watermark. |
Domain | String | No | example.aliyundoc.com | The streaming domain. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
TemplateId | String | 445409ec-7eaa-461d-8f29-4bec2eb9**** | The ID of the watermark template. |
RequestId | String | 5c6a2a0df228-4a64- af62-20e91b9676b3 | The request ID. |
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
HTTP/1.1 200 OK
Content-Type:application/xml
<AddLiveStreamWatermarkResponse>
<RequestId>5c6a2a0df228-4a64- af62-20e91b9676b3</RequestId>
<TemplateId>445409ec-7eaa-461d-8f29-4bec2eb9****</TemplateId>
</AddLiveStreamWatermarkResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "5c6a2a0df228-4a64- af62-20e91b9676b3",
"TemplateId" : "445409ec-7eaa-461d-8f29-4bec2eb9****"
}
Error codes
For a list of error codes, see Service error codes.