Flex 101 - vexorian/dizquetv GitHub Wiki

What is a Program?

A "program" is a piece of media that is scheduled to be played at a fixed time. For example, the schedule will say something like "Play Simpsons season 3 episode 10 at 8:14 on July 10-th". That's a program.

What is Flex?

Flex is a period of time during which the channel has no program scheduled to play. But if there's no program scheduled to play, dizqueTV tries to play other things:

Filler

Filler lists are collections of media that can be randomly played by the channel. To add Filler to a channel, you must first setup the Filler List in the Library lab of dizqueTV UI. After that you can add any number of Filler Lists to the channel, with two configurations:

  • Weight: The random process has to pick videos from one of the filler lists, by adding weight to a list you make it more likely to be picked.
  • Cooldown: Cooldown is a minimum separation of time between playing the same filler list again. So if a list is configured with 30 minutes cooldown, and a video from that list is picked, it means that the channel will NOT pick a video from that list until the 30 minutes pass.

There are also per-video restrictions to what can be played. If a filler video's length is longer than the remaining flex time, it won't be picked. You can also setup a cooldown for the whole channel, so that after playing a video, it will wait sometime before being able to play it again.

Fallback

If there's no filler media to play at a given time, dizqueTV will play the fallback.

  • Image + music: You can use any image and music file as the fallback.
  • Video from library: Or you can pick a video from the plex library.

Unlike filler videos, fallback will always be played, even if the fallback video / audio is longer than the remaining flex time. This means that the video will be cut.

In order to allow timer videos to work as a fallback, the time that will get cut is the one at the beginning of the video. For example, if you had a 15 minutes countdown timer as a fallback, and there are 7 minutes left of Flex time, it will play the last 7 minutes of the video.

Reasons to use flex time.

Padding

The main reason Flex was added as a feature was to allow schedules such as "Play this episode exactly at 8:00, then play this other episode at 8:30". Since most TV show episodes and movies are not exactly 30 minutes-long, the only way to accomplsh this is by adding padding in the form of flex. The channel tools for creating schedules with exact starting times will add flex time automatically to make it work.

Breaks

Even if you don't need the programs in your channel to start at fixed-minute times, a property of the simulated TV experience is that it does not have a pause button. It will continue playing. Even in continuous viewing sessions you might want to have some small breaks so that you can go grab a snack or go to the bathroom or check out your phone. Hence adding some short breaks between programs can be helpful. The "Add Breaks" tool is useful for this, but breaks are also a nice side effect of padding.

Completely random channels / segments

Some channels don't really need to have a predefined schedule. For example if you are making a music channel. So channels whose schedules consist entirely of Flex time are a common use case. See Music Video Channel Recipe for more info.

Preventing lag.

Even if you absolutely do not want any padding or breaks in the programming, I recommend to add at least 10 seconds of padding between programs (and you may show a black screen as fallback during this).

The reason for this is that there is some inevitable latency between plex, dizquetv and the client watching the show. This latency can become an accumulated issue.

Imagine if there was a slight latency of 3 seconds. It means that the first program you play will start playing in your client 3 late. There is a protection in dizquetv so that you don't miss the first few seconds of a program just because the client requested it slightly late. So this means that if the client requests a program 3 seconds late, dizquetv will play from the beginning. But there might be some latency on top of this delay, so this means that this program will play 6 seconds late. The next program might play 9 seconds late and so and so until the accumulaed delay might get as large as 30 seconds. When this happens, dizqueTV will stop trying to play the show from the beginning and it would instead cut the first 30 seconds of the program.

Flex time works different than scheduled programs, if you have 15 secons of flex time scheduled, and you are 3 seconds late, dizqueTV will consider it as a 12 seconds late gap and continue as normal. Even if the accumulated delay is as large as 13 seconds, then it will only play 2 seconds of flex time and then continue as normal. Thus flex time allows dizqueTV to dampen the effects of accumulated delays.

It's fun

But the greatest reason to use Flex time is that it can actually enrich the fake TV experience! Unlike padding in real life TV, you don't have to add commercials to these periods. What people tend to do use add music videos and short clips to this. You'll find that the selection of filler / fallback to play in a channel's flex time can really give the channel a life and identity of its own. This is specially fun when you are trying to emulate classic TV channels. If you add the video clips that used to play in those channels, they will really look the part.