This post is part of the series of blogs where will understand How to Protect Videos Using AWS Elemental MediaConvert and HLS just like a Netflix.
- Creating S3 bucket and configuring Amazon Cloudfront Distribution to serve content securely.
- Using AWS Elemental MediaConvert to convert video into HLS. (currently reading)
- Use AES 128 DRM Encryption to encrypt videos and make them more secure.
- Use Lambda to make the process automate.
- Creating Signed URL or Signed Cookies to serve videos.
- Play HLS video in Android app.
- Download HLS video in Android app.
Using AWS Elemental MediaConvert to convert video into HLS
Step 1: Upload files into your S3 bucket
- In the Buckets pane, choose the name of your input bucket.
- Choose Upload.
- In the Upload dialog box, choose Add files, and then upload a media file that you want to transcode.
- Choose Upload.
Step 2: Create MediaConvert job
- Open the MediaConvert console at https://console.aws.amazon.com/mediaconvert.
- On the Create job page, in the Job pane on the left, choose Input 1. Make sure that you pick the same Region for your job and your file storage.
- In the Input 1 pane, provide the URI to your video input file that is stored in Amazon S3 or on an HTTP(S) server.
- Click on Add to add Output groups just below the Input section at left.
- Select Apple HLS option. H.264, AAC will be created under Apple HLS Output group
- Select this H.264, AAC output, and then in Output settings pane click on Remove output button.
- Specify the group name in the Custom group name field.
- Specify the location of the output in the Destination field. After setting the destination path, append the name with it. In my case, the video name will be “my-video-name”.
9. Now go to the Outputs pane and add 5 outputs. I am creating 5 different resolutions of video. You can add or remove depending on your requirements. After creating 5 outputs give them name like 144p, 360p, 480p, 720p (HD), 1080p (FHD).
10. Now it’s the time to define resolution of each output. From Output groups settings select first output which is 144p and set Resolution (w x h) for video to 256 and 144, Bitrate (bits/s) to 90000 and Audio Bitrate (kbit/s) to 96.0. Perform these steps for all 5 output. I use following resolution and bitrate for my videos. You can use the same or change it depending on your requirements:
|Name||Resolution||Video Bitrate||Audio Bitrate|
11. Now click on Create button.