Using HLS Video Presets
In order to provide an HLS stream, you have to use HLS presets. Amazon Elastic Transcoder provides a range of predefined HLS presets, or you can define your own. An Elastic transcoder HLS preset generates one of the substreams that go to make up a complete HLS stream. So if you define a preset group like this:
<presetGroup type="video" name="high-res" default="true"> <ui:title>High resolution videos</ui:title> <presets> <preset id="preset-id"> <thumbnails/> </preset> <preset id="preset-id"/> <preset id="preset-id"/> <preset id="hls-preset-id"/> <preset id="hls-preset-id"/> <preset id="hls-preset-id"/> </presets> </presetGroup>
Then the result is four transcoded outputs: three fixed bit-rate videos and one HLS video stream offering three different bitrates.
The short video segments that make up an HLS video stream are stored
in files with the extension .ts
. Each substream is
represented by a playlist file with the extension
.m3u8
. This is a simple text file that contains
correctly ordered references to all the .ts
files
in the stream. The whole HLS stream is represented by yet another
master playlist .m3u8
file
that contains references to each of the substreams. This structure is
automatically created by the Elastic Transcoder, and is the structure
expected by HLS-capable clients. All you need to be aware of is that
the HLS presets you define in a preset group get merged to a single
HLS output stream, represented by a .m3u8
playlist
file.
You can control the length of the .ts
segments
generated by Elastic Transcoder by setting a
segmentDuration
property (see
AWSClientService.properties). This
will determine how quickly a client responds to changes in available
bandwidth.