4 Star 4 Fork 0

pkuvcl / buildFFmpegAVS2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build_linux.sh 2.91 KB
一键复制 编辑 原始数据 按行查看 历史
luofl 提交于 2018-09-23 09:59 . Fix comments in build_linux.sh
#!/bin/sh
# FFmpegAVS2 build script
#
# Copyright (c) 2018~ Yiqun Xu
# 2018~ Falei Luo
# 2018~ Huiwen Ren
# 2018~ VCL, NELVT, PKU
touch build.log
echo "BUILD TIME: $(date +%Y-%m-%d)" > build.log
if test -t 1 && which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
if test -n "$ncolors" && test $ncolors -ge 8; then
msg_color=$(tput setaf 3)$(tput bold)
error_color=$(tput setaf 1)$(tput bold)
reset_color=$(tput sgr0)
fi
ncols=$(tput cols)
fi
checkfail()
{
echo "$error_color""ERROR: $@ failed.$reset_color"
exit 1
}
printLog()
{
echo ">>> $@" >> $build_dir/build.log
$@ >> $build_dir/build.log
}
###############################
# Sync repositories
###############################
checkGitSources()
{
echo ">>>>"
echo " -------------------------------------------------------------------------- "
echo " dir: $1 "
echo " url: $2 "
echo " -------------------------------------------------------------------------- "
if [ ! -d $1 ]; then
echo "$1 source not found, cloning"
git clone $2 $1 || checkfail "$1 source: git clone failed"
else
echo "$1 source found!"
fi
echo "synchronizing sources..."
curdir=$(pwd)
cd $1
git pull
cd $curdir
echo "success..."
}
###############################
## install pkg-config
#### for ubuntu
###############################
# sudo apt-get install pkg-config
# current dir
build_dir=`pwd`
# sync sources
checkGitSources FFmpegAVS2 https://github.com/pkuvcl/FFmpegAVS2.git
checkGitSources xavs2 https://github.com/pkuvcl/xavs2.git
checkGitSources davs2 https://github.com/pkuvcl/davs2.git
###############################
# build xavs2 encoder
###############################
echo "$msg_color[Start building xAVS2 encoder]$reset_color"
cd xavs2/build/linux # xAVS2 directory
printLog ./configure --prefix=$build_dir/avs2_lib \
--enable-pic \
--enable-shared
printLog make -j8 || checkfail "make failed"
printLog make install
cd -
###############################
# build davs2 decoder
###############################
echo "$msg_color[Start building dAVS2 decoder]$reset_color"
cd davs2/build/linux # dAVS2 directory
printLog ./configure --prefix=$build_dir/avs2_lib \
--enable-pic \
--enable-shared
printLog make -j8 || checkfail "make failed"
printLog make install
cd -
###############################
# build ffmpeg decoder
###############################
echo "$msg_color[Start building FFmpegAVS2]$reset_color"
cd FFmpegAVS2
git checkout avs2
export PKG_CONFIG_PATH=$build_dir/avs2_lib/lib/pkgconfig
printLog ./configure \
--prefix=$build_dir/avs2_lib \
--enable-gpl \
--enable-libxavs2 \
--enable-libdavs2 \
--enable-shared \
--enable-static
printLog make -j8 || checkfail "make failed"
printLog make install
# tar -czvf ./ffmpeg_lib.tar.gz ./install
cd -
echo "Everything done!"
Shell
1
https://gitee.com/pkuvcl/buildFFmpegAVS2.git
git@gitee.com:pkuvcl/buildFFmpegAVS2.git
pkuvcl
buildFFmpegAVS2
buildFFmpegAVS2
master

搜索帮助