
AWS Elemental - Introducing video segment file process with AWS Elemental MediaConvert 📽️
Greetings all, for now I am here to introduce you about what is AWS MediaConvert (part of Elemental service) and how it works. To clarify this, I will take it from AWS documentation: 👉
AWS Elemental MediaConvert
Process video files and clips to prepare on-demand content for distribution or archivingeerrr.. what is that?😶 I'll show you the diagram below.

But, what is that? (still) 😮. Well, I'll give you very simple example here. Did you know about Netflix, Youtube, Vimeo, or another online video content provider that provide very fast and reliable media streaming? Of course you did!
So, the question is what makes those content provider so reliable? 🥺 The one of the answer is segmented file. How segmented file works? See image below.

Image above is your player, and segmented files below. For example: If you have video with 2 minutes duration, and you decide to chunk videos with 3 seconds duration each file, so you need 40 chunked video. 🤔

Simple right? Yes 👍. But how can we achieve this? I mean there is system that control those chunked file that able to detect playback move.
It's manifest file, or we can say it as playlist. Have you heard about HLS or DASH? HLS is stands for HTTP Live Streaming, and DASH is Dynamic Adaptive Streaming over HTTP.
Anyway HLS is backed by Apple inc. whereas DASH is developed by Google as international standard for video. For HLS vs DASH you can Google it yourself 😁✌️
If you ever played with IDM (Internet Download Manager), in certain sites, you will find media format to download such as .TS or may be .m4s, .m4f?
You asked for single video with .mp4 format but you can't find it.
Simply, IDM keep detect .TS, .m4s, .m4f as video file source, it means IDM detect the chunked file (File 1, File 2, File n..). Make sense? 👍
Back to playlist or manifest file 👈. If you working with HLS so the playlist format would be .m3u8, however if you working with DASH .mpd is the playlist format.
For next discussion, I will go with DASH anyway. So let's start.
MPD is stands for Media Presentation Description. Basically, it's XML. Now, I will put the code inside mpd file.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MPD mediaPresentationDuration="PT10S" minBufferTime="PT1.500S" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011">
<Period duration="PT10S">
<AdaptationSet segmentAlignment="true" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation bandwidth="602400" codecs="avc1.4d401e" frameRate="30" height="240" id="VIDEO-1" mimeType="video/mp4" startWithSAP="1" width="426">
<BaseURL>bigbuck01</BaseURL>
<SegmentBase indexRange="1211-1302" indexRangeExact="true">
<Initialization range="0-1210"/>
</SegmentBase>
</Representation>
</AdaptationSet>
</Period>
</MPD>
Code above is simple mpd that I created. As you can see, there is bandwidth. Bandwidth indicate your internet bandwidth that match with mpd file, for advance mpd file with several video quality you would see several bandwith to control with. Another advance mpd code you would see SegmentTimelineto detect what chunked video file that will play.
<Representation id="2" width="480" height="270" bandwidth="400000" codecs="avc1.4d401f" frameRate="15000/1001" scanType="progressive">
<SegmentTemplate media="Big Buck Bunny 1080 10s 10MB-480x270-400kbps_$Number%09d$.mp4" initialization="Big Buck Bunny 1080 10s 10MB-480x270-400kbpsinit.mp4" startNumber="1">
<SegmentTimeline>
<S t="0" d="270270" r="2"/>
<S t="810810" d="90090"/>
</SegmentTimeline>
</SegmentTemplate>
</Representation>That's the magic happen. 🙌
When you use DASH, there is Adaptive word in that. It means, MPD able to detect your internet bandwidth and adjusting the video quality. 🎞
I explored how to create MPD and how to chunked file into segments, with 2 preset video quality (480x270-400kbps and 640x360-600kbps).

For next discussion I will explain how to create DASH format with AWS Elemental.
Happy research! 😄🤟
