Skip to main content

Watermarks

Watermark configuration takes effect on both the original stream and the transcoded stream.

Create watermark templates

Creates watermark templates for the specified entry point.

HTTP request


_1
PATCH https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/settings/watermark

Path parameter

ParameterTypeDescription
appidStringRequired. The App ID retrieved from Agora Console.
entry_pointStringRequired. The entry point name.

Request body

The request body is in the JSON Object type, and contains the following fields:

FieldTypeDescription
watermarkSetJSON Array of WaterMarkRequired. Watermark configuration sets. You can add a maximum of five configuration sets.

HTTP response

If the returned HTTP status code is 200, the request is successful.

If the returned HTTP status code is not 200, the request fails. You can refer to the HTTP status codes for possible reasons.

Example

Request line


_1
PATCH https://api.agora.io/v1/projects/{your_appid}/fls/entry_points/live/settings/watermark HTTP/1.1

Request body


_20
{
_20
"waterMarkSet": [
_20
{
_20
"url": "http://pngimg.com/uploads/egg/egg_PNG40777.png",
_20
"x": 0,
_20
"y": 0,
_20
"width": 200,
_20
"height": 200,
_20
"zOrder": 2
_20
},
_20
{
_20
"url": "http://pngimg.com/uploads/egg/egg_PNG40777.png",
_20
"x": 0,
_20
"y": 0,
_20
"width": 300,
_20
"height": 300,
_20
"zOrder": 3
_20
}
_20
]
_20
}

Response line


_1
HTTP/1.1 200 OK

List watermark templates

Lists the watermark templates available for the specified entry point.

HTTP request


_1
GET https://api.agora.io/v1/projects/{appid}/fls/entry_points/{entry_point}/settings/watermark

Path parameter

ParameterTypeDescription
appidStringRequired. The App ID retrieved from Agora Console.
entry_pointStringRequired. The entry point name.

HTTP response

If the returned HTTP status code is 200, the request is successful. The response body contains the following fields:

FieldTypeDescription
watermarkSetJSON Array of WaterMarkThe list of watermark templates.

If the returned HTTP status code is not 200, the request fails. You can refer to the HTTP status codes for possible reasons.

Example

Request line


_1
GET https://api.agora.io/v1/projects/{your_appid}/fls/entry_points/live/settings/watermark HTTP/1.1

Request body


_20
{
_20
"waterMarkSet": [
_20
{
_20
"url": "http://pngimg.com/uploads/egg/egg_PNG40777.png",
_20
"x": 0,
_20
"y": 0,
_20
"width": 200,
_20
"height": 200,
_20
"zOrder": 2
_20
},
_20
{
_20
"url": "http://pngimg.com/uploads/egg/egg_PNG40777.png",
_20
"x": 0,
_20
"y": 0,
_20
"width": 300,
_20
"height": 300,
_20
"zOrder": 3
_20
}
_20
]
_20
}

Response line


_1
HTTP/1.1 200 OK

Data type

WaterMark

Watermark configuration parameters, including the following fields:

FieldTypeDescription
urlStringRequired. The URL of the watermark image. Only PNG files are supported. To easily set different watermarks for different entry points or live streams, you can use the following parameters in the URL:
  • {entry_point}: This parameter is replaced with the specified entry point.
  • {stream_name}: This parameter is replaced with the specified stream name.
  • xIntegerRequired. The x-coordinate of the watermark. The value range is [0,1920].
    yIntegerRequired. The y-coordinate of the watermark. The value range is [0,1920].
    widthIntegerRequired. The width (pixels) of the watermark image. The value range is [0,1920].
    heightIntegerRequired. The height (pixels) of the watermark image. The value range is [0,1920].

    HTTP status codes

    Status codeDescription
    200The request succeeds.
    400The parameter is invalid, for example the appid or the entry_point is empty, or the region parameter value is invalid.
    401Unauthorized (the customer ID and the customer secret do not match).
    404The server cannot find the resource according to the request, which means the requested entry point does not exist or the requested URI path is invalid.
    500An internal error occurs in the server, so the server is not able to complete the request.
    504An internal error occurs in the server. The gateway or the proxy server did not receive a timely request from the remote server.

    Page Content