Schedule Service to mockup channel playlists and EPG

Eyevinn Technology
3 min readOct 21, 2021

Whether you are developing a frontend application for a streaming service presenting an EPG, or building services to generate linear channels (virtual or real) you might need some realistic schedules for testing. With realistic schedules I mean a schedule that contains events timed with the time-of-day and the length of the content. For this purpose we have built the Eyevinn Schedule Service and also released the source code as open source.

Example of using the Eyevinn Schedule Service together with the Eyevinn Channel Engine (vod2live engine)

The fundamental part of the Eyevinn Schedule Service is that it should provide an HTTP-based API which applications can access and get a list of schedule events for a channel. Schedule events are automatically created and propagated to the channel’s schedule with auto scheduler modules. The service is built to be modular and new auto scheduler modules can (and will) be added later on.

MRSS Auto Scheduler Module

Available today is an auto scheduler module that fetches the contents of an MRSS feed and randomly choses an item from this feed to add to the schedule. This is repeatedly done and new events are continuously added. The simplest form of an MRSS feed can look like this:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
<id>testcontent.mrss.eyevinn.technology/eyevinn.mrss</id
<title>Feed for Test-Content</title>
<updated>2021-09-30T12:16:20.889Z</updated>
<entry>
<title>NO_TIME_TO_DIE_short_Trailer_2021</title>
<id>5050630b-b599-4e66-8033-f9f6139a7284</id
>
<link>https://lab.cdn.eyevinn.technology/NO_TIME_TO_DIE_short_Trailer_2021.mp4/manifest.m3u8</link>
</entry>
<entry>
<title>THE_GRAND_BUDAPEST_HOTEL_Trailer_2014</title
<id>21053ee7-b289-4210-869e-43f355357332</id
<link>https://lab.cdn.eyevinn.technology/THE_GRAND_BUDAPEST_HOTEL_Trailer_2014.mp4/manifest.m3u8</link>
</entry>
<entry>
<title>BAAHUBALI_3_Trailer_2021</title>
<id>3413fb29-4aad-4a8d-80d8-b439809930f3</id>
<link>https://lab.cdn.eyevinn.technology/BAAHUBALI_3_Trailer_2021.mp4/manifest.m3u8</link>
</entry>
<entry>
<title>OWL_MVP_2021</title>
<id>98291d87-8681-4550-8969-5082cf2be001</id
<link>https://lab.cdn.eyevinn.technology/OWL_MVP_2021.mp4/manifest.m3u8</link>
</entry>
</feed>

Schedule API

The service provides an HTTP based API to access the channels and their schedules that the auto scheduler modules have created. To get a list of channels that are available:

curl https://<service>/api/v1/channels[{"id":"eyevinn","tenant":"<service>","title":"Demo Channel"}]

And to get the schedule events for the eyevinn channel above:

curl https://<service>/api/v1/channels/eyevinn/schedule?start=2021-10-21T20%3A30%3A00Z&end=2021-10-21T20%3A39%3A00Z

The request above will return events between 20:30:00 and 20:39:00 (UTC) on October 21, 2021.

[
{
"id": "fde98114-324e-4d12-8ffb-c70d533017ed",
"channelId": "eyevinn",
"title": "NO_TIME_TO_DIE_short_Trailer_2021",
"start_time": 1634848354467,
"end_time": 1634848440467,
"start": "2021-10-21T20:32:34.467Z",
"end": "2021-10-21T20:34:00.467Z",
"url": "https://lab.cdn.eyevinn.technology/NO_TIME_TO_DIE_short_Trailer_2021.mp4/manifest.m3u8",
"duration": 86
},
{
"id": "dca36c2d-5c43-480a-87b0-cc20271d7d62",
"channelId": "eyevinn",
"title": "BAAHUBALI_3_Trailer_2021",
"start_time": 1634848276467,
"end_time": 1634848354467,
"start": "2021-10-21T20:31:16.467Z",
"end": "2021-10-21T20:32:34.467Z",
"url": "https://lab.cdn.eyevinn.technology/BAAHUBALI_3_Trailer_2021.mp4/manifest.m3u8",
"duration": 78
},
{
"id": "982e125c-3e8b-434a-bee3-c5dbf845f3d1",
"channelId": "eyevinn",
"title": "BAAHUBALI_3_Trailer_2021",
"start_time": 1634848440467,
"end_time": 1634848518467,
"start": "2021-10-21T20:34:00.467Z",
"end": "2021-10-21T20:35:18.467Z",
"url": "https://lab.cdn.eyevinn.technology/BAAHUBALI_3_Trailer_2021.mp4/manifest.m3u8",
"duration": 78
},
{
"id": "9dd43f5e-426a-4b62-a82f-58ff34f1d2e5",
"channelId": "eyevinn",
"title": "OWL_MVP_2021",
"start_time": 1634848518467,
"end_time": 1634848650467,
"start": "2021-10-21T20:35:18.467Z",
"end": "2021-10-21T20:37:30.467Z",
"url": "https://lab.cdn.eyevinn.technology/OWL_MVP_2021.mp4/manifest.m3u8",
"duration": 132
},
{
"id": "9e421499-f6ee-49ee-91e9-bf4fee780d65",
"channelId": "eyevinn",
"title": "THE_GRAND_BUDAPEST_HOTEL_Trailer_2014",
"start_time": 1634848650467,
"end_time": 1634848796467,
"start": "2021-10-21T20:37:30.467Z",
"end": "2021-10-21T20:39:56.467Z",
"url": "https://lab.cdn.eyevinn.technology/THE_GRAND_BUDAPEST_HOTEL_Trailer_2014.mp4/manifest.m3u8",
"duration": 146
}
]

As you can see the contents of a schedule event is quite bare bone and basically only contains start, end and title. This can be enriched with posters, metadata, descriptions, etc in future versions.

Using it with the Eyevinn Channel Engine

If you want to use the Eyevinn Schedule Service to generate a virtual linear TV channel with the Eyevinn Channel Engine (vod2live engine) there is an NPM library available as adapter to the schedule service API.

const DemoChannelEngine = require("eyevinn-channel-engine");
const { ChannelManager, AssetManager } = require("@eyevinn/schedule-service-adapter");

const channelManager = new ChannelManager({
scheduleServiceEndpoint: new URL("https://<schedule-service>/api/v1")
});
const assetManager = new AssetManager({
channelManager: channelManager,
});

const run = async () => {
await channelManager.init();

const engine = new DemoChannelEngine(assetManager, {
channelManager: channelManager,
});
engine.start();
engine.listen(8000);
};
run();

All of this is available as open source and you are welcome to use, extend and contribute back to this project. It is available on GitHub where you also find more documentation on how to get started.

This blog was provided by an Eyevinn Video-Dev Team, and if you have any further questions and comments on this post drop a comment below or tweet the post author on Twitter (@JonasBirme).

Eyevinn Technology is leading specialists in video technology and media distribution, and proud organizer of the yearly nordic conference Streaming Tech Sweden.

--

--

Eyevinn Technology

We are consultants sharing the passion for the technology for a media consumer of the future.