|
|
|
@ -1,15 +1,11 @@
|
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
yum install gcc bzip2 -y
|
|
|
|
|
|
|
|
|
|
cd /usr/local
|
|
|
|
|
mkdir software
|
|
|
|
|
cd software
|
|
|
|
|
|
|
|
|
|
#wget http://www.ffmpeg.org/releases/ffmpeg-4.3.tar.xz
|
|
|
|
|
wget https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/ffmpeg/ffmpeg-4.3.tar.xz
|
|
|
|
|
tar xvJf ffmpeg-4.3.tar.xz
|
|
|
|
|
|
|
|
|
|
yum install gcc -y
|
|
|
|
|
|
|
|
|
|
# wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
|
|
|
|
|
wget https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/ffmpeg/yasm-1.3.0.tar.gz
|
|
|
|
|
tar zxvf yasm-1.3.0.tar.gz
|
|
|
|
@ -17,15 +13,30 @@ cd yasm-1.3.0
|
|
|
|
|
./configure
|
|
|
|
|
make && make install
|
|
|
|
|
|
|
|
|
|
cd ffmpeg-4.3
|
|
|
|
|
./configure --enable-shared --prefix=/usr/local/ffmpeg
|
|
|
|
|
make && make install
|
|
|
|
|
# https://www.videolan.org/developers/x264.html
|
|
|
|
|
# 编译H264库
|
|
|
|
|
cd /usr/local/software
|
|
|
|
|
wget https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/ffmpeg/x264-master.tar.bz2
|
|
|
|
|
|
|
|
|
|
tar -xjf x264-master.tar.bz2
|
|
|
|
|
cd x264-master/
|
|
|
|
|
./configure --prefix=/usr/local/x264 --enable-shared --enable-static --disable-asm
|
|
|
|
|
make
|
|
|
|
|
make install
|
|
|
|
|
|
|
|
|
|
# 编译 ffmpeg
|
|
|
|
|
#wget http://www.ffmpeg.org/releases/ffmpeg-4.3.tar.xz
|
|
|
|
|
wget https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/ffmpeg/ffmpeg-4.3.tar.xz
|
|
|
|
|
tar xvJf ffmpeg-4.3.tar.xz
|
|
|
|
|
|
|
|
|
|
cd /usr/local/software/ffmpeg-4.3
|
|
|
|
|
./configure --prefix=/usr/local/ffmpeg --enable-shared --enable-yasm --enable-libx264 --enable-gpl --enable-pthreads --extra-cflags=-I/usr/local/x264/include --extra-ldflags=-L/usr/local/x264/lib
|
|
|
|
|
make -j4 && make install
|
|
|
|
|
|
|
|
|
|
#配置环境变量
|
|
|
|
|
echo "include ld.so.conf.d/*.conf" >> /etc/ld.so.conf
|
|
|
|
|
echo "/usr/local/ffmpeg/lib/" >> /etc/ld.so.conf
|
|
|
|
|
ldconfig
|
|
|
|
|
|
|
|
|
|
#配置环境变量
|
|
|
|
|
echo "PATH=$PATH:/usr/local/ffmpeg/bin" >> /etc/profile
|
|
|
|
|
echo "export PATH" >> /etc/profile
|
|
|
|
|
source /etc/profile
|
|
|
|
|