Hello, and welcome to another episode of 'This is My Architecture'.
I'm Sonika,
and today I have Vaibhav from MX Player with us.
Hello, Vaibhav. Hey, thanks for having me.
Vaibhav, can you tell us a bit about MX Player?
MX Player is India's largest digital entertainment ecosystem
with 1 billion plus app downloads on Android.
We have around 17 plus international market,
and we have around 300 million plus MAUs.
and more than 200K hours of video,
containing 10 different languages.
200 hours of video content, 200K hours of video content, right?
These are like huge.
So how are you managing this scale, Vaibhav, on this platform?
So as an OTT platform,
we basically get lots of video from different vendors,
and our content team basically, ingest the data
to our CMS.
So this comes from the CMS too,
this is our transcoding API, and then the flows through.
Okay, so once the file is ingested to the EC2,
what gets further to the pre-transcoding?
So basically once this file gets ingested,
basically this pre-transcoding API
invokes the transcoding workers,
and sends a message to SQS and creates a task in ElastiCache.
Okay, so once the file is ingested,
and the pre-transcoding layer is invoked,
what exactly happens here?
So the pre-transcoding workers
do a basic check of the raw videos,
and do audio and subtitle transcoding.
And with this, like there's a huge amount of videos that come in.
So we use autoscaling in this,
particular to scale Spot Fleet.
Okay, and this is Spot Fleet, is it?
Yeah, this is Spot Fleet.
Like the raw video sizes are very big,
so we use the GPU instances here,
and sometimes we use the normal CPU wait instances
to basically do pre-transcoding work.
Okay, and once the pre-transcoding is done,
what happens next?
So once pre-transcoding is done,
so basically, it's again, sending our data to SQS,
and also hits an actual transcoding API.
Okay, so I'm sure you will be receiving so many files
because like you have 300 million plus MAUs,
so this would be massive scale, right, on the transcoding layer.
So what exactly are you doing here?
So these particular transcoding workers,
basically get the data from S3.
And this is basically, again, a Spot Fleet,
where we have GPU instances and the CPU instances.
So this comes to the S3 and does our transcoding.
Once the transcoding is finished,
they like, because the pre-transcoding created a task here,
so basically they mark the task done here,
and send data back to S3.
Got it.
So this Spot Fleet, right.
I'm sure there would be reason why you're using Spot Fleet here,
and what is a peak scale that you've seen with the transcoding layer?
So, the transcoding one is like a...
if I give you an idea,
like once we have around 100K videos
ingested in our SQS.
And this is Spot Fleet,
basically we scaled up to like around 3000 instances,
which basically we have almost finished all this transcoding in one hour.
One hour, that's really amazing.
So once the video files get created and transcoded,
the final output is there, here in the S3 file, right?
The media files stays.
As a user when I hit a play button for a video file on MX Player,
what happens?
So whenever a user hits a play button,
it directly comes to CloudFront.
And for the CloudFront backend is the S3.
And from the S3, all the video goes to users.
So how are you making this efficient for the end user?
So we basically with this all is Spot Fleet,
in all different types of EC2 GPU and all,
we basically will do a multiple coded transformation.
So with the multiple codecs, like we use s266, x265,
they will run different transcoding formats,
which basically compress the data.
If I give you a good idea, like we are the only one in the OTT platform
who does the s266 transcoding.
Only the one, right?
Maybe the first one to do s266.
So what is the final user bandwidth
that is benefited?
Yeah, so the user bandwidth,
if I transcode out content that is s266.
The user consumption will be 50% less than the other things.
Lot of savings on internet. Yes.
Because the loss of CDN cost basically it's a user benefit
as well it's a cost benefit for us as well.
Because the CloudFront, the CDN data out will be less.
And from S3 to CloudFront data will be less data,
but it's all free, but there will be less data transfer in there.
Okay, so this is how we, as an end user,
quickly see the videos on MX Player.
Exactly.
Thank you so much.
This is really a great scalable architecture.
Thanks for sharing your time with us today, Vaibhav.
Thank you.
Thanks for watching 'This is My Architecture'.