Smooth Streaming Module for Nginx
Dependencies
For more information on downloading and installing Nginx, please read the official getting started instructions.
We will be using version 0.7.9 of Nginx.
cd ~ wget http://www.nginx.eu/download/sources/nginx-0.7.9.tar.gz tar zxvf nginx-0.7.9.tar.gz
The module also depends on Expat for parsing the XML manifest files:
sudo apt-get install libexpat1-dev
Download
Download the source of the Smooth Streaming Module for Nginx.
cd ~ wget http://smoothstreaming.code-shop.com/download/nginx_mod_smooth_streaming-1.0.8.tar.gz tar -zxvf nginx_mod_smooth_streaming-1.0.8.tar.gz
Download the source of the command line utility 'mp4split'. This tool converts MP4 files to Fragmented MP4 and also creates the necessary manifest files.
wget http://smoothstreaming.code-shop.com/download/mp4split-1.0.8.tar.gz tar -zxvf mp4split-1.0.8.tar.gz
Build
Run configure in the Nginx directory with the following additions to the commandline.
cd ~/nginx-0.7.9 ./configure --add-module=$HOME/nginx_mod_smooth_streaming-1.0.8 --sbin-path=/usr/local/sbin --with-debug
Make and install Nginx.
make sudo make install
Make and install the command line utilities.
cd ~/mp4split-1.0.8 ./configure --with-expat make sudo make install
Configuration
Edit the configuration file (in /usr/local/nginx/conf/nginx.conf) so that file requests ending in '.ism' are handled by the 'ism' command. Add the following lines in your 'server { ... }' section:
rewrite ^(.*/)?(.*)\.([is])sm/[Mm]anifest$ $1$2.$3sm/$2.ismc last;
rewrite ^(.*/)?(.*)\.([is])sm/QualityLevels\(([0-9]+)\)/Fragments\((.*)=([0-9]+)\)(.*)$ $1$2.$3sm/$2.ism?bitrate=$4&$5=$6 last;
location ~ \.ism$ {
ism;
}
After restarting your web server, you can continue with verifying your setup.
License
This version is free if you agree to the noncommercial license. Please mention its use on your website, in the lines of 'This website uses video streaming technology by CodeShop'.
Our commercial license is very inexpensive, see the following page to check if you need a commercial license.
Feedback
If you have any questions, thoughts or ideas on Smooth Streaming you can leave a message on our forum.
