create-scene-with-source 接口
创建含指定源的画面
请求方式
POST http://ip/mwapi/create-scene-with-source
返回数据
JSON 结构如下:
{
"status": 0,
"message": "success",
"info": {...}
}
1. 返回状态
"status": 0
属性 |
说明 |
status |
返回状态。0:请求成功,返回其它值请参考 API 状态码。 |
2. 新建的画面数据 info {...}
"info": {
"audioList": [
{
"layerId": 0,
"muted": 0,
"volume": 1000000
}
],
"dividerLine": {
"color": 0,
"width": 0,
"x1": 500000,
"x2": 500000,
"y1": 0,
"y2": 1000000
},
"id": 104,
"layerList": [
{
"cropWindow": {
"height": 1000000,
"type": 1,
"width": 1000000,
"x": 0,
"y": 0
},
"flip": 0,
"frame": {
"color": 16777215,
"width": 0
},
"given": 0,
"givenBg": 0,
"rotation": 0,
"sourceDuration": 0,
"sourceHeight": 1461,
"sourceId": 4,
"sourceType": 1,
"sourceWidth": 2224,
"srcWindow": {
"height": 1000000,
"width": 856262,
"x": 71869,
"y": 0
},
"window": {
"height": 1000000,
"width": 1000000,
"x": 0,
"y": 0
}
},
{
"cropWindow": {
"height": 1000000,
"type": 0,
"width": 1000000,
"x": 0,
"y": 0
},
"flip": 0,
"frame": {
"color": 0,
"width": 0
},
"givenBg": 0,
"rotation": 0,
"sourceHeight": 0,
"sourceId": 0,
"sourceType": 0,
"sourceWidth": 0,
"srcWindow": {
"height": 1000000,
"width": 1000000,
"x": 0,
"y": 0
},
"window": {
"height": 0,
"width": 0,
"x": 0,
"y": 0
}
}
],
"name": "默认图片",
"template": 3,
"type": 3
}
属性 |
说明 |
id |
画面ID。 |
name |
画面名称。 |
type |
画面类型 4:笔记 其它:画面 |
template |
组合模板 0:画中画 1:画面分割 2:单图层画面 |
dividerLine |
分割线属性 |
layerList |
图层列表 |
2. 分割线 dividerLine
属性 |
说明 |
color |
分割线颜色 uint32(gbra) |
x1 |
分割线顶点x值 |
y1 |
分割线顶点y值 |
x2 |
分割线结束点x值 |
y2 |
分割线结束点y值 |
3. 画面
属性 |
说明 |
sourceId |
源ID |
sourceType |
源类型 1:图片; 2:视频; 3: HDMI 1; 4:HDMI 2; 5:USB-Camera; 6:音频; 7:背景图片; 8:自动摄像头 |
sourceWidth |
源画面宽度 |
sourceHeight |
源画面高度 |
sourceDuration |
源视频长度 |
mediaProgress |
源播放进度,仅针对VIDEO类型 |
rotation |
旋转角度,逆时针方向,范围[0~360] |
flip |
翻转属性,0:不翻转 1:左右翻转 2:上下翻转 3:左右翻转+上下翻转 |
frame |
边框属性 |
window |
窗口属性 |
srcWindow |
内容窗口属性 |
cropWindow |
裁剪窗口属性 |
4. 窗口 window
属性 |
说明 |
x |
x,相对值 (0~1) * 1000,000,下同 |
y |
y |
width |
宽度 |
height |
高度 |
type |
非必要参数,裁剪类型 0:自由比例 1:原始比例 2:4比3 3:16比9 4:1比1 |