General Information
Configuration of SmartMEDIA Components
Configuration settings of each component are located in the corresponding configuration file. All configuration files are in JSON format. By default, they can be found by the following paths:
Component |
Default Configuration File Path |
Conveyor |
/opt/smartlabs/smartmedia/conveyor/config/config.json |
Playlist Generator |
/opt/smartlabs/smartmedia/plgen/config/config.json |
HTTP Redirector |
/opt/smartlabs/smartmedia/redirector/config/config.json |
RTSPServer |
/opt/smartlabs/smartmedia/rtspServer/config/config.json |
SmartPVR |
/opt/smartlabs/smartmedia/pvr/config/config.json |
SmartMPicker |
/opt/smartlabs/smartmedia/smartMPicker/config/config.json |
SmartTranscoder |
/opt/smartlabs/smartmedia/transcoder/config/config.json |
SmartNvidiaTranscoder |
/opt/smartlabs/smartmedia/nvidia-transcoder/config/config.json |
SmartMEDIA HTTP Cache |
/opt/smartlabs/smartmedia/smhttpcache/config/config.json |
SmartMEDIA Recryptor |
/opt/smartlabs/smartmedia/smrecrypt/config/config.json |
The Conveyor service also has a web console that allows you to configure channel recording in a convenient GUI. Its description can be found here.
Data Types and Configuration Description Rules
Base Types
- Integer;
- Unsigned integer;
- Floating point value (float);
- Boolean;
- String;
- Unix timestamp — an unsigned integer describing the time as the number of seconds since January 1, 1970;
- Arrays.
SmartMEDIA Specific Types
- URL (see section URL Format in SmartMedia Services)
- Time Units. Allows you to specify the duration in convenient units of time. If no postfix is specified, the time unit is considered to be a second. Example: 1d — 1 day; 2h — 2 hours; 3s — 3 seconds.
- Data size units. Allows you to specify the size using multipliers (Kilo-, Mega-, GigaBytes). If no postfix is specified, the size unit is considered to be megabytes. Example: 1k, 2g, 3M.
- Binary data encoded as Base64 string (RFC 2045).
- Binary data represented as HEX string: an array of bytes, each byte is described by two hex digits. Spaces between numbers are not allowed.
Sections and Nested Data Types
The JSON format allows you to partition the data and create a hierarchical structure of the configuration file. A field in a JSON document can correspond not only to a simple data type, such as a string or a number, but also to a nested object or array.
In order to show and describe the nested structure of configuration files, the following rules apply in this document:
- Nested objects that occur once and are not used in the other configuration sections are described after the main parameter description. The main parameter type in this case is specified as “section”. For example:
section — section parameter;
section → param — nested parameter.
In the configuration file, the section section with the param parameter will look like this:
{
“section”: {
“param”: 100
}
}
- Nested objects that occur multiple times or nested arrays of objects are defined as a separate type with its own description. In this case, the type of the object parameter will be specified as “ObjectType object”, the type of the array parameter will be specified as “array of ObjectType objects”.
For example: for some configuration can be defined:
- a param_obj_arr parameter of type “array of ObjectType objects”;
- a param_obj_v parameter of type “ObjectType object”;
- an ObjectType type with a set of parameters, one of them is ot_param1.
In the configuration file, it will look like this:
{
“param_obj_arr”: [
{
…
“ot_param1”: “Param Value”,
…
}
],
“param_obj_v”: {
…
“ot_param1”: “Param Value”,
…
}
}
URL Format in SmartMEDIA Services
Format
Protocol |
Description |
udp://<address>:<port>[?<URL arguments>] |
UDP stream, unicast and multicast addresses supported. |
http://<address>[:<port>]/<path> |
HTTP server. |
file://<path> |
The file on the local file system, the path must be absolute. |
URL Arguments
Argument |
Description |
UDP |
|
interface |
IPv4 address of the local network interface to bind the socket. |
socket_buffer |
Socket buffer size, in bytes. |
ttl |
Time to live (TTL) value of outgoing UDP packets. For incoming URLs is not used. |
HTTP |
|
No URL arguments accepted. |
|
File |
|
cycled |
Cyclic reading of the file (when the end of the file is reached, the reading continues from the beginning). |
Examples:
file:///video/spart.ts
udp://10.1.0.56:7556
udp://233.1.1.0:5000?ttl=255
udp://233.1.1.0:5000?ttl=255&socket_buffer=4194304&interface=10.65.5.70
http://wolf/spart.ts
Logging Setup
The logging service configuration file must be in JSON format and can contain the following parameters:
log_file_mask, string
Default value: component_%Y-%m-%d_%H-%M-%S.%N.log
The mask for the log file name in which the following parameters will be replaced: %Y — year, %m — month, %d — day of month, %H — hours, %M — minutes, %S — seconds, %N — rotation number.
allow_tags, string
A regular expression for the components to be logged. If empty, everything is logged.
deny_tags, string
A regular expression for components that will not be logged. If empty, everything is logged.
rotation_size, integer
Default value: 100*1024*1024 (100 MBytes)
Maximum log file size, in bytes, upon which rotation occurs.
severity_level, string
Default value: trace
Logging level. Possible values are: trace, debug, info, warning, error, fatal.
rotation_time, string
Default value: 00:00:00
The log file rotation time. A string containing of 3 or 4 values.
Last 3 values define duration in minutes, hours and seconds. If four values are specified, the first of them defines the day of the week (starts with the “w”) or the day of the month (starts with “m”).
The countdown of the day begins with 1. The values can be separated by “,”:”;” or by a space.
For example:
- 00:00:00 or 0 0 0 — rotation at midnight;
- w3 12:00:00 — noon on Wednesdays;
- m13 22:40:00 — 13th of each month at 22:40.
console_log, boolean
Default value: true
Logging will be duplicated to the console (STDOUT/STDERR) when set to ‘true’.
auto_flush, boolean
Default value: false
Whether to write a string to the log file immediately, without caching. It is recommended to enable only for debugging, as it can lead to a significant consumption of CPU resources.
syslog_address, string
The IP address or domain name of the syslog server. If not specified, logging via syslog is disabled.
syslog_port, integer
Default value: 514
The port of the syslog server. Valid values are from 1 to 65535.
syslog_add_timestamp, boolean
Default value: true
Whether to add a timestamp in each log string in addition to the timestamp written by the syslog server.
prefix, string
The prefix added to the beginning of each log string.
Example Configuration
JSON |
{ “log_file_mask”:“fhls_%Y-%m-%d_%H-%M-%S.%N.log”, “severity_level”:“trace”, “allow_tags”:“libfcgi|default”, “deny_tags”:“libfcgi”, “rotation_time”:“w2 15:10:30”, “console_log”:true, “auto_flush”:true } |