• A Step By Step Guide On Adaptive Video Streaming With Amazon Elastic Transcoder

    Adaptive-Streaming

    Video is now recognized as one of the fastest channels to disseminate information, especially, when the number of receivers has to be high.

    Now that videos are a potential choice for communication, especially, for enterprises, it is inevitable for them to also focus on the delivery method of the video stream across multimedia devices.

    This is where adaptive streaming can help you deliver a seamless experience across devices and keep the users engaged. And, through this guide we will help you implement it on your video platform.

    Before you jump on to the step-wise tutorial, first understand why adaptive streaming is important for you.

    Importance of Adaptive Streaming In Video Sharing

    The delivery method or the video stream is much likely to impact the resolution of the video and can make or mar the overall experience of the user. A user who finds the video stream slow or with poor resolution will reject the video within initial few seconds. Also, no user would want to wait for a whole 15 minutes for the video to download to view a 15-minute video. The users are impatient and flooded with a variety of videos to watch over the web.

    How your video(s) will qualify in the race among those millions of videos your user would come across and go on to create the impact your content has been designed to deliver, is dependent on the streaming of the video.

    But the major problem with video is its format; every format is not compatible to every platform like mobile, web (at multiple web browsers). So, there you are. You need to generate a common format which is compatible to all platforms and you can achieve this with adaptive streaming.

    A stream can handle all the above-mentioned complexities. This makes browsing convenient for the mobile video user and he doesn’t have to make efforts to download the video.

    Adaptive Streaming with AWS Elastic Transcoder

    There are two ways you can do this – Write a code to convert video from one format to specific format or Use third party web service (like AWS Elastic Transcoder) to achieve current requirement.

    Second option seems promising and user-friendly. While implementing the Second approach, we dig for an efficient approach, so here we share the findings.

    Amazon Elastic Transcoder is media transcoder in the cloud. It a highly scalable, handy and cost effective tool. It enables businesses to convert (or “transcode”) media files from their source format into versions that will playback on devices like smartphones, tablets and PCs.

    By using the Cloud SaaS services, we detach the video format conversion functionality from the main server to the third party to reduce the server overhead.

    The limitations of the traditional approach have been overcome by SaaS (software as a service)

    Streaming

    How To Generate Video In Specific Format Using Saas

    SaaS (Software as a services) for video transcoding is provided by various vendors like Amazon (i.e. Elastic Transcoder), Brightcove (i.e. Zencoder) etc. The common work flow for every type of SaaS is shown in the following figure:

    Adaptive-Streaming2

    As shown in the diagram above, every SaaS for video transcoding has the same work flow, while the approaches and customization of services differ. To understand Video Transcoding work flow practically, let’s have a brief discussion on Amazon Elastic Transcoder service.

    Transcoding Video Using Amazon Elastic Transcoder Service

    Pre-Requisite: To use Amazon web Services we need an account at AWS.
    To transcode a video, we will use two services of Amazon that are listed below and the work flow shown in the image:

    Adaptive-Streaming3

    Step 1: Upload File at S3 (Simple Storage Service)

    This service is used to store and retrieve any type of file at Amazon cloud using different types of requests like POST, PUT or GET, that adhere to security policies. We can trace any type of events places on storage and trigger any other services like lambda, SNS.

    To upload file at S3, you need to click on S3 service as shown in the image below:

    Adaptive-Streaming4.jpg

    Now click on “create bucket” and provide a unique name of bucket shown in the image below i.e. Input-production:

    Adaptive-Streaming5.jpg

    Open a bucket by clicking on name and click on upload button. A popup will appear. Then select file from your system to upload. Using the above step of file uploading, you can upload a video file with any format in a bucket which you want to transcode.

    Step 2: Configure Pipeline and Pre-Sets

    To transcode video, you need to configure two things:

    Pipeline
    Pre-sets

    Pipeline: Pipelines are queues that manage transcoding jobs. When you create a job, you specify the pipeline to which you want to add the job. Elastic Transcoder starts processing the jobs in a pipeline in the same order in which you added them. Here are the steps to create pipeline:

    Now click on Elastic Transcoder Service then click on create pipeline.

    Adaptive-Streaming6.jpg

    Select input bucket from where the video will be fetched for transcoding and select output bucket where the transcoded video will be placed. If you need thumbnails for video, then also select buckets for thumbnail as shown in below image. All bucket could be one.

    Adaptive-Streaming7.jpg

    Then click on create pipeline button. Pipeline will be created.

    Pre-Set: The pre-set defines the audio, video, and thumbnail settings of video that Elastic Transcoder uses for transcoding. Basically, it is used to convert video in specific format, which is required to play video across platforms. Amazon provides many predefine pre-sets and you we can also create a new one as per your requirement.

    Learn more on how to create a pre-set here.

    Step 3: Begin Transcoding The Video

    After configuring the pipeline and pre-sets finally create job to transcode video. Here are the steps to create job.

    Click on “Create new job button” as shown in below image:

    Adaptive-Streaming8.jpg

    Select created pipeline from drop down and enter output key prefix (where to save transcoded video in bucket)

    Adaptive-Streaming11.jpg

    Enter the input video name which uploaded in bucket, select pre-set in the format you want to transcode, provide the segment duration (segment duration is used for HLS video, it divides in video in chunks of seconds), then give name to output video as shown in below image:

    Adaptive-Streaming9.jpg

    Click on Create Job. In few seconds (mainly depends on video length) video will be transcoded in specified format at specified path. As shown in below image video is transcoded in .m3u8 format because we selected pre-set for HLS format as output. By right clicking on video output file we can get URL of video and access transcoded video from anywhere if file is public.

    Adaptive-Streaming10.jpg

    That’s it. You can use the above-highlighted URL anywhere in your Video-Player as a source with Adaptive bit rate.

    You can use the above-highlighted URL anywhere in your Video-Player as a source with Adaptive bit rate.

    The above images have been sourced from Amazon’s website.

    Conclusion

    The wide variation in the multimedia devices poses a big challenge on the video providers to deliver a seamless experience. Video stream needs to adapt to vivid formats to keep the user engaged.

    As a video provider, it is inevitable for you to embrace adaptive streaming. Also, you are likely to go confused when choosing the right set of tools to implement it on your video stream. You must consider factors like server overhead and scalability and choose your tools, accordingly and choose your steps considerately.

    To leverage adaptive streaming for delivering a seamless experience across platforms, you need to get the execution right. Selecting the right tool is just one step in the direction. The importance lies in the step by step implementation.

    If you are looking for any help on building any digital solution for better customer or employee engagement, this an area where we can help. Please contact us at info@netsolutions.com.

    Manish Garg

    About the Author

    Manish Garg is a Senior Technical Project Manager at Net Solutions. He handles project deliveries pertaining to Java and has an active involvement in the pre-sales functions. He has a rich experience in product development and maintenance. In his free time, he loves reading books. Also, he is a nemophilist looking for new places to explore during vacations.

    Comments

     
     

    Guilherme

    8:10 PM, Jun 13, 2018

    Hi Manish, thank you so much for the tuto! I have a question. This file is downloadable. It's a problem for the protection of my video? Someone can use the .m3u8 file to watch the video? If yes, what can I do to prevent that?
    Thanks!



    get in touch

    Ready to discuss your requirements?

    Request Free Consultation