Delivering video on Demand with CloudFront:
The AWS Content Delivery Network (CDN) can be used with AWS Elemental Media services to implement two different types of video streaming.
As an example, we are using the Option one to setup our on demand video streaming using the Cloudfront distribution. Below is the simple step to configure the settings:
a)Login to AWS console, from the upper left of the your browser navigate into Services and find the CloudFront then click to proceed to the cloudfront page. b)Click the Create Distribution button, under the Select a delivery method for content choose and click the Get Started button.
Two options to deliver video to the end user:
Option one is very easy to implement and supported by just about every mobile devices and desktop. All you need to do is to put the content in an S3 bucket or using a web server where the content stored then create a CloudFront distribution that points to the bucket or web server host. The user’s video player will use CloudFront URLs to request the video file, and will be directed to the best edge location based on the user’s location.
The CDN will serve the video from its cache, fetching it from the S3 bucket or web server host if it is not ready cached. Downside will be if the user doesn’t want to bother watching the entier video, it will be downloaded the whole content and you will pay for it.
Option two will be using MediaConvert to convert your video files into different format or video streaming protocols such as (HLS) Apple’s HTTP Live Streaming, (DASH) Dynamic Adaptive Streaming over HTTP, and (HDS) Adobe’s HTTP Dynamic Streaming, generally fetching content a few seconds ahead of when needed. This is more quickly when starts Playback, more efficient on fast-forwarding, and user experience is smoother.
You will only pay for what the viewer watches, so you don’t waste the user’s bandwidth.
Downside of this option, first you will use MediaConvert and convert the video files to HLS (the most widely supported streaming protocol) also will use S3 as the output destination. This will split the video into short segments and will also create a manifest file. Then point the CloudFront distribution at the manifest.
As an example, we are using the Option one to setup our on demand video streaming using the Cloudfront distribution. Below is the simple step to configure the settings:
a)Login to AWS console, from the upper left of the your browser navigate into Services and find the CloudFront then click to proceed to the cloudfront page.
b)Click the Create Distribution button, under the Select a delivery method for content choose and click the Get Started button.
a.Now, fillup the textbox with the following value below, others are remain as defualt for now.
Origin Domain Name:ipfs01.ipfsblox.com
Origin Path:/ipfs
Origin ID:Custom-ipfs01.ipfsblox.com/ipfs
Minimum Origin SSL Protocol:TLSv1
Origin Protocol Policy:HTTPS Only
Viewer Protocol Policy:Redirect HTTP to HTTPS
Allowed HTTP Methods:GET, HEAD
b.After succesfully created the Distribution, using the CloudFront domain name we can now start to streaming our video that located in our IPFS node using the following URL + hash (media file uploaded to IPFS). Ex. https://dknbau413c9sc.cloudfront.net/QmPz3bquTH691qKT6fcxXtqGedYZZ9TKJRb1iccieG2FCb