ffmepg-nginx-nginx-rtmp-module配置脚本

把上个月写的的配置脚本贴一下:

#!/bin/bash
#version:2016-10-27
#create by itn
#dis: this is used to auto install ffmpeg+nginx+nginx-rtmp-module.
#ffmpeg inatall
echo "###############Now we start to install ffmpeg!###############"
cd /usr/local
wget http://ffmpeg.org/releases/ffmpeg-3.1.4.tar.bz2
tar -jxvf ffmpeg-3.1.4.tar.bz2
cd /usr/local/ffmpeg-3.1.4
yum -y install yasm
./configure --enable-shared --prefix=/usr/local/ffmpeg
make && make install
cd /etc/ld.so.conf.d
touch ffmpeg.conf
echo "/usr/local/ffmpeg/lib" > ffmpeg.conf
ldconfig
ln -s /usr/local/ffmpeg/bin/ffmpeg /usr/local/bin/
ln -s /usr/local/ffmpeg/bin/ffprobe /usr/local/bin/
ln -s /usr/local/ffmpeg/bin/ffserver /usr/local/bin/
echo "###############ffmpeg intsallment finished!###############"
#nginx install
#update gcc 
yum -y install gcc gcc-c++ autoconf automake
#download openssl/zlib/pcre dependent libraries & nginx-rtmp-module &nginx
cd /usr/local
wget https://www.openssl.org/source/openssl-1.0.2j.tar.gz
wget http://nchc.dl.sourceforge.net/project/pcre/pcre/8.32/pcre-8.32.tar.gz
wget http://heanet.dl.sourceforge.net/project/libpng/zlib/1.2.8/zlib-1.2.8.tar.gz
wget https://codeload.github.com/arut/nginx-rtmp-module/zip/master
wget http://nginx.org/download/nginx-1.5.9.tar.gz
tar -xzvf pcre-8.32.tar.gz
tar -xzvf openssl-1.0.2j.tar.gz
tar -xzvf zlib-1.2.8.tar.gz
tar -xzvf nginx-1.5.9.tar.gz
unzip master
#  ngixn configure
cd /usr/local/nginx-1.5.9
./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre-8.32 --with-zlib=/usr/local/zlib-1.2.8 --with-openssl=/usr/local/openssl-1.0.2j --add-module=/usr/local/nginx-rtmp-module-master
make && make install
echo "then you may need some manual operation! please refer to "https://github.com/arut/nginx-rtmp-module#example-nginxconf" "
echo "done"

安装成功后,ffmpeg运行结果会显示如下:

nginx 成功启动后如下:

原文地址:https://www.cnblogs.com/tinmh/p/6047432.html