OTT Platform with Speke reference server through AWS Elemental

Business Context and Problem Statement

We see overall revenue is declining in voice call for different telco companies. People are using different freely available VoIP solutions like WhatsApp, Viber for both voice and text based communication. To have different revenue stream, companies are focusing on different digital services. In that consideration, one of the top telco service providers in Bangladesh has initiated an OTT platform for their subscriber. All the streams of the platform were unencrypted which was a major concern for them. They wanted to have a secure and protected live streams to their end users which is encrypted and the key is rotated every 5 minutes with an optimized costing. As one of the top AWS solution providers, they came to us how we can help here to achieve their goal.

To provide the required solution, we looked for different available solutions like BuyDRM (https://buydrm.com/) , Intertrust (https://www.expressplay.com/) heavily used by industry leaders but the subscription fee was bit expensive which was not aligned with our client. Considering all the aspect, we started looking for opensource free solutions to be customized and Speke reference server came up to be used with AWS Elemental service to serve the purpose.

We can find the opensource repo of the Speke reference server from the following link:

https://github.com/awslabs/speke-reference-server

The Speke reference server solution is done in Python. After digging further, we found a AWS Cloud formation template was based on python 3.6 which is not supported with latest lambda python version (3.9) and a number of used libraries were deprecated in latest version. We stared doing the refactoring to comply the code with python 3.9 which can be found in the following link.

https://github.com/mizanurbd/speke-lambda-3.9/blob/0e6a81c8d392d739a6e816b309708e8563a7bea8/speke_reference.json

To support python 3.9, the codebase was also refactored shared below:

https://github.com/mizanurbd/speke-lambda-3.9/blob/0e6a81c8d392d739a6e816b309708e8563a7bea8/speke-reference-lambda.zip

After deploying the cloud formation, we need to upload the above code base to function the Speke reference server properly.

After successful implementation, the flow becomes:

The flow is:

Input: <s3-bucket>/<source_folder>/<source_file_name>

DRM:

Output: <s3-bucket>/<output_folder>/<output_file.index.m3u8++>

That S3 has a CloudFront distribution, in this case:

Demo Link: https://yourcloudfrontURL/test/test021/index.m3u8

We ran some tests playing the content on VLC, QuickTime, and Safari.

If we try to read the m3u8 file:

$ curl https://yourcloudfrontURL/test/test021/index.m3u8

#EXTM3U

#EXT-X-VERSION:3

#EXT-X-INDEPENDENT-SEGMENTS

#EXT-X-STREAM-INF:BANDWIDTH=1610383,AVERAGE-BANDWIDTH=1610383,CODECS=”avc1.77.30,mp4a.40.2″,RESOLUTION=640×360,FRAME-RATE=23.976

indextest021.m3u8

$ curl https://d7yr8u0dqt3wk.cloudfront.net/test/test021/indextest021.m3u8

#EXTM3U

#EXT-X-VERSION:3

#EXT-X-TARGETDURATION:11

#EXT-X-MEDIA-SEQUENCE:1

#EXT-X-PLAYLIST-TYPE:VOD

#EXT-X-KEY:METHOD=AES-128,URI=”https://d3f9ggqez0f75l.cloudfront.net/test021/78746cf8-58aa-4dc7-810f-10ed3daecf4e&#8221;,IV=0x00000000000000000000000000000001

#EXTINF:10,

indextest021_00001.ts

#EXT-X-KEY:METHOD=AES-128,URI=”https://d3f9ggqez0f75l.cloudfront.net/test021/78746cf8-58aa-4dc7-810f-10ed3daecf4e&#8221;,IV=0x00000000000000000000000000000002

#EXTINF:6,

indextest021_00002.ts

#EXT-X-ENDLIST

Here, we have a Key URI: https://yourcloudfrontURL/test021/78746cf8-58aa-4dc7-810f-10ed3daecf4e&nbsp;

This is a key pointing to an S3 Bucket origin. Every time we convert content through MediaConvert and give a ResourceID, it creates a key with that resource ID on the bucket.

The above POC was aligned with the need. Right now, their existing solution is in process to be refactored leveraging AWS Services, Speke reference server and other relevant technology stakes.

Leave a comment