From 8bbaf6d8bf67fe057a9d3d276c12408d46c8a70a Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Thu, 9 Jul 2020 14:28:17 +0800 Subject: [PATCH] 'commit' --- dsSupport/Shell/install_ffmpeg.sh | 33 ++++++++++++++++++++----------- dsSupport/编译Linux版本.cmd | 1 + 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/dsSupport/Shell/install_ffmpeg.sh b/dsSupport/Shell/install_ffmpeg.sh index 8f3204f2..722b4a53 100644 --- a/dsSupport/Shell/install_ffmpeg.sh +++ b/dsSupport/Shell/install_ffmpeg.sh @@ -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 diff --git a/dsSupport/编译Linux版本.cmd b/dsSupport/编译Linux版本.cmd index 29b9d64e..d5cf3324 100644 --- a/dsSupport/编译Linux版本.cmd +++ b/dsSupport/编译Linux版本.cmd @@ -2,3 +2,4 @@ SET GOOS=linux SET GOARCH=amd64 go build -o ./build/dsSupport main.go +go build -o ./build/Convert ./ConvertMovie/Convert.go \ No newline at end of file