1. 主页
  2. 文档
  3. S2 HTTP API
  4. OSD叠加
  5. 获取叠加信息

获取叠加信息

API URL

/api/codec/osd/GetInfo.json

Request

Method:GET/POSTParameters: [chnId]

{"chnId" : 1, // 1 表示主码流, 2 表示子码流}

Response

{ "result": "ok", "data": {  "config": {   "enable": true,  },  "items": [   [1] = {    "enable": true,    "position": "center",    "color": 1,    "y": 0,    "style": "normal",    "text": "这是132的叠加项",    "fileID": "",    "outline": 0,    "type": "text",    "outlineColor": 0,    "x": 0,    "size": 48   },   ...  ] }}

Data 字段说明

Field Value 说明
config.enable [Boolean] 表示此码流字符叠加是否开启
enable [Boolean] 表示此叠加项是否开启
type [String] 叠加项类型: time: ‘%Y/%m/%d %H:%M:%S’格式的时间 date: ‘%Y/%m/%d’格式的时间 clock: ‘%H:%M:%S’格式的时间 image: 图片 text: 文字
position [String] 叠加位置: left-top: 左上角 top-center: 上边居中 right-top: 右上角 center: 正中心 left-bottom: 左下角 bottom-center: 下边居中 right-bottom: 右下角 custom: 自定义
size [Integer] 表示文字大小, 0、1、2表示自适应字体大小,其余为对应px大小: 0: 自动-大字体 1: 自动-中等字体 2: 自动-较小字体 例如9则表示 9px
style [String] normal 表示正常字体 bold 表示加粗字体
outline [Integer] 表示文字外边框px值
color [Integer] 表示文字颜色:0 : 黑色1 : 白色2 : 红色3 : 蓝色4 : 绿色5 : 黄色6 : 紫色7 : 青色
outlineColor [Integer] 表示文字外边框颜色:0 : 黑色1 : 白色2 : 红色3 : 蓝色4 : 绿色5 : 黄色6 : 紫色7 : 青色
text [String] 表示文字内容
x [Integer] 表示自定义位置时,X轴坐标
y [Integer] 表示自定义位置时,Y轴坐标
fileID [Integer] 表示叠加的图片ID,此ID必须存在于图片列表中

我们要如何帮助您?