AWS for M&E Blog
Schedule live linear channel playout using AWS Elemental MediaTailor
Introduction
Scheduling live linear TV playout for distribution via over-the-top (OTT) platforms is a common use case for media customers around the globe. This approach provides an opportunity to monetize content in multiple ways. For example, some OTT platforms provide a “before-TV experience” as a premium feature where viewers can watch their favorite content before it’s aired on broadcast TV. To achieve “before-TV” functionality, OTT platforms acquire content prior to actual broadcast and make videos available on demand. In this blog post, we look at how customers can make use of existing content by converting it to a live channel.
In addition to the distribution of linear TV programming via OTT platforms, customers may also have a requirement for temporary live channels, such as:
- Creating live pop-up channels
- Running a live channel for e-commerce and online ticketing platforms
- Creating a live class schedule for an educational platform or online school
Many customers schedule live linear channels by running costly live encoders or by using complex third-party playout systems. Traditional live linear channel playout systems can be expensive and complex, and may eat into the profit margins of operating these channels. Ensuring high availability of traditional live linear channels is another challenge because content availability and quality depends on the incoming live stream from third-party providers.
In this blog post, we demonstrate how to seamlessly and cost-effectively create live linear channels within minutes using existing content and schedules.
Overview
This post walks through a sample utility to automate linear content scheduling using the Channel Assembly feature of AWS Elemental MediaTailor, which leverages an electronic program guide (EPG) for automation. AWS Elemental MediaTailor from Amazon Web Services (AWS) is a channel assembly and personalized ad-insertion service for video providers to create linear over-the-top (OTT) channels using existing video content. The Channel Assembly feature uses manifest manipulation technology to allow for cost-effective linear channel creation and operation at scale.
An EPG is a system providing scheduling information for broadcast programming. It offers users of television or radio with continuously updated menus that display information for current and upcoming programs. This walk-through uses the XMLTV format to create the schedule. XMLTV is an XML-based file format designed to store scheduling information.
Channel Assembly benefits
- Highly cost efficient even for low viewership channels
- Platforms can reuse existing multi-bitrate content like HLS or DASH for creating live channels
- Provides monetization capability by inserting ads without conditioning the content for SCTE markers
Implementation
The utility used in this walk-through is called Cloud Playout Scheduler (CPS). CPS acts as a wrapper over MediaTailor Channel Assembly and lets customers take live channels to production in minutes, using existing scheduling information.
CPS is built using the AWS Serverless Application Model (SAM). The utility consists of three main modules:
- CPS-UI: This module is the frontend layer of CPS. It enables the channel administrator to create and edit playout schedules for a linear channel. Users can choose to create the schedule manually via UI or by uploading EPG schedule files. Admin users can start and stop channels seamlessly from UI.
- CPS-backend: This module is the core API layer of CPS. All actions on the frontend result in API calls to this layer. This component includes all business logic, and is responsible for parsing/validating uploaded EPG files. All schedules persist in the database. Schedule information is then communicated to the next layer for scheduling.
- CPS-scheduler: This module is responsible for creating channels and scheduling programs in MediaTailor Channel Assembly. The backend shares the scheduling information with this layer in the form of a simplified XMLTV file. This layer is responsible for converting all scheduling information into respective API calls to MediaTailor.
Architecture
User flow
- Channel Admin connects to frontend from a browser and authenticates using credentials
- Admin uploads EPG schedule using the UI
- CPS-backend parses the uploaded EPG and creates a timeline
- Admin updates program URLs for each program in timeline and saves it
- When Admin clicks to create channel, CPS-scheduler will create the channel
- CPS-scheduler gets the parsed EPG from backend and makes request to MediaTailor
- CPS-scheduler is responsible for creating, starting, and stopping the channel in MediaTailor
- End viewers can then watch content as per schedule created by this channel
Prerequisites
To deploy this sample application, you need:
- The AWS SAM CLI, Nodejs, and AWS CLI installed.
- Access to the GitHub repository.
- AWS credentials with necessary permissions to create the resources configured on the machine.
Note: We recommend using the AWS Cloud9 IDE. This will have all CLIs pre-deployed.
Deploying the application
- Clone code from the GitHub repository.
- In the GitHub repository, deployment instructions for each section of the example application are available. The repo contains three directories for the frontend (cps-ui), core layer (cps-backend), and scheduler layer (cps-scheduler) as per the solution shown in the reference architecture.
Note: Readme.md files contain all commands and sample parameters.
Creating admin user in Amazon Cognito
- Open AWS Console and go to Amazon Cognito
- Click on “Manage User Pool”
- Click on user pool name that was created by SAM. (By default, the template will use “cps-cognito-userpool”.) If you have changed it while deploying cps-backend, select appropriately
- Under “General Settings” open “Users and Groups”
- Click on “Create User”
- Provide username and temporary password. Username must be an email address
- Uncheck “Mark phone number as verified”?
- Uncheck “Mark email as verified”?
- Click on “Create User” button
- New User will be validated and activated automatically after first login
Create a live channel from front-end
1. Open URL “WebsiteURL” located in the output-parameters of cps-ui template in a web browser
2. Log-in with Cognito user credentials created previously in step 5
3. Enter a channel name (e.g. my promo channel) and click on the + icon to create the channel
4. Wait for the page to reload
5. Click on “Add Program” and add the following details.
-
- Select a program Sequence (e.g.: 01 00)
Note: As of today this is used only to sequence the program. The channel will adhere to the actual content length and not the specified time
-
- Add a random program id (e.g.: P0100)
- Add On Screen Episode Number (e.g.: 1)
- Add Title (e.g.: My Title 1)
- Add Category (e.g.: Humor)
- Add HLS program URL (e.g.: https://d7s5c9d8u64h8.cloudfront.net/blog/cps/title1/EMT.m3u8
Note: This is a sample URL from the internet. You can choose to use your own asset.
-
- Save the schedule by clicking on the green Save icon
6. Add one more schedule by clicking the Add Program button and provide details similar to step 5
7. Click the “Create Channel” button. Once the channel is created, this button will change to “Start Channel”
8. Next, click on “Start Channel”. Once the channel is started, the status of the channel will change to “Now Playing”
9. Click on the “Copy URL” button and the URL of your channel will be copied to your clipboard, which you can use in your application or video player
You can now create a live pop-up channel seamlessly within minutes using CPS. You can choose to upload an EPG to create the schedule. Note that it may take a few minutes for the schedule to populate.
Note: CPS supports EPG upload only in xmltv format.
We have successfully set up an application that can schedule and launch live channels in an easy and cost-efficient way from existing VOD content.
Clean up
-
- Stop channels from front-end when they are no longer needed to avoid unnecessary costs
- To clean up the entire infrastructure, follow the clean-up steps mentioned in Readme.md files
- If Cloud9 was launched for deployment, remember to delete that as well
Resources
To learn more about Channel Assembly and server-side ad insertion (SSAI) using AWS Elemental MediaTailor, visit the MediaTailor product page. Refer to our Channel Assembly Workshop to gain some hands-on experience using Channel Assembly. Finally, refer to this blog post for creating a live channel from existing VOD content.