Display output control module. including: Get the output state, output operate interface, set the display window layout, output audio configuration, window playing audio switch and other functions.
文章目录
- Gain output interface information
- Gain output resolution
- configure output paremeter
- Gain the list of output layouts/ modify outoput layouts
- Gain audio output status
- Configure output audio parameter
- Turn on/off audio of output window
- Layout control interface
- Gain the bind status of output interface
- Configure the output interface to bind the port
Gain output interface information
API instruction
Gets the basic information for specifying the output interface
Request
- Method: GET/POST
- URL:
output/get.json
- Headers:
- Submit parameter:
field | type | instruction |
---|---|---|
output | alphabetic string | output interface ID(necessary parameter),Dereference:1 or2 |
Response
- Body
{
"result": "ok",
"data": {
"resolution_name": "(4K)3840x2160@60Hz",
"layout": [
{
"stream_name": "102",
"id": 1,
"buffer": "live:200:200:500:0:0",
"src": "192.168.3.102",
"stream_id": "MANUAL.1",
"bitrate": 3120,
"type": "rtsp",
"volume": "on",
"status": "view_pull"
}
],
"layout_id": "1",
"sampling": 48000,
"colorspace": "YCBCR420",
"hdmi_mode": "HDMI",
"resolution": "3840x2160@60",
"output": "on"
}
}
- return instruction:
field | type | instruction |
---|---|---|
resolution | alphabetic string | show output resolution and refresh rate,for example:”3840×2160@60” |
resolution_name | alphabetic string | The resolution information displayed in the front end after formatting,for example:”(4K)3840×2160@60Hz” |
layout_id | alphabetic string | the layout version ID, check the output layout list and gain the data |
hdmi_mode | alphabetic string | HDMI interface work format,”AUTO”or”HDMI”or”DVI” |
colorspace | alphabetic string | color space,”AUTO”or true value,for example:”YCBCR420” |
sampling | numerical value | Audio sampling rate |
output | alphabetic string | output status,”on”or”off” |
layout | arrays | layout window inforamtion arrays |
layout.id | alphabetic string | layout window ID |
layout.stream_name | alphabetic string | decoding source name of the current play windown,for front end display |
layout.stream_id | alphabetic string | decoding source id of the current paly windown(important parameter) |
layout.buffer | alphabetic string | buffer area parameter,for example:live:200:200:500:0:0 |
layout.status | alphabetic string | current work status of the decoder source: view_pull 、pull 、view 、on 、off reconnecting 、connecting 、error |
layout.src | alphabetic string | origin of decoder source ,for example “192.168.2.11” |
layout.bitrate | numerical value | decoder source bit rate,Unit K bps,for example: 3120 |
layout.type | alphabetic string | decoding version,for example:rtsp、rtmp、rtmps、rtp、http、srt |
layout.volume | alphabetic string | wether paly with audio or not,”on”or”off” |
test calling:
http://192.168.2.123/api/output/get.json
Gain output resolution
API instruction
gain the resolution list of the corresponding output interfact
Request
- Method: GET/POST
- URL:
output/resolutions.json
- Headers:
- submit parameter:
- submit parameter:
field | type | instruction |
---|---|---|
output | alphabetic string | output interface ID(necessary parameter),state range:1or2 |
Response
- Body
{
"result": "ok",
"data": [
{
"name": "(4K)3840x2160@60Hz",
"value": "3840x2160@60"
},
{
"name": "(4K)3840x2160@50Hz",
"value": "3840x2160@50"
},
{
"name": "(4K)3840x2160@30Hz",
"value": "3840x2160@30"
},
{
"name": "(4K)3840x2160@25Hz",
"value": "3840x2160@25"
},
{
"name": "1920x1080P 60Hz",
"value": "1080P60"
},
{
"name": "1920x1080P 59.94Hz (SDI only)",
"value": "1080P59"
},
{
"name": "1920x1080P 50Hz",
"value": "1080P50"
},
{
"name": "1920x1080P 30Hz",
"value": "1080P30"
},
{
"name": "1920x1080P 29.97Hz (SDI only)",
"value": "1080P29"
},
{
"name": "1920x1080P 25Hz",
"value": "1080P25"
},
{
"name": "1920x1080P 24Hz",
"value": "1080P24"
},
{
"name": "1920x1080P 23.98Hz (SDI only)",
"value": "1080P23"
},
{
"name": "1920x1080i 60Hz",
"value": "1080I60"
},
{
"name": "1920x1080i 59.94Hz (SDI only)",
"value": "1080I59"
},
{
"name": "1920x1080i 50Hz",
"value": "1080I50"
},
{
"name": "1280x720P 60Hz",
"value": "720P60"
},
{
"name": "1280x720P 59.94Hz (SDI only)",
"value": "720P59"
},
{
"name": "1280x720P 50Hz",
"value": "720P50"
},
{
"name": "576i/625i 50Hz",
"value": "PAL"
},
{
"name": "480i/525i 60Hz",
"value": "NTSC"
}
]
}
- return instruction
field | type | instruction |
---|---|---|
name | alphabetic string | resolution name,for frond end display |
value | alphabetic string | resolution supported by the device |
test calling:
http://192.168.2.123/api/output/resolutions.json
configure output paremeter
API instruction
configure output paremeter。
Request
- Method: GET/POST
- URL:
output/set.json
- Headers:
- submit paremeter:
field | type | instruction |
---|---|---|
output | alphabetic string | oputput parameterID(necessary parameter),value range:1or2 |
resolution | alphabetic string | output resolution parameter,for example:”1080P60”, parameter will be the front interface |
hdmi_mode | alphabetic string | output interface work status,”AUTO” adaptive hardware work mode or mandatory set”HDMI”or “DVI” |
colorspace | alphabetic string | color space,default”AUTO”、”RGB444”、”YCBCR444”、”YCBCR422”、”YCBCR420” |
sampling | alphabetic string | Sampling rate value,default 48000,optional:”32000”、”44100” |
Response
- Body
{ result: "ok"}
test calling:
http://192.168.2.123/api/output/set.json?output=1&resolution=1080P60&hdmi_mode=AUTO&colorspace=AUTO&sampling=48000
Gain the list of output layouts/ modify outoput layouts
API instruction
the interface includes:
the layout list of gain the quick switch of the output interface (The layout shown in the lower right corner of the front page);
the layout of configure the related output to quick switch interface
Request
- Method: GET/POST
- URL:
output/icon.json
- Headers:
- submit parameter:
field | type | instruction |
---|---|---|
output | alphabetic string | output interface ID(necessary parameter),state range:1 or 2 |
id | arrays | layout ID, for example:id[]=1&id[]=2 |
note:when parameter includes id, then the interface will be as the result of quick switch layout, or retun to the layout list
Response
-
Body
return while gaining the layout information:
{
"result": "ok",
"data": [
{
"enable": 1,
"en_name": "Single split screen",
"id": "1",
"name": "Single split screen",
"src": "parts1_press.png"
},
{
"enable": 1,
"en_name": "Bipartite split screen",
"id": "2",
"name": "Bipartite split screen",
"src": "parts2_press.png"
},
{
"enable": 1,
"en_name": "Triple split screen",
"id": "3",
"name": "Triple split screen",
"src": "parts3_press.png"
},
{
"enable": 1,
"en_name": "Quarter split screen",
"id": "4",
"name": "Quarter split screen",
"src": "parts4_press.png"
},
{
"enable": 0,
"en_name": "Sextant screen",
"id": "6",
"name": "Sextant screen",
"src": "parts6_press.png"
},
{
"enable": 0,
"en_name": "Nine-point screen",
"id": "9",
"name": "Nine-point screen",
"src": "parts9_press.png"
}
]
}
:return when modify the layout
{ "result": "ok"}
test calling:
http://192.168.2.123/api/output/icon.json?output=1http://192.168.2.123/api/output/icon.json?output=1&id%5B%5D=1&id%5B%5D=3
Gain audio output status
API instruction
gain the audio status from the corresponding output interface
Request
- Method: GET/POST
- URL:
output/audio.json
- Headers:
- submit parameter:
field | type | instruction |
---|---|---|
output | alphabetic string | output interface ID(necessary parameter),value range:1 or 2 |
Response
- Body
{
"result": "ok",
"data": {
"audio_analog_gain": {
"disable": 0,
"value": 0
},
"audio_digital_gain": {
"disable": 0,
"value": 0
}
}
}
- return instruction:
field | type | instruction |
---|---|---|
audio_analog_gain.value | numerical value | audio volume value of the analog audio |
audio_analog_gain.disable | numerical value | whether the analog audio disable or not |
audio_digital_gain.value | numerical value | audio volume value of embedded audio |
audio_digital_gain.disable | numerical value | whether the enbedded audio is disable or not |
test calling:
http://192.168.2.123/api/output/audio.json?output=1
Configure output audio parameter
API instruction
。 confugure output audio parameter
Request
- Method: GET/POST
- URL:
output/audio_set.json
- Headers:
- submit parameter:
field | type | instruction |
---|---|---|
output | alphabetic string | output interface ID(necessary paremeter),state range:1or2 |
audio | alphabetic string | audio output interface:”analog” “embedded” |
disable | alphabetic string | numeric character string,”1” forbidden “0” enable |
value | alphabetic string | numeric character string,volume parameter,state range:-121 ~ 6 |
Response
- Body
{ "result": "ok"}
test calling:
http://192.168.2.123/api/output/audio_set.json?output=1&audio=embedded&disable=0&value=6
Turn on/off audio of output window
API instruction
Turn on/off audio of designated interface and designated window.
Request
- Method: GET/POST
- URL:
output/window_audio_set.json
- Headers:
- submit parameter:
field | type | instruction |
---|---|---|
output | alphabetic string | output interface ID(necessary parameter),state range:1or2 |
id | alphabetic string | numeric character string(necessary parameter),layout windonw id |
volume | alphabetic string | whether the audio outoput or not(necessary parameter),”on”:open 、”off”:closed |
Response
- Body
{ result: "ok"}
test calling:
http://192.168.2.123/api/output/window_audio_set.json?output=1&id=1&volume=on
Layout control interface
API Instruction
: the interface includes 3 functions
1);bind windown and decoding resource ( configure the decoding source to play in the corresponding windown)
2)remove the current decoding source in the windown
3)configure the output switch to the related layout
Request
- Method: GET/POST
- URL:
output/layout.json
- Headers:
- submit parameter:
field | type | instruction |
---|---|---|
output | alphabetic string | output interface ID(necessary parameter),state range:1or2 |
action | alphabetic string | oprate verion,value range: “set”:bind the windown and decoder source “remove”: remove the current playing decoding source from some windown “change”:switch specified layout |
position | alphabetic string | layout window ID,if no action, parameter will be set”or “remove”and must to configure the parameter,for example:”1” |
layout_id | alphabetic string | layout ID,when action is”change”and you must configure the parameter,for example:”1” |
stream_id | alphabetic string | decoding source ID, when action is”set”and you must configure the parameter,for example:”MANUAL.6” |
Response
- Body
{ "result": "ok"}
test calling:
#output 1 bind windown 1 and decodiing source 14
http://192.168.2.123/api/output/layout.json?output=1&action=set&position=1&stream_id=MANUAL.14
#remove the decoding source of the #window 1 from the output 1
http://192.168.2.123/api/output/layout.json?output=1&action=remove&position=1
#output 1 and switch to layout 2
http://192.168.2.123/api/output/layout.json?output=1&action=change&layout_id=2
Gain the bind status of output interface
API instruction
gain the port bind status of output interface
Request
- Method: GET/POST
- URL:
output/get_port.json
- Headers:
- submit parameter:
field | type | instruction |
---|---|---|
output | alphabetic string | output interface ID(necessary parameter),state range:1or2 |
Response
- Body
{
"result": "ok",
"data": [
{
"bind": true,
"enable": 1,
"name": "HDMI",
"id": "HDMI"
},
{
"bind": false,
"enable": 0,
"name": "SDI",
"id": "BT1120"
},
{
"bind": false,
"enable": 0,
"name": "IP Stream",
"id": "NET"
}
]
}
- return instruction
field | type | instruction |
---|---|---|
id | alphabetic string | port ID, |
name | alphabetic string | port name |
enable | numerical value | enable or not,1:enable、0:not enable |
bind | alphabetic string | bound or not with the corresponding output,true:bound、false:not bound |
test calling:
http://192.168.2.123/api/output/get_port.json?output=1
Configure the output interface to bind the port
API instruction
configure the corresponding output interface to bind the port
Request
- Method: GET/POST
- URL:
output/bind_port.json
- Headers:
- submit parameter:
field | type | instruction |
---|---|---|
output | alphabetic string | output interface ID(necessary parameter),state range:1or2 |
id | alphabetic string | hardware output interface ID(necessary parameter),state range:”HDMI”、”BT1120”、”NET” |
enable | alphabetic string | if bind the port or not(necessary parameter),”1” :bound, “0”:not bound |
Response
- Body
{
"result": "ok"
}
test calling:
http://192.168.2.123/api/output/bind_port.json?output=1&id=HDMI&enable=1
http://192.168.2.123/api/output/bind_port.json?output=1&id=BT1120&enable=1