Table of contents
Introduction
There are two different method groups: management methods and filter specific methods.
The first ones are related to the general management of the system, which includes creating, managing and destroying filters and paths. These actions are executed by PipelineManager.
The second ones are related to specific filter management. Each filter type has its own methods in order to configure itself. These actions are executed by the targeted filter.
Management levels
Both request and response management event messages (both general or specific) are formatted as a JSON string.
An event JSON object message contains:
- action (string): the method/action to be executed
- filter_id (number): the id of the filter associated to the action (0 if internal event)
- delay (number): the execution delay
- params (object): parameters involved in the action
Then response messages can be:
- No error:
{ “error” : ”null” }
- Error:
{ “error” : ”specific error explanation” }
- If the request was a getState message then:
{
“filters” : [ array of filter objects ] ,
“paths” : [ array of path objects ]
}
General management level
Start
| Description | Starts the system |
| Data params | - |
| Success response | Content: { “error” : ”null” } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”start”,
”params”: {},
”filterId”: 0,
”delay” : 0
}
Stop
| Description | Stops the system |
| Data params | - |
| Success response | Content: { “error” : ”null” } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”stop”,
”params”: {},
”filterId”: 0,
”delay” : 0
}
Get state
| Description | Get the system state |
| Data params | - |
| Success response | { ”filters” : [ { ”id”: [numeric], ”type”: [string], ” ... }, ... ], ”paths” : [ { ”id”: [numeric], ”originFilter”: [numeric], ”destinationFilter”: [numeric], ”originWriter”: [numeric], ”destinationReader”: [numeric], ”filters”: [ [numeric], [numeric], … ] }, ... ] } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”getState”,
”params”: {},
”filterId”: 0,
”delay” : 0
}
Create filter
| Description | Creates a new filter |
| Data params | { ”id”: [numeric], ”type”: [string] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”createFilter”,
”params”: {
”id”: [integer],
”type”: [string]
},
”filterId”: 0,
”delay” : 0
}
Delete filter
| Description | Removes a filter |
| Data params | { ”id”: [numeric] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”removeFilter”,
”params”: {
”id”: [integer]
},
”filterId”: 0,
”delay” : 0
}
Create path
| Description | Creates a new path |
| Data params | { ”id”: [numeric], ”orgFilterId”: [numeric], ”dstFilterId”: [numeric], ”orgWriterId”: [numeric], ”dstReaderId”: [numeric], ”midFiltersIds”: [ [numeric], [numeric], … ] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”createPath”,
”params”: {
”id”: [integer],
”orgFilterId”: [integer],
”dstFilterId”: [integer],
”orgWriterId”: [integer],
”dstReaderId”: [integer],
”midFiltersIds”: [ [integer], [integer], … ]
},
”filterId”: 0,
”delay” : 0
}
Delete path
| Description | Removes a path |
| Data params | { ”id”: [numeric] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”removePath”,
”params”: {
”id”: [integer]
},
”filterId”: 0,
”delay” : 0
}
Specific filter management level
Receiver
- Add new RTP input
| Description | Adds a new input RTP session |
| Data params | { ”filterId”: [numeric], ”port”: [numeric], ”medium”: [string], ”codec”: [string], ”bandwidth”:[numeric], ”timestampFreq”:[numeric], ”channels”:[numeric] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”addSession”,
”params”: {
”port”: [integer],
”medium”: [string],
”codec”: [string],
”bandwidth”:[integer],
”timesamptFreq”:[integer],
”channels”:[integer]
},
”filterId”: [integer],
”delay” : 0
}
- Add new RTSP input
| Description | Adds a new input RTSP session |
| Data params | { ”progName”: [string], ”uri”: [string], ”id”: [string] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”addSession”,
”params”: {
”progName”: [string],
”uri”: [string],
”id”: [string]
},
”filterId”: [integer],
”delay” : 0
}
Transmitter
- Add new RTP output
| Description | Adds a new output RTP session |
| Data params | { ”filterId”: [numeric], ”readers”: [numeric array], ”sessionId”: [numeric] ”ip”: [string], ”port”: [numeric], ”txFormat”: [string] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”addRTPConnection”,
”params”: {
”readers”: [ [integer], [integer], … ],
”id”: [string],
”ip”: [string],
”port”: [numeric],
”txFormat”: [string]
},
”filterId”: [integer],
”delay” : 0
}
- Add new RTSP output
| Description | Adds a new output RTSP session |
| Data params | { ”filterId”: [numeric], ”readers”: [numeric array], ”name”: [string], ”txFormat”: [string], ”info”: [string], ”desc”: [string], ”id”: [numeric], } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”addRTSPConnection”,
”params”: {
”readers”: [numeric array],
”name”: [string],
”txFormat”: [string],
”info”: [string],
”desc”: [string],
”id”: [numeric],
},
”filterId”: [integer],
”delay” : 0
}
Video decoder
It is autoconfigured. It depends on the previous filter connected to.
Video resampler
| Description | Configures a video resampler |
| Data params | { ”filterId”: [numeric], ”width”: [numeric], ”height”: [numeric], "discartPeriod": [numeric], "pixelFormat": [numeric] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”configure”,
”params”: {
”width” : [integer],
”height” : [integer],
”pixelFormat” : [integer],
”discartPeriod” : [integer]
},
”filterId”: [integer],
”delay” : 0
}
Video encoder
| Description | Configures a video encoder |
| Data params | { ”filterId”: [numeric], ”fps” : [integer], ”gop” : [integer], ”bitrate” : [integer], "lookahead": [integer], "threads": [integer], "annexb": [boolean], "preset":" [string]" } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”configure”,
”params”: {
”fps” : [integer],
”gop” : [integer],
”bitrate” : [integer],
“lookahead”: [integer],
“threads”: [integer],
“annexb”: [boolean],
“preset”:” [string]”
},
”filterId”: [integer],
”delay” : 0
}
Video mixer
| Description | Updates a video mixer channel configuration |
| Data params | { ”id”: [numeric], ”width” : [numeric], ”height” : [numeric], ”x” : [numeric], ”y” : [numeric], ”layer” : [numeric], ”opacity” : [numeric], ”enabled” : [boolean] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”configChannel”,
”params”: {
”id” : [integer],
”width” : [float],
”height” : [float],
”x” : [float],
”y” : [float],
”layer” : [int],
”opacity” : [float],
”enabled” : [boolean]
},
”filterId”: [integer],
”delay” : 0
}
Audio decoder
It is autoconfigured. It depends on the previous filter connected to.
Audio encoder
| Description | Configures an audio encoder |
| Data params | { ”id”: [numeric], ”codec” : [string], ”sampleRate” : [integer], ”channels” : [integer], ”bitrate” : [float] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”configure”,
”params”: {
”id” : [integer],
”codec” : [string],
”sampleRate” : [integer],
”channels” : [integer],
”bitrate” : [float]
},
”filterId”: [integer],
”delay” : 0
}
Audio mixer
- Change master volume
| Description | Changes audio mixer master channel volume |
| Data params | { ”filterId”: [numeric], ”volume”: [numeric] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”changeMasterVolume”,
”params”: {
”volume”: [float],
},
”filterId”: [integer],
”delay” : 0
}
- Change channel volume
| Description | Changes audio mixer channel volume |
| Data params | { ”filterId”: [numeric], ”id”: [numeric], ”volume”: [numeric] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”changeChannelVolume”,
”params”: {
”id” : [integer],
”volume” : [float]
},
”filterId”: [integer],
”delay” : 0
}
Demuxer
| Description | Configure Demuxer input URI |
| Data params | { ”uri”: [string] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”configure”,
”params”: {
”uri” : [string]
},
”filterId”: [integer],
”delay” : 0
}
Dasher
- Configure Dasher parameters
| Description | Configure Dasher filter with folder, base name and segment duration |
| Data params | { "filterId": [integer], "folder": [string], "baseName": [string], "segDurInSec": [integer], "maxSeg": [integer], "minBuffTime": [integer] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”configure”,
”params”: {
“folder”: [string],
“baseName”: [string],
“segDurInSec”: [integer],
“maxSeg”: [integer],
“minBuffTime”: [integer]
},
”filterId”: [integer],
”delay” : 0
}
- Add Dasher segmenter
| Description | Add a segmenter to Dasher filter |
| Data params | { "filterId": [integer], "id": [integer] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”addSegmenter”,
”params”: {
“id”: [integer]
},
”filterId”: [integer],
”delay” : 0
}
- Set Dasher segmenter bitrate
| Description | Set bitrate to Dasher segmenter |
| Data params | { "filterId": [integer], "id": [integer], "bitrate": [float] } |
| Success response | Content: { “error” : "null" } |
| Error response | Content: { “error” : [string error] } |
Internal message
{
”action”: ”setBitrate”,
”params”: {
“id”: [integer],
“bitrate”: [float]
},
”filterId”: [integer],
”delay” : 0
}