Articles on: Using Quortex Play

Use Rules to define prime-time configurations

Creating a specific prime-time configuration is a great way to retain your audience and bring the best possible quality to your end users when that matters most. This can ban easily achieved with our Rule system.

Rules is one of the unique features of our SaaS. It allows you to define specific configurations based on user characteristics (localization, device type, ...) or based on other events, such as the stream time or even third party API event. In this example, we'll see how to create a specific configuration for your premium events, during prime-time.

Rules concept reminder

In Quortex I/O, the inputs, processings and targets are, by default, selected through the publishing point URLs. For instance, if you publish /**input1**/**processing1**/**target1**, the system will automatically select input1 as the input, processing1 as the processing configuration, and target1 as the target. That's simple and efficient, but sometimes you want to go one step further.

The rule mechanism allows to define overrides on this behavior. For instance, you can have a rule that prevents mobile users from watching input1. In such a case, you will define a rule and the system will evaluate the rules so that another input can be selected for the /**input1**/**processing1**/**target1** publishing point.

Let's explore this further!


For this example, we will assume a single input (called My Input) and a single HLS target (called My HLS Target)

Create your configurations

In order to switch between different configurations, you first need to create these configurations. This can be done in the wizard or in the "Processing" section of your pool. In this example, we will create:

a 6 profiles, up to 1080p50 configuration for the prime-time that we call "Premium"

A 3 profiles, up to 540p25 configuration that we call "Standard"

Without defining rules, the following publishing points are automatically created:

You rule it!

Let's now use rules to use different configurations, based on the stream time. This can be done in the rules screen.

Create a Recurrence rule for the prime-time

Let's start by creating a Processing rule using a Recurrence condition (as we want this to happen on a periodic basis)

In this example, we assume that prime-time is between 8pm and 11pm, every day of the week. You can of course define other time slots or select specific weekdays for this condition to apply. Once you selected your time slot, select the action of selecting the "Premium" configuration.

You could also specify that you want this configuration to be selected only for users from a given country, or only for users using a specific device using other conditions.

Once this rule is created, the publishing point "/my_input/standard_configuration/my_hls_target/index.m3u8" can be shared with your users.

Instead of always selecting the "standard" configuration, the platform will evaluate the rules and will select the "premium" configuration when the corresponding rule is met, i.e. from 8pm to 11pm in our case.

You may want to unpublish "/my_input/premium_configuration/my_hls_target/index.m3u8", as the premium configuration will always be selected with this publishing point.

Publish a single publishing point using an "Always" rule.

As we've seen previously, publishing points are left untouched when creating rules, but the configurations used for processing the streams are not only derived by the publishing point URL: they can be overridden by the rules.

If you want to expose only one publishing point, you can create another rule that will be used when the "premium" rule is not met. This can be done using a specific type of rules: an Always rule.

Always rule are always evaluated as true and will always apply. Hence, an Always rule must be positioned below other rules, otherwise rules below can't be reached.

Once this rule is created, your "Processing rules" panel will look like this:

You can then go to the "Publishing Point" section, and unpublish all the "Processing" related identifiers; the result is that the "Processing" part of the URL will be removed, leaving you with only one publishing point where the processing configuration will exclusively be selected through the rules!

Tada! The publishing point /my_input/my_hls_target can now be shared with your end users!

Updated on: 01/03/2024

Was this article helpful?

Share your feedback


Thank you!