IPTV middleware integration¶
Important
Beta version 2.1. What is described here exists only in beta version 2.1: it is installed from the beta repository and only with a licence; the stable version 2.0.2 and the demo edition do not have it. The beta version comes without warranty, and support is best effort (Beta testing programme).
Starting with version 2.1.1.516, the node understands the address and token authorisation scheme that IPTV middleware and players already use with streaming servers: Ministra (Stalker), Microimpuls Smarty, TVIP TMS and players with catchup="flussonic" archive. Such middleware can be pointed at Perfect Streamer without changing its channel address templates: the middleware gives the subscriber a link with a token, and the node checks the token with the middleware.
Two things are enabled: the address forms on the streaming HTTP server and the token check server (Token check server). Both are set in the console, as well as in the settings file (Changing a parameter) and via the HTTP API (Managing the node over the HTTP API).
Channel addresses¶
The “Flussonic-compatible URLs” switch in the “Middleware” section of the “Streaming HTTP server” screen (Streaming HTTP server; the flussonic-urls key in /config/http-server), off by default. When it is on, every stream with a “URL stream name” set (URLs and authorisation) is also available at these addresses, alongside the existing ones:
Address |
What it serves |
|---|---|
|
live HLS |
|
live DASH |
|
live MPEG-TS; HTTP delivery must be enabled for the stream |
|
DVR archive (DVR: the stream archive) from the moment |
|
timeshift: the archive from a past moment (or |
The full address is http://<node>:<port>/<name>/index.m3u8?token=<token>. Every request must carry a token (no longer than 512 characters). The name of an adaptive bundle (Adaptive bundles) gives its adaptive playlist. If the archive or timeshift is requested from a moment before recording began, the master playlist answers 200 and the variant (media) playlist answers 404.
A stream cannot be named hls, dash, llhls, http, rsv or with a 17-character name made of h and 16 hex digits in these addresses. In the stream editor, on the “OTT” tab, under the “URL stream name” the console shows these addresses with the stream’s name, and a warning for such a name (Configure stream).
Token check server¶
The token is checked by the middleware. Its address is set as a server on the “Remote (billing)” tab of the “Users / Logins” screen (Users / Logins; an entry in /config/cs/server). In the “Connector” field one of the token servers is chosen:
ministra— “Ministra / Stalker (token)”Ministra (Stalker). Address —
http://<portal>/stalker_portal/server/api/chk_flussonic_tmp_link.php. In Ministra, the channel is given the temporary link typeFlussonic, the archive typeFlussonic DVRand the archive addresshttp://<node>:<port>/<name>/index.m3u8.smarty— “Smarty (token)”Microimpuls Smarty. Address —
http://<smarty>/tvmiddleware/api/streamservice/token/check/. Stream mask —/$prefix/index.m3u8?token=$token, archive mask —/$prefix/index-$flpbt-$flpdur.m3u8?token=$token.flussonic— “Flussonic auth backend (token)”Any other middleware (for example, TVIP TMS) that checks tokens using the same protocol. Address — its check address.
A token server checks only the tokens of these addresses; it does not serve sign-in with a login and password. So in the console it has only “Name”, “URL”, “Timeout (s)” and the “Token server” section, while the password, session accounting, login prefix and suffix, tracing and response parsing are hidden. The node requires the password key but does not pass it to such servers: the console fills it in by itself. If a token server is switched to “Universal (HTTP)”, the console asks for a real password. When writing through the API, password is set to any non-empty value.
Access and re-checks¶
No token — refusal. A request without a token, with a rejected token or while the check server is unavailable gets a 403 response. If a server did not answer or answered with an error, the next one is asked; a refusal (401 or 403) is final.
Middleware unavailable. With the “Allow while the backend is down” checkbox (
auth-fail-open=true), new viewers are let in while all check servers are unavailable, and are checked again within 30 s. This key does not override a refusal from the middleware.Re-check. An ongoing session is checked again at the interval set by the middleware (the
X-AuthDurationresponse header, 180 s by default), or at the interval set in the “Re-check” field: “Profile default”, “Never” or “Every N seconds” (theauth-recheckkey:-1,0or a number of seconds up to 86400). A refusal at a re-check stops playback for that viewer. Ministra links are not re-checked: they live for a few seconds.Sessions per user. The
X-Max-SessionsandX-UserIdresponse headers limit the number of sessions of one user over HLS, DASH and MPEG-TS combined. When the limit is reached, the session that has been inactive longest is closed; a new MPEG-TS connection is not accepted in this case.The token is not shown. The token is not written to the log and is not shown in the console: on the “Clients” screen (Clients) the session appears as
tok:<16 hex digits>.OTT reserve. Sessions with a token do not take part in OTT reservation (OTT/DVR reserve).
Ministra loads the programme guide from the XMLTV export of the EPG server (/xmltv, XMLTV delivery).
Limitations¶
Timeshift — only HLS (TS) of a single stream.
Previews, video-only and per-track playlists (
video.m3u8,tracks-*) and the archive in MPEG-TS are not served: such addresses answer 404.The integration has been tested on emulators of these middleware systems, but not yet on production systems.