Friday, April 25, 2014

Streaming with nginx & rtmp module

on CentOS 6

vi /etc/yum.repos.d/nginx.repo
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

yum --enablerepo=remi  install php-pecl-apc php-cli php-pear php-pdo php-mysqlnd php-pgsql php-pecl-mongo php-sqlite php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-xml php-fpm php-common nginx  -y

yum -y install gcc gcc-c++ make zlib-devel pcre-devel openssl-devel libxml2-devel libxslt-devel git

mkdir nginx-build
cd nginx-build/
wget http://nginx.org/download/nginx-1.5.13.tar.gz
tar zxvf nginx-1.5.13.tar.gz 
git clone https://github.com/arut/nginx-rtmp-module.git

cd nginx-1.5.13

./configure --user=nginx --group=nginx --add-module=../nginx-rtmp-module/ --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --with-http_ssl_module -–with-http_xslt_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6

make
make install

chkconfig --add nginx
chkconfig --level 345 nginx on
rpm -Uvh http://dl.atrpms.net/all/atrpms-repo-6-7.el6.x86_64.rpm
yum install ffmpeg
wget -O /etc/init.d/nginx http://pastebin.com/raw.php?i=XhNPr6Y7
vi /etc/init.d/nginx 
chmod +x /etc/init.d/nginx 
cd /etc/nginx/
vi rtmp.conf

vi nginx.conf
vi vhls.conf
service nginx restart

on SmartOS - Solaris 10

pkgin search gcc   

pkgin install gcc47-4.7.3nb2
pkgin search git
pkgin install scmgit-2.0
pkgin search gmake
pkgin install gmake-4.0

wget http://nginx.org/download/nginx-1.6.0.tar.gz

git clone https://github.com/arut/nginx-rtmp-module.git

git clone https://github.com/nbs-system/naxsi.git

./configure --user=www --group=www --with-ld-opt='-L/opt/local/lib -Wl,-R/opt/local/lib' --prefix=/opt/local --sbin-path=/opt/local/sbin --conf-path=/opt/local/etc/nginx/nginx.conf --pid-path=/var/db/nginx/nginx.pid --lock-path=/var/db/nginx/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/db/nginx/client_body_temp --http-proxy-temp-path=/var/db/nginx/proxy_temp --http-fastcgi-temp-path=/var/db/nginx/fstcgi_temp --add-module=../naxsi/naxsi_src --add-module=../nginx-rtmp-module --with-mail_ssl_module --with-http_ssl_module --with-pcre-jit --with-http_dav_module --with-http_realip_module --with-ipv6 --with-http_stub_status_module --with-http_flv_module --with-http_mp4_module --with-http_secure_link_module --with-http_gzip_static_module

gmake install

No comments:

Post a Comment