VOD Encoding
In this blog, we will understand the workflow to transcode raw video file so that it can be streamed on any device including mobile, browser & smart-tv. Here, we will achieve Adaptive Bitrate behaviour as well.
MediaConvert is a file-based video transcoding service which allows you to easily create Video-on-Demand (VOD) content for the broadcast.
Setting up IAM permissions:
First, we need to create an IAM role to access mediaConvert service. To do this, please follow the below listed steps:
- To create a new role, go to “IAM” service and select “roles” from the left navigation panel, and then select “create role” option.
- Select the role type as “AWS service” and choose “MediaConvert” service. Scroll down on the same page and choose “Next: Permissions” from the bottom right section of the page.
- On that role, the default permissions will be assigned automatically. Choose “next:tags”, provide tag if you want, that will be useful at the later stage for the cost measurement. Choose “Next: Review” option to proceed further.
- Provide a unique roleName which you can easily find while creating a job. And, then choose “create role”.
Setup S3 bucket:
- Go to “S3” from the services tab and create a new s3 bucket or choose an existing one from the bucket list. Click on the “properties” tab and then select the “default encryption” option.
- Choose “AES-256” and click on the save button.
- Go to bucket and select the upload option. In the upload dialog box, choose “add files” option and upload the media file that you want to transcode.
Create and run job:
- Go to “mediaconvert” service. Select “job templates” from the left navigation panel. Choose “system templates” from the dropdown and open any template which you want to clone.
- Click on the duplicate option. Provide a job name under the general information section and choose “create” option. A template will be created in your job templates list.
- Open that duplicate template and select “create job” from the upper menu tab. It will create a job from that template.
- To provide input file choose “Add” from the right side menu & browse source file that you have stored in the S3 bucket initially and click on the create option.
- To verify input and output profiles, go to the jobs section from the left navigation panel and select your respective job.
- Now, it’s time to check the final output of your job. There will be a link generated in the output section under the same page.
- Clicking on it will redirect you to the destination s3 bucket location. Choose any of the output URL, and you will find the object URL at the end of that page.
- Play that URL using any media player. If the URL is giving you a json/html output, then you may need to make it public. You can find “Make Public” option at the top of the same page or you may need to make your s3 bucket public.
I have used MediaConvert to transcode the mp4 file, which is useful for VOD transcoding. For Live video transcoding, use AWS elemental mediaLive and mediaPackages services.