Media Rules

Description

Different types of devices require a video stream with specific parameters to function. To do this, the device must obtain the specific URL of each channel.

Media rules allow you to generate the URLs required by devices based on the parameters specified.

By setting one or more of the key parameters listed below in a Media Rule, you can select the desired device category and apply a separate Media action to this category.

  • device type;

  • client type;

  • specific provider;

  • network;

  • region

In Media actions you specify the scheme, protocol and type (live/dvr) on the basis of which a suitable media server will be selected. Based on the template that meets all the requirements of the media server, the required dynamic channel URL will be generated.

../../_images/flowchart.en.png
The following requirements must be met for a device to receive a dynamic url:
  • In the channel settings, the URL field should be empty;

  • A Media Rule must be created;

  • The channel must be added under Media in the Media server settings;

  • A Pattern must be created.

Media rules

Media Rules - selection of which Action to apply, the rules are searched from top to bottom, from the first to the last. If the rule conditions match the device information, the search is terminated and Action is applied.

When creating Media Rule you can specify one or more device parameters, each parameter can contain only one value. Fields marked with * are mandatory.

../../_images/rule_main.png
Name:

Any name for the rule.

Media action:

The action to be applied in this media rule.

Provider:

A drop-down list of providers that have been added to TMS.

Network:

The network to which the current rule will apply. You can specify either a single IP address (if the address 192.168.1.10/32 is specified, the rule will apply to only one IP address) or a subnet (if the address 10.10.10.0/24 is specified, the rule will apply to all addresses in the range 10.10.10.0 - 10.10.10.10.255).

Region:

Specifies the region for which the rule will be applied.

Device class:
A drop-down list of the available values, the designations of the main devices:
  • stb - media centers;

  • mobile devices;

  • web - web-player for browsers;

  • tv - TV;

  • tablets.

Client type:
Selecting from the drop-down list, the following options are available:
  • tms_client;

  • tvip_native;

  • tms_portal;

  • tvip_native_nacl.

User-agent:

Regular expression, passed in the header when the client requests a playlist.

OS:

Client operating system. Regular expression, passed in the header when the client requests a playlist.

Device:

Selecting device by UID.

Device Type:

Device type

Use for:

Live - apply the rule for live only, DVR - for dvr only. You can specify for both live and dvr.

Media Server

Media Server - description of a server that has a specific type, supported schemes (http/https), the server connection address, its priority and the set of Media that this server contains.

../../_images/media_server.png
Name:

Any name for the server.

Schemas:

Protocol for the current server: HTTP, HTTPS, UDP, RTP, RTMP. Multiple values are available.

Host:

The IP address or domain name of the server.

Port:

Port.

Type media server:

Media Server Type, created in the Media Server Types settings.

Priority:

Server selection priority, the higher the value, the higher the priority.

Roles:

Live and/or DVR.

Default DVR depth:

The depth of the archive to be applied to this channel.

Attention

The archive depth from the Media server settings will be applied only if the archive depth is not specified in the Channel and Media settings.

Warning

If Media rules are used, the ARCHIVE rate plan setting is ignored

Media

../../_images/media.png
Media server:

Drop-down list for selecting a media server.

Default DVR depth:

The depth of the archive to be applied to this channel.

Attention

The archive depth from the Media settings will be applied only if the archive depth is not specified in the Channel settings.

Channel:

The name of the channel in the TMS.

Resource ID:

Channel System Name.

Description:

Any description of the channel.

Media server Types

Media server Types - description of media server features: what protocols are supported and how the final URLs of streams are formed for this type of media server (for example, what is the type of media server: Mira Streamer, Flussonic).

By default, 3 server types are added:
  • Multicast;

  • TVIP MIRA;

  • Flussonic.

../../_images/default_types.png

You can add new Media server Types as needed

../../_images/server_type.png
Name:

Any name for the server type.

Protocol:

Protocol for server type: HLS, DASH, RTSP, RTMP. Multiple values are available.

Pattern

Pattern - the template on the basis of which the final URLs of the streams will be generated. Basic Patterns are added by default.

../../_images/default_patterns.png

The creation of new Patterns is available.

../../_images/pattern.png
Name:

Any name for the pattern.

Pattern:

Template for the final URL stream, you can set it yourself or choose from prepared templates.

Protocol:

Protocol.

Type media server:

The type of server for which the template can be used.

Example of use

Let’s create dynamic URLs for the Example Channel, using the following parameters:

  • For TVIP S-Box Media Centers - Live and Dvr, HLS stream, HTTP scheme;

  • For Android TV - Live and Dvr, HLS stream, HTTPS scheme;

  • For mobile devices - Live and Dvr, HLS stream, HTTP and HTTPS scheme;

  • For Smart TV Tizen and WebOS - Live and Dvr, HLS stream, HTTP and HTTPS scheme;

  • For all other devices, Live and Dvr, HLS stream, HTTP scheme;

  • In the current example, the servers for Live and DVR will be different.

Select TVIP MIRA from Media server type.

../../_images/example_server_type.png

Add Live and DVR servers:

../../_images/example_live.png ../../_images/example_dvr.png

And add the Example Channel to the Media section for the created Media Server:

../../_images/media_live.png ../../_images/media_dvr.png

Let’s make sure there are suitable Dvr and Live Patterns for our TVIP MIRA server type:

../../_images/pattern_dvr.png ../../_images/pattern_live.png

We will create a separate Action for each device type:

../../_images/action_stb.png ../../_images/action_atv.png ../../_images/action_mobile.png ../../_images/action_smart.png ../../_images/action_all.png

Now we can create a Media Rule for each of the device types. We will define the device by the Header User-Agent parameter.

For Tvip S-Boxes:

../../_images/rule_stb.png

For Android TV:

../../_images/rule_atv.png

For mobile devices:

../../_images/rule_mobile.png

For Smart TV:

../../_images/rule_smart.png

For all other devices:

../../_images/rule_all.png

The Media rule created for other devices should be at the bottom of the list, as it should have a lower priority.

../../_images/media_dash.png