Smooth Streaming Module for Nginx
2015-08-05 13:01
696 查看
Dependencies
For more information on downloading and installing Nginx, please read the official gettingstarted 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
Download
Download the source of the H264 Streaming Module for Nginx.cd ~ wget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.0.tar.gz tar -zxvf nginx_mod_h264_streaming-2.2.0.tar.gz
If you plan to play Multi Bit Rate H.264 encoded videos, you will also need the command line tool 'mp4split' to create the Smooth Streaming manifest files.
wget http://h264.code-shop.com/download/mp4split-2.2.0.tar.gz tar -zxvf mp4split-2.2.0.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_h264_streaming --sbin-path=/usr/local/sbin --with-debug
Make and install Nginx.
make sudo make install
cd ~/mp4split-2.2.0
./configure
make sudo make install
Configuration
Edit the configuration file (in /usr/local/nginx/conf/nginx.conf) so that file requests ending in '.mp4' and '.ismv' are handled by the 'mp4' command. Add the following lines in your 'server { ... }' section:if ($is_args = "?") { rewrite ^(.*)\.ism/manifest$ $1.mp4?manifest=1 last; } rewrite ^(.*)\.ism/Fragments\((.*)=([0-9]+)\)(.*)$ $1.mp4?$2=$3 last; rewrite ^(.*)/(.*)\.ism/QualityLevels\(([0-9]+)\)/Fragments\((.*)=([0-9]+)\)(.*)$ $1/$2.ism/$2_$3.ismv?$4=$5 last; rewrite ^(.*)\.ism/QualityLevels\(([0-9]+)\)/Fragments\((.*)=([0-9]+)\)(.*)$ $1.ism/$1_$2.ismv?$3=$4 last; location ~ \.mp4$ { mp4; } location ~ \.ismv$ { mp4; }
License
This version is free if you agree to the noncommerciallicense. Please mention its use on your website, in the lines of 'This website uses H264 pseudo video streaming technology byCodeShop'.
Our commercial license is very inexpensive, see the following page to check if you need a commercial
license.
Next
Encoding SmoothStreaming videos.
Playing Smooth
Streaming videos.
Feedback
If you have any questions, thoughts or ideas on Smooth Streaming you can leave a message on our forum.
相关文章推荐
- Nginx基础学习
- 在Nginx服务器中启用SSL的配置方法
- 详解Nginx服务器中的nginx.conf配置文件
- 在阿里云服务器(ECS)上从零开始搭建nginx服务器 推荐
- Nginx配置性能优化
- Apache与Nginx优缺点比较
- uwsgi部署到nginx出现invalid request block size: 4161 (max 4096)...skip问题
- 在Linux和Windows系统上安装Nginx服务器的教程
- nginx源码编辑带第三方模块lua
- Nginx的启动、停止、平滑启动、平滑升级
- linux环境安装Nginx
- tornado + supervisor + nginx 的一点记录
- Apache与Nginx的优缺点比较
- Nginx+fastcgi 部署Django项目
- Django+uwsgi+nginx配置详解
- Nginx Location配置总结及基础最佳实践
- nginx禁止访问某个后缀名的文件
- nginx源码分析1———进程间的通信机制五(文件锁)
- 在阿里云服务器(ECS)上从零开始搭建nginx服务器
- Nginx 笔记与总结(7)Location:正则匹配