add-surface
Use this interface to add an overlay. The main stream and sub stream supports 8 overlays each, 16 in total.
Obtain the ranges of overlay parameters using get-info.
{
"surface": {
"image": {}, // picture restrictions
"image-type": [], // range of picture formats
"type": [], // range of overlay types
"position": [], // range of overlay locations
"font-family": [], // range of fonts
"font-style": [], // range of font styles
"font-weight": [], // range of font weights
"time-format": [], // range of time formats
}
}
HTTP Request
GET http://ip/usapi?method=add-surface&type=xxx&stream-index=1...
| Parameter | Description |
|---|---|
| method | add-surface |
| stream-index | 0: main stream 1: sub stream |
| position | Overlay location. |
| x-offset | The x-coordinate of the upper left corner of the overlay position, which is valid when the overlay location is customized. |
| y-offset | The y-coordinate of the upper left corner of the overlay position, which is valid when the overlay location is customized. |
| margin | The width between the overlay and the outer margin. The default value is 0. |
| condition | Reserved. |
| class | Overlay types. 0: text 1: system clock 2: picture |
| Text | |
| font-family | Font family. |
| font-size | Font size. |
| font-style | Font style. |
| font-weight | Font weight. |
| font-color | Font color. |
| line-width | Line width. |
| line-color | Line color. |
| width | Width of text box. |
| height | Height of text box. |
| text | Text content. |
| System time | |
| font-family | Font family. |
| font-size | Font size. |
| font-style | Font style. |
| font-weight | Font weight. |
| font-color | Font color. |
| line-width | Line width. |
| line-color | Line color. |
| width | Width of time box. |
| height | Height of time box. |
| text | Time format. |
| Picture | |
| index | Picture ID which can be obtained using get-images. |
| alpha | alpha value ranges from 0 to 255. |
| scale | Resize a picture from 1% to 400%. |
Response Body
{
"result": 0
}
| Item | Description |
|---|---|
| result | Returned status. 0 indicates that the request was accepted successfully. Refer to API Status Codes to find specific description for other values. |