丹调生活 发表于 2018-11-11 10:11:47

nginx安装,ffmpeg安装

  1、安装相关组件
  yum install yasm git
  2、安装ffmpeg及其依赖包:
  ++++++++Yasm+++++++++++
  #wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
  #tar xzvf yasm-1.2.0.tar.gz
  #cd yasm-1.2.0
  #./configure
  #make
  #make install
  #cd ..
  ++++++++x264+++++++++++
  #git clone git://git.videolan.org/x264
  #cd x264
  #./configure --enable-shared
  #make
  #make install
  #cd ..
  ++++++++LAME+++++++++++
  #wget http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz
  #tar xzvf lame-3.99.5.tar.gz
  #cd lame-3.99.5
  #./configure --enable-nasm
  #make
  #make install
  #cd ..
  ++++++++libogg+++++++++++
  #wget http://downloads.xiph.org/releases/ogg/libogg-1.3.0.tar.gz
  #tar xzvf libogg-1.3.0.tar.gz
  #cd libogg-1.3.0
  #./configure
  #make
  #make install
  #cd ..
  ++++++++libvorbis+++++++++++
  #wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.3.tar.gz
  #tar xzvf libvorbis-1.3.3.tar.gz
  #cd libvorbis-1.3.3
  #./configure
  #make
  #make install
  #cd ..
  ++++++++libvpx+++++++++++
  #git clone http://git.chromium.org/webm/libvpx.git
  #cd libvpx
  #./configure--enable-shared
  #make
  #make install
  #cd ..
  ++++++++FAAD2+++++++++++
  #wget http://downloads.sourceforge.net/project/faac/faad2-src/faad2-2.7/faad2-2.7.tar.gz
  #tar zxvf faad2-2.7.tar.gz
  #cd faad2-2.7
  #./configure
  #make
  #make install
  #cd ..
  ++++++++FAAC+++++++++++
  #wget http://downloads.sourceforge.net/project/faac/faac-src/faac-1.28/faac-1.28.tar.gz
  #tar zxvf faac-1.28.tar.gz
  #cd faac-1.28
  #./configure
  #make
  #make install
  #cd ..
  ++++++++Xvid+++++++++++
  #wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
  #tar zxvf xvidcore-1.3.2.tar.gz
  #cd xvidcore/build/generic
  #./configure
  #make
  #make install
  cd ..
  #git clone git://source.ffmpeg.org/ffmpeg
  #cd ffmpeg
  #./configure--prefix=/opt/ffmpeg/ --enable-version3--enable-libvpx --enable-libfaac --enable-libmp3lame--enable-libvorbis --enable-libx264 --enable-libxvid --enable-shared --enable-gpl --enable-postproc --enable-nonfree--enable-avfilter --enable-pthreads
  #make && make install
  #cd ..
  3、修改/etc/ld.so.conf如下:
  include ld.so.conf.d/*.conf
  /lib
  /lib64
  /usr/lib
  /usr/lib64
  /usr/local/lib
  /usr/local/lib64
  /opt/ffmpeg/lib
  #ldconfig
  4、安装Nginx相关模块
  安装pcre、zlib、openssl
  tar zxvf nginx_mod_h264_streaming-2.2.7.tar.gz
  vi nginx_mod_h264_streaming-2.2.7/src/ngx_http_streaming_module.c删除以下内容
  /* TODO: Win32 */
  if (r->zero_in_uri)
  {
  return NGX_DECLINED;
  }
  #tar zxvf nginx-1.4.7.tar.gz
  #cd nginx-1.4.7
  #./configure --prefix=/usr/local/nginx --error-log-path=/usr/local/nginx/logs/error.log --with-pcre=../pcre-8.36 --with-zlib=../zlib-1.2.8 --with-http_dav_module --with-http_flv_module --with-http_stub_status_module --without-http_scgi_module --without-http_uwsgi_module --without-http_gzip_module --without-http_ssi_module --without-http_proxy_module --without-http_memcached_module --without-http_empty_gif_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_ssl_module --with-openssl=../openssl-1.0.1e --add-module=../nginx-rtmp-module-master --add-module=../nginx_mod_h264_streaming-2.2.7
  make&make install
  5、设置nginx开机启动
  vi /etc/rc.local添加以下内容
  /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

  /usr/nginx/sbin/nginx -s>  6、防火墙开放80端口
  /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
  /sbin/iptables -I INPUT -p udp --dport 80 -j ACCEPT
  /etc/rc.d/init.d/iptables save

页: [1]
查看完整版本: nginx安装,ffmpeg安装