使用shell快速安装视频转码器

#!/bin/bash
#1、保证系统可以连到外网,需要下载安装包和依赖包
#2、依赖gcc编译器
#3、测试命令:ffmpeg -i test.avi out.mp4
set -e

ffmDir="/usr/myapp"

ffmVer="ffmpeg-3.4.1"
yasmVer="yasm-1.3.0"

mkdir $ffmDir -pv 
yum install wget gcc -y
cd /usr/local/src
wget http://ffmpeg.org/releases/ffmpeg-3.4.1.tar.bz2
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar xf ffmpeg-3.4.1.tar.bz2 
tar xf yasm-1.3.0.tar.gz 
cd $yasmVer
./configure && make && make install

cd ../$ffmVer
./configure --enable-shared --prefix=$ffmDir/ffmpeg && make && make install

echo "$ffmDir/ffmpeg/lib" > /etc/ld.so.conf.d/ffmpeg.conf
ldconfig

cd $ffmDir/ffmpeg/bin && ls
echo -e "\033[31m Usage:\n\t./ffmpeg -i test.avi out.mp4 \033[0m"