Dynamic FAST channels in Open Source Cloud
In this blog we will give an example on how you with Open Source Cloud can build dynamic FAST channels where channel programming are happening just-in-time.
What are FAST Channels?
FAST channels offer free, ad-supported streaming TV experiences to viewers without requiring a subscription. As demand for free content grows, content creators and distributors are turning to FAST as a monetization strategy. A successful FAST channel strategy involves assembling linear content streams, ensuring high-quality delivery, and dynamically inserting ads, all while maintaining flexibility for content changes and scheduling. You can read more about FAST channel creation in Open Source Cloud in a previous blog.
Creating a Dynamic FAST channel
To create a dynamic FAST channel we will be using the open source FAST Channel Engine that is available in Open Source Cloud. When launching the channel, instead of addressing a playlist file containing the list of URLs to the VOD files to be played out, we will provide a URL to a webhook.
This webhook will be called when the engine is about to switch to next VOD. It is up to the implementation of the webhook to respond with a URL to the VOD to be played next. How this decision is taken is nothing the Channel Engine needs to understand. All it provides is the id of the channel it requesting the next VOD for.
WebHook implemented using a Lambda
A webhook is an HTTP(s) endpoint that needs to be reachable by the Channel Engine. To provide this endpoint we will use the Lambda open source project available in Open Source Cloud.
We create a Lambda instance first and then we upload the code written in the Javascript programming language. To serve as an example we will have a function that randomly chooses a VOD from a list of VODs.
const { randomUUID } = require('crypto');
exports.handler = async (event) => {
const channelId = event.query.channelId;
console.log(`Requesting next VOD for channel ${channelId}`);
const vods = [
'https://lab.cdn.eyevinn.technology/stswetvplus-promo-2023-5GBm231Mkz.mov/manifest.m3u8',
'https://lab.cdn.eyevinn.technology/Channel-Engine-Promo-Mar-2023-PnA8E-jw5x.mp4/manifest.m3u8',
'https://lab.cdn.eyevinn.technology/eyevinn-reel-feb-2023-_2Y7i4eOAi.mp4/manifest.m3u8'
];
return {
body: {
id: randomUUID(),
title: 'Example',
hlsUrl: vods[Math.floor(Math.random() * vods.length)],
prerollUrl: 'https://maitv-vod.lab.eyevinn.technology/VINN.mp4/master.m3u8',
prerollDurationMs: 105000
}
};
};
It also inserts a house ad between the VODs that is signalled and can be replaced by a server-side ad inserter between the engine and the player.
We then bundle this code in a zip file and upload to the Lambda instance.
curl -v -H 'Authorization: Bearer <SAT>' \
-F upload=@bundle.zip \
https://eyevinn-webhook.birme-lambda.auto.prod.osaas.io/upload
The <SAT>
is the Service Access Token that you have acquired. Example on how to acquire a service access token is found here.
When we then create the channel we choose the plugin WebHook
and the URL to the Lambda event request endpoint, which in this case is https://eyevinn-webhook.birme-lambda.auto.prod.osaas.io/event
Now when we are playing this channel we have created you will find that it will randomly choose what will be played next. Yes, this is a trivial example but it gives you an idea of the possibilities this enables.
Conclusion
As this example shows you you can build and launch dynamic FAST channels based on open source software without having to build, deploy and host it yourself.
Sign up and try it out is all for free and you only need a credit card to upgrade to a paid plan.
For more detailed technical documentation and service descriptions, visit the Open Source Cloud FAST Channel Engine documentation.