Filename | Purpose New/ Modified | Comments |
---|---|---|
nginx-install.sh | Contains the bash script for installing nginx on a server while provisioning | |
transcode.sh | Contains the bash script converting any video file into MPEG-dash format | |
index.py | Contains the python code which runs the client server | |
index/index.html | Contains the HTML code which sets the UI structure for client application | |
index/upload.html | Contains the HTML code which sets the UI structure for upload page | |
index/scripts/main.js | Contains the javascript code that helps the UI of client application | |
config-files/nginx-control-server.conf | Contains nginx configuration details for the control-server | |
config-files/nginx-vm.conf | Contains nginx configuration details for VMs that store and stream videos (workers) | |
config-files/geo.conf | Contains IP address to geo-location mapping configuration for nginx server | |
sample-videos | Contains videos in MPEG-dash format for testing nginx setup |
Server Configuration uses NGINX RTMP Module
- Python Bottle as the server
- Dash.js as the video player
- Install nginx with nginx-rtmp and ffmpeg using
sh nginx-install.sh
- Copy the nginx configuration to /usr/local/nginx/conf
- Copy the contents of sample-videos to the folder - /usr/local/nginx/Videos/vod
- Copy transcode script transcode.sh to /usr/local/nginx/Videos/vod
- Install python bottle by
pip install bottle
- Run
python index.py
To Install MP4Box https://gpac.wp.mines-telecom.fr/2015/07/29/gpac-build-mp4box-only-all-platforms/
Steps:
sudo apt-get install x264
sudo apt-get install gpac
sudo apt-get install ffmpeg
Nginx-GeoIp module:
sudo add-apt-repository ppa:maxmind/ppa
sudo apt-get update
sudo apt-get install libmaxminddb0 libmaxminddb-dev mmdb-bin
go to video_streaming_server/nginx/
git clone https://github.com/leev/ngx_http_geoip2_module.git
TAKE BACKUP OF NGINX CONF
cd nginx-1.8.1/
sudo apt-get install libgeoip-dev
./configure --with-http_ssl_module --with-http_stub_status_module --with-http_geoip_module --add-module=../nginx-rtmp-module-master
sudo make
sudo make install
replace NGINX.conf with the backup
wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
gzip -d GeoLite2-City.mmdb.gz
gzip -d GeoLite2-Country.mmdb.gz
One method is to use the unzipped files.
Make config changes as mentioned here - https://gist.github.com/kmjones1979/fcabb4731bbf85b9c50189e90d76b1c1
Another method: wget https://raw.githubusercontent.com/phusion/nginx/master/contrib/geo2nginx.pl chmod 755 geo2nginx.pl wget http://geolite.maxmind.com/download/geoip/database/GeoIPCountryCSV.zip unzip GeoIPCountryCSV.zip ./geo2nginx.pl < GeoIPCountryWhois.csv > geo.conf mv geo.conf /usr/local/nginx/conf
Replace the nginx.conf with the nginx-geoip.conf from github restart nginx