Creates a watermark template.
Operation description
- 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 in progress can contain the watermark only after the stream is re-ingested.
QPS limit
You can call this operation up to 60 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
live:AddLiveStreamWatermark | create | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
Type | integer | Yes | The type of the watermark. Valid values:
| 0 |
Name | string | Yes | The name of the watermark. | livewatermark**** |
RefWidth | integer | Yes | The width of the background video. Unit: pixels. | 1920 |
RefHeight | integer | Yes | The height of the background video. Unit: pixels. | 1080 |
XOffset | float | Yes | 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.
| 50.0 |
YOffset | float | Yes | 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.
| 100.0 |
Height | integer | Yes | The height of the watermark. Unit: pixels. The height of the watermark is scaled in proportion to the height of the background video. | 200 |
Transparency | integer | Yes | The transparency of the watermark. A smaller value indicates a more transparent watermark. Valid values: 0 to 255. | 255 |
OffsetCorner | string | Yes | The location of the watermark. Valid values:
| TopRight |
PictureUrl | string | Yes | The URL of the watermark image. | http://example.com |
Description | string | No | The description of the watermark. | my watermark |
Domain | string | No | The streaming domain. | example.aliyundoc.com |
Response parameters
Examples
Sample success responses
JSON
format
{
"TemplateId": "445409ec-7eaa-461d-8f29-4bec2eb9****",
"RequestId": "5c6a2a0df228-4a64- af62-20e91b96****"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidParameters | %s |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|