Capabilities
The capabilities call allows collecting data from MistServer on what it is able to do. The response contains basic system information like the current load, CPU power available, memory available, and an estimate on the overall speed of the system.
More importantly, the response also contains the list of installed outputs (called connectors internally, for historical reasons) and inputs, as well as their lists of required and optional parameters and what codecs they can handle.
To request capabilities to be sent, make a request as follows:
{
"capabilities": true //Any value is accepted - it is ignored.
}
The response then looks like this:
{
"capabilities": {
"connectors": { // a list of installed connectors. These are the MistOut* executables.
"FLV": { //name of the connector. This is based on the executable filename, with the "MistOut" prefix stripped.
"codecs": [ //supported combinations of codecs.
[["H264","H263","VP6"],["AAC","MP3"]] //one such combination, listing simultaneously available tracks and the codec options for those tracks. The special character * may be used to indicate any codec.
],
"deps": "HTTP", //dependencies on other connectors, if any.
"desc": "Enables HTTP protocol progressive streaming.", //human-friendly description of this connector
"methods": [ //list of supported request methods
{
"handler": "http", //what handler to use for this request method. The "http://" part of a URL, without the "://".
"priority": 5, // priority of this request method, higher is better.
"type": "flash/7" //type of request method - usually name of plugin followed by the minimal plugin version, or 'HTML5' for pluginless.
}
],
"name": "FLV", //Name of this connector.
"optional": { //optional parameters
"username": { //name of the parameter
"help": "Username to drop privileges to - default if unprovided means do not drop privileges", //human-readable help text
"name": "Username", //human-readable name of parameter
"option": "--username", //command-line option to use
"type": "str" //type of option - "str" or "num"
}
//above structure repeated for all (optional) parameters
},
//above structure repeated, as "required" for required parameters, if any.
"url_match": "/$.flv", //String (or array of strings) of URL pattern to match, if any. The $ substitutes the stream name and may not be the first or last character.
"url_prefix": "/progressive/$/", //String (or array of strings) of URL prefix to match, if any. The $ substitutes the stream name and may not be the first or last character.
"url_rel": "/$.flv", //relative URL where to access a stream through this connector.
"push_urls": ["http://*.flv"] //Optional array of URL patterns that can be pushed out by this connector. A connector need not be enabled to be used for push out, being listed in capabilities is enough.
}
//... above structure repeated for all installed connectors.
},
"inputs": { // a list of installed inputs. These are the MistIn* executables.
"Buffer": { //Name of the input. This is based on the executable filename, with the "MistIn" prefix stripped.
"codecs": [ //supported combinations of codecs
[["*"],["*"],["*"]] //one such combination, listing simultaneously available tracks and the codec options for those tracks. The special character * may be used to indicate any codec.
],
"desc": "Provides buffered live input", //human-friendly description of this input
"name": "Buffer", //Name of this input
"optional": {}, //optional parameters. Same format as in the "connectors" structure
"required": {}, //required parameters. Same format as the optional parameters.
"priority": 9, //When multiple inputs source_match a source, the highest priority input is used.
"source_match": "push://*" //String (or array of strings) that is matched against a source parameter to determine if this input should be used. The * character may appear only once, anywhere in the string.
}
//... above structure repeated for all installed inputs.
},
"cpu_use": 500, //Current CPU usage in tenths of percent (i.e. 500 = 50%)
"cpu": [ //a list of installed CPUs
{
"cores": 4, //amount of cores for this CPU
"mhz": 1645, //speed in MHz for this CPU
"model": "Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz", //model identifier, for humans
"threads": 8 //amount of simultaneously executing threads that are supported on this CPU
}
//above structure repeated for all installed CPUs
],
"load": {
"fifteen": 72,
"five": 81,
"memory": 42,
"one": 124
},
"mem": {
"cached": 1989, //current memory usage of system caches, in MiB
"free": 2539, //free memory, in MiB
"swapfree": 0, //free swap space, in MiB
"swaptotal": 0, //total swap space, in MiB
"total": 7898, //total memory, in MiB
"used": 3370 //used memory, in MiB (excluding system caches, listed separately)
},
"speed": 6580, //total speed in MHz of all CPUs cores summed together
"threads": 8 //total count of all threads of all CPUs summed together
}
}