From c1f3c3faaf45c3283a78994ad11208bbe8c53756 Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Thu, 9 Jul 2020 13:52:52 +0800 Subject: [PATCH 1/6] 'commit' --- dsSupport/Shell/install_ffmpeg.sh | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 dsSupport/Shell/install_ffmpeg.sh diff --git a/dsSupport/Shell/install_ffmpeg.sh b/dsSupport/Shell/install_ffmpeg.sh new file mode 100644 index 00000000..b3bbf83b --- /dev/null +++ b/dsSupport/Shell/install_ffmpeg.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +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 +cd yasm-1.3.0 +./configure +make && make install + +cd ffmpeg-4.3 +./configure --enable-shared --prefix=/usr/local/ffmpeg +make && make install + +echo "include ld.so.conf.d/*.conf" >> /etc/ld.so.conf +echo "/usr/local/ffmpeg/lib/" >> /etc/ld.so.conf +ldconfig + +/usr/local/ffmpeg/ffmpeg-4.1/ffmpeg -version + +#配置环境变量 +echo "PATH=$PATH:/usr/local/ffmpeg/bin" >> /etc/profile +echo "export PATH" >> /etc/profile +source /etc/profile + +# 验证安装成果 +ffmpeg -version \ No newline at end of file From 00b6fb8f29cc876eb2a1971e4eafd39fd5ed89be Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Thu, 9 Jul 2020 13:53:05 +0800 Subject: [PATCH 2/6] 'commit' --- dsSupport/修改关键帧.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 dsSupport/修改关键帧.txt diff --git a/dsSupport/修改关键帧.txt b/dsSupport/修改关键帧.txt deleted file mode 100644 index 373ac768..00000000 --- a/dsSupport/修改关键帧.txt +++ /dev/null @@ -1 +0,0 @@ -./ffmpeg/ffmpeg.exe -i E:\Work\dsMin\dsSupport\Source\B7\B7318F5D-46B8-4AA1-8811-1A9D65528E19.wmv -strict -2 -qscale 0 -intra E:\Work\dsMin\dsSupport\Target\B7\B7318F5D-46B8-4AA1-8811-1A9D65528E19.wmv \ No newline at end of file From 292057d62734b6ae6291451f8898761d58efef16 Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Thu, 9 Jul 2020 14:04:17 +0800 Subject: [PATCH 3/6] 'commit' --- dsSupport/Shell/install_ffmpeg.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/dsSupport/Shell/install_ffmpeg.sh b/dsSupport/Shell/install_ffmpeg.sh index b3bbf83b..8f3204f2 100644 --- a/dsSupport/Shell/install_ffmpeg.sh +++ b/dsSupport/Shell/install_ffmpeg.sh @@ -25,8 +25,6 @@ echo "include ld.so.conf.d/*.conf" >> /etc/ld.so.conf echo "/usr/local/ffmpeg/lib/" >> /etc/ld.so.conf ldconfig -/usr/local/ffmpeg/ffmpeg-4.1/ffmpeg -version - #配置环境变量 echo "PATH=$PATH:/usr/local/ffmpeg/bin" >> /etc/profile echo "export PATH" >> /etc/profile From 3bca743573a064abd388f6c4800bf3b0eedf1486 Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Thu, 9 Jul 2020 14:07:06 +0800 Subject: [PATCH 4/6] 'commit' --- .gitignore | 1 + dsSupport/Utils/ConvertUtil/ConvertUtil.go | 3 ++- dsSupport/编译Linux版本.cmd | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 dsSupport/编译Linux版本.cmd diff --git a/.gitignore b/.gitignore index 998f66d7..70409ce9 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,4 @@ /dsAutoCode/.idea/ /dsSupport/Source/ /dsSupport/Target/ +/dsSupport/build/ \ No newline at end of file diff --git a/dsSupport/Utils/ConvertUtil/ConvertUtil.go b/dsSupport/Utils/ConvertUtil/ConvertUtil.go index 1acb0b7e..706448fe 100644 --- a/dsSupport/Utils/ConvertUtil/ConvertUtil.go +++ b/dsSupport/Utils/ConvertUtil/ConvertUtil.go @@ -18,7 +18,8 @@ var ffmpeg string func init() { runDir, _ = os.Getwd() - ffmpeg = runDir + `\ffmpeg\ffmpeg.exe` + //ffmpeg = runDir + `\ffmpeg\ffmpeg.exe` + ffmpeg = `/usr/local/ffmpeg/bin/ffmpeg` } // https://blog.csdn.net/lijinshanba/article/details/95343634 diff --git a/dsSupport/编译Linux版本.cmd b/dsSupport/编译Linux版本.cmd new file mode 100644 index 00000000..29b9d64e --- /dev/null +++ b/dsSupport/编译Linux版本.cmd @@ -0,0 +1,4 @@ +:: Linux汾 +SET GOOS=linux +SET GOARCH=amd64 +go build -o ./build/dsSupport main.go 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 5/6] '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 From c9ff65b2fbc15c8b2fe705a2ee4369987ab535b5 Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Thu, 9 Jul 2020 14:45:34 +0800 Subject: [PATCH 6/6] 'commit' --- dsSupport/Shell/install_ffmpeg.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dsSupport/Shell/install_ffmpeg.sh b/dsSupport/Shell/install_ffmpeg.sh index 722b4a53..6e2569ad 100644 --- a/dsSupport/Shell/install_ffmpeg.sh +++ b/dsSupport/Shell/install_ffmpeg.sh @@ -30,16 +30,22 @@ wget https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/ffmpeg/ffmpeg-4.3 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 +./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 +echo "/usr/local/x264/lib/" >> /etc/ld.so.conf.d/x264.conf +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 +echo "/usr/local/x264/lib/" >> /etc/ld.so.conf.d/x264.conf # 验证安装成果 -ffmpeg -version \ No newline at end of file +ffmpeg -version + +# 查看是否有264编码器 +ffmpeg -encoders |grep 264 \ No newline at end of file