AWS for M&E Blog
Deploying virtual linear OTT channels using AWS Media Services
This blog post details how to create virtual linear OTT channels that can sequentially deliver both video on demand (VOD) and live streaming video by defining a channel schedule in AWS Elemental MediaTailor using Channel Assembly. This stems from an increased customer need to provide free ad-supported television (FAST), which is rapidly gaining traction with consumers and, in some cases, is used as a remedy for subscription overload. When delivered with scalable services from Amazon Web Services (AWS), FAST provides an opportunity to deliver more value with targeted ads and predictable costs. This post describes how to build and monetize a 24/7 FAST linear over-the-top (OTT) channel using VOD assets and live video streams, and how to incorporate server-side ad insertion.
Components
The setup consists of three primary components:
- A live video source using an AWS Elemental MediaLive channel that writes just-in time transcoded video segments to an AWS Elemental MediaPackage channel for origination.
- Amazon Simple Storage Service (S3) buckets to store VOD sources, filler slates, and ad break slates.
- A linear OTT channel to assemble individual sources of content and declare the upcoming program schedule to exactly predict the sequence of content and ad-breaks using the Channel Assembly feature of MediaTailor.
Architecture
Create a live source using MediaLive and MediaPackage
You can quickly create a live streaming endpoint from the AWS Management Console by using the MediaLive Workflow Wizard. Simply follow the steps described in the blog post entitled
Quickly create a live streaming channel with AWS Elemental MediaLive Workflow Wizard.
Once you create a live channel, you will verify in MediaPackage → Channels → <your channel> → Manage endpoints → < your HLS endpoint> → Package settings → Additional configuration → Program date/time interval (sec.) is set to “1” as described in the following image.
Create a VOD source to match the transcode profile of the live source
You will need to upload your VOD assets (which could be in an MP4 container) to an Amazon S3 bucket. Re-transcode the assets using AWS Elemental MediaConvert to match the ABR stack of the MediaLive channel. This will mean that the number of renditions and their respective resolutions are identical for both the re-transcoded VOD assets and the live streaming endpoint.
Configure MediaTailor Channel Assembly
Before setting up Channel Assembly, it is essential to consider the following:
a. Live, VOD, and slate ad sources must include the same number of HLS renditions
b. Live sources must contain HLS #EXT-X-PROGRAM-DATE-TIME tags
c. Live, VOD, and slate sources must be reachable via Internet (e.g. Amazon CloudFront distribution)
Configuration
From the AWS Management Console→MediaTailor, select “New source location”
Fill in “Name” and “Base URL” from the source location menu. “Base URL” refers to the domain where Channel Assembly will look for VOD or live content. This example relates to a MediaPackage endpoint (notice that it does not include the entire path but just the domain name).
From the source location menu, add live source.
You will add a source group that associates a package configuration with an output on a channel. When you create the package configuration on the source, you identify the source group’s name.
When you create the output on the channel, you enter that same name to associate the output with the package configuration. Sources, either live or VOD, that are added to a program on a channel must belong to the source group that’s identified in the output, i.e. source-group-1 in this example.
Fill in “Name” and “Relative path” from the live source menu. Notice that the last parameter refers to the path that complements the domain (set before) to retrieve the live content.
A similar process is performed for VOD and slate sources.
If an ad break is required within a specific duration (e.g., 30 sec), you need to add a VOD source of the same duration. In this example, a 30-second color bar is added.
Fill in “Name”, select Tier to “Standard”, and specify “Source location” and “VOD Source name” to be used as filler slate in case the live channel does not have live or VOD programming available.
Next, fill in “Manifest Name” with a convenient value. In most cases, “index” would be fine, and the manifest perceived by end-user video players would be “index.m3u8”.
In the next section, select the most appropriate option for access control. In this example, you will choose “Attach public policy” because we want to enable internet users to retrieve our virtual live OTT channel.
Refer to https://docs.thinkwithwp.com/IAM/latest/UserGuide/access_policies_create.html to add more conditions.
Once the MediaTailor channel is ready, you can add VOD and live programs.
Each VOD program can include single or multiple ad breaks. The parameters “Source location” and “VOD Source” need to be filled in to set up an ad break. The duration of content referenced by those fields must match exactly the ad break duration. In the case of multiple ad breaks, the parameter “Offset in millisecond” must be defined. This value indicates the time in the future, considering the “zero” reference at the beginning of the VOD content. In this sense, a single VOD source can contain multiple ad breaks of distinct duration over time. From more technical perspective, the action of the breaks would be SCTE-35 markers into the HLS manifest following DATERANGE format. For more detail, visit https://docs.thinkwithwp.com/elemental-live/latest/ug/scte-35-ad-marker-ext-x-daterange.html.
For live sources, specify the date and time of the beginning of the program. It is essential the start time be at least 15 minutes after the current time. The “Relative Position” setting in the playback configuration does not apply to the first program in a linear schedule. The next program requires that value to be set to “After Program”.
Once the programs are successfully created, start the channel. To test your channel, copy the URL displayed in the Channel “Output” section and play it using a HLS.js video player (a demo player is available here: https://hls-js.netlify.app/demo).
This URL can also be used to feed the “Ad-insertion” component of MediaTailor, acting as server-side ad insertion (SSAI) to perform an interaction with an ad decision server of a static VAST file located in an Amazon S3 bucket. The integration with a MediaTailor configuration and an ad decision server will be described in part 2 of this post.
To test playback of the virtual linear OTT channel, go to https://hls-js.netlify.app/demo/, introduce the URL copied in the previous step, and press “Apply”.
If the channel does not have programming available at playback, the slate video will display.
Conclusion
In this blog post, we created an HLS endpoint for distributing a virtual linear OTT channel, which we can also refer to as free ad-supported TV (FAST). We walked through the chronological steps to schedule programming for live and VOD content using MediaTailor Channel Assembly and to insert ad breaks to display slate ads. After deriving the endpoint URL, we verified the successful playback of the channel in a web-based test HLS video player. You can now switch smoothly between live events, such as news or sports, to VOD sources as well introduce ad-breaks to create a wide range of personalized live playlists for enhanced end-user experiences.