Serverless Video Transcoder
Tags: serverless, tutorial, aws, cloud
Published: 2022-08-17 06:51:00

  | AWS(Amazon Web Service)

Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 200 fully featured services from data centers globally. In computing, a client can be a web browser or desktop application that a person interacts with to make requests to computer servers. A server can be services such as Amazon Elastic Compute Cloud (Amazon EC2), a type of virtual server.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ayah4guufiutd6nwh9ty.png) 

client- server model
For example, suppose that a client makes a request for a news article, the score in an online game, or a funny video. The server evaluates the details of this request and fulfills it by returning the information to the client.

| Benefit of Amazon Web Service (AWS):
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/28njhkk05o15bp5eipoi.png) 

                       Benefit of AWS
| Service used in AWS
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wzmcc6jl1thn9bqrqvxu.png)
                        AWS Services


| Overview

Video Stream is server less video sharing web application which is being developed using node.js and some specific cloud services of amazon web services(AWS). Scenario like any youtuber upload his video and all subscribers can watch the videos in different qualities.

| Hardware Requirement:

Hardware that is essential in our system is:

A. Laptop/Computer B. Minimum 4 GB RAM

| Software Requirement:

Software that is essential in our system is:

A. Node JS B. NPM Library C. Visual Studio D. Browser E. Windows / Linux Operating system F. AWS Account G. Auth0 API

| Implementation:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lg345kigsjxbfjmmp4c6.png)
                       Figure A:Home Page
Figure A This is our website and and here’s the first page without sign in or login .As you can see on the screen there is a four default video we have added to the firebase for the sample purpose.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w7ifzcpa3qzybmc6r9hb.png)
 
                    Figure B: Firebase Console
Figure B show this is firebase console. Where each video get it’s unique token id. Here the transcoding false is like boolean variable whenever the transcoding is in process it is set to the true and when it is transcoded it is set to the false and shown to the website.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r8ykn5baa8r5h7wks2wh.png)
                      Figure C: Login- Signup
Figure C show this is the login signup part for that we have used the third party Auth0 API. First of all user can login application via email and password. If user is newer then press “sign up” text and you will first create account via email id and password. Another feature like user can directly sign in using google id. So that no need to enter email and password.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a48iv1vj12gaczfuthrb.png)
                  Figure D: Profile Information
Figure D Shows the Raw Information of user which is fetched from the Auth0 API using the AWS Lambda Service. Which Provides the information like given_name, email ,Updated time, Nickname, Profile picture, email verified, locales etc.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ybhrb03v4huwuuxz59sb.png)
            Figure E: Animation while Transcoding video
In center of the page there is one plus button. Using that user can upload the video from local machine to s3 bucket. Whenever the video is transcoding in the background through the pipeline it will shown the animation on the webpage.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u784inoa3yi9znpqvtbz.png)
                     Figure F: Website
After completion of the Transcoding video will go to the destination bucket. From destination bucket we have fetched the video to the webpage using scripts.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ii4coxdqucbpwyw2iuv5.png)
                     Figure G: S3 bucket
Figure G shows the different quality Transcoded video which is uploaded by the user from local machine. From this user can get three different quality video like 480P,720p,720p (Web Friendly),1080p.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o618wda2u9rw40t2wi8t.png)
                 Figure H: Transcoded video
In S3 bucket there is a separate link of each quality video from that link we can play the video in any of the browser.

|Flow Diagram:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ib3lznh64akzg7hbrdtv.png)
                          Flow Diagram


| Conclusion

These is amazing project because of it is server less project. In this project we have used some services of Amazon Web Services such as AWS Lambda, AWS Simple Storage Service, AWS API Gateway, AWS Multimedia Service (AWS Transcoder) and learn lots of special services provided by Amazon. From this project we could understand how server less system works and benefits of server less computing. During this project we learn lots of new things about sever less and AWS services

| Github Link:

https://github.com/KrushiVasani/Video-Transcode