Converting an input into multiple bitrate HLS output media file(m3u8) using AWS MediaConvert

Hetul Sheth
2 min readAug 9, 2020

--

Go to AWS mediaconvert console:

  1. Click “Get started”
  2. In the left panel in Inputs select the s3 bucket destination where your mp4 files are stored which is to be converted to HLS.
  3. Now in the left panel you see Output groups > Add > select Apple HLS(Add output group).
  4. Give the custom group name according to the desire or requirement and then select the destination bucket where you want to store the output bitrate HLS file.
  5. You can encrypt your assets by enabling the DRM encryption option(will incur charges). Refer the link for how to enable encryption using static key for HLS content.
  6. You can add multiple outputs according to the requirement or resolution requirement of yours.
  7. Select Output 1 (left panel)
  8. Select “No Preset” > Name modifier( any string you need to enter at the end of the output file)
  9. You can keep the segment modifier as blank or you can use if you want to add an identifying string to the filename of each segment. The service adds this string between the name modifier and segment index number.
  10. In Stream Settings > Video> select resolution that you wanted to convert files to (e.g. 1028 x 720). Select appropriate bitrate according to the resolution chosen for smooth working.
  11. You can create multiple resolution outputs according to the requirement by selecting different output numbers as in step 7.
  12. To create thumbnails kindly follow the following link.
  13. In left panel Job Settings > Settings assign the IAM role created for mediaconvert. (Refer this link for creating role)
  14. Hit the create button at the bottom left corner.
  15. It will show you Job Summary and wait until status turns to be COMPLETED.
  16. Check your destination bucket whose path you have mentioned in step 4. You will find your m3u8 hls bitrate file and the ts file. The ts files contain the segment of converted videos.
  17. So whenever you run the m3u8 file it fetches all the video data from this ts files and shows you. That’s why you will see that this ‘ts’ file has larger size compare to the m3u8 file as this m3u8 file is just referencing this ‘ts’ files.
  18. You will also find the different resolution that you have mentioned in Output with the ‘Name modifier’ you provided appended at the end of the file name.
  19. Remember before running your m3u8 file on any player you need to enable required CORS for the bucket in which these files are stored

--

--

Hetul Sheth
Hetul Sheth

Written by Hetul Sheth

AWS Certified Solutions Architect, Developer and SysOps Admin Associate | Azure Certified

Responses (1)