nginx搭建flv、mp4流媒體服務器 nginx升級

一。前期準備,安裝zlib pcre mp4模塊

 #安裝zlib

 tar xzvf zlib-1.2.3.tar.gz

  cd zlib-1.2.3

 ./configure

  make && makeinstall

#安裝pcre

  tar zxvf pcre-7.9.tar.gz

  cd pcre-7.9

 ./configure--prefix=/usr/local/pcre

  make && makeinstall

#添加mp4支持模塊

    wget http://h264.code-shop.com/download/nginx_mod_h264_streaming-2.2.7.tar.gz

    tar -zxvf nginx_mod_h264_streaming-2.2.7.tar.gz

二。修改mp4模塊,要不make報錯

    /usr/local/src/nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c  158-161行

三。編譯nginx

./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-zlib=../zlib-1.2.7  --add-module=../nginx_mod_h264_streaming-2.2.7 --with-http_flv_module
make

四。替換老版本nginx

    mv /usr/local/nginx/sbin/nginx nginx.old

    cp /usr/local/src/nginx-1.0.0/objs/nginx /usr/local/nginx/sbin/

五。查看nginx頒佈

    /usr/local/nginx/sbin -v  

   /usr/local/nginx/sbin -V

六。安裝yamdi 支持拖拽

   #下載yadmi

   wget http://sourceforge.net/projects/yamdi/files/yamdi/1.4/yamdi-1.4.tar.gz/download

   tar xzvf yamdi-1.4.tar.gz

   cd yamdi-1.4

   make && make install

   使用方法:yamdi -i input.flv -o out.flv

七。測試播放

    把xxx.flv xxx_out.flv player.swf上傳到網站跟目錄

    http://10.229.12.66/player.swf?type=http&file=test.flv

    http://10.229.12.66/player.swf?type=http&file=test_out.flv
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章