- All-AWS setup
- Stream directly from S3
- Scripts to manually transcode your video library to ABR - for Windows and Mac/Linux
- Ultra-light Nginx-based on-the-fly HLS packager (https://github.com/kaltura/nginx-vod-module)
- Lightning fast, 4 levels of caching
- CDN delivery
- Works with any HLS-capable player
- install
ffmpeg
on your designated transcoder computer - clone this repository on your transcoder computer
- copy your video files in the
transcode/originals/
folder - execute
transcode/transcode_all.sh
(Mac/Linux) ortranscode/transcode_all.cmd
(Windows) - wait for transcoding to complete; expect this to take 10-12 minutes(1) for every minute of content
- you will find your transcoded files and ABR manifests in the
transcode/transcoded
folder; upload all files to an S3 bucket of your choice
(1)wait time can be reduced at the expense of quality by changing the preset (i.e. from 'slower' to 'slow', 'medium', 'fast', 'faster' etc); GPU accelerated transcoding is also possible
- launch a (nano or micro) ubuntu EC2 instance
- connect to your instance via SSH
- compile and install
Nginx
with required modules as following:
git clone https://github.com/kaltura/nginx-vod-module
git clone https://github.com/Nextdoor/ngx_aws_auth
sudo apt-get install build-essential libpcre3 libpcre3-dev libssl-dev zlib1g-dev
wget http://nginx.org/download/nginx-1.15.9.tar.gz
tar -xf nginx-1.15.9.tar.gz
cd nginx-1.15.9/
./configure --with-http_ssl_module --add-module=../nginx-vod-module --add-module=../ngx_aws_auth
sudo make install
- replace
/usr/local/nginx/conf/nginx.conf
with the providednginx/nginx.conf
- in your newly replaced
/usr/local/nginx/conf/nginx.conf
, change 'your_bucket_name' with the actual name of the S3 bucket holding your content (lines 53 and 56) - in your newly replaced
/usr/local/nginx/conf/nginx.conf
, change 'your_access_key' and 'your_secret_key' with the access and secret keys of an AWS user with access to the S3 bucket; alternatively, remove lines 54-58 if your bucket is public - start your nginx server
sudo /usr/local/nginx/sbin/nginx
Create a Web
type CloudFront distribution with the following features:
- Origin Domain Name: the
Public DNS (IPv4)
of the EC2 instance you just set up - Origin Protocol Policy:
HTTP Only
- Allowed HTTP Methods:
GET, HEAD, OPTIONS
(leave all other settings to default)
Use the following format to compose your HLS link:
http(s)://{CloudFront_distribution_id}.cloudfront.net/{video_filename_without_extension}/master.m3u8
e.g. if your CloudFront distribution is 'd32wx2nxsaxxxx' and your (original) video file is 'sample.mkv', your URL would be
https://d32wx2nxsaxxxx.cloudfront.net/sample/master.m3u8
Both Clappr and Video.js are free and have long had good support for HLS.
Alternatively, HLS.js is a library that can be used to create or extend your own player, with advanced usage scenarios. Also free.