在RedHat 6.x和7.x上用编译ffmpeg
来源:互联网 发布:黑马程序员 如何 编辑:程序博客网 时间:2024/05/16 05:31
# 参考文档
# http://trac.ffmpeg.org/wiki/CompilationGuide/Centos
# http://www.linuxfromscratch.org/blfs/view/7.8/
yum install -y autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel
#安装SDL
wget http://www.libsdl.org/release/SDL-1.2.15-1.x86_64.rpm
wget http://www.libsdl.org/release/SDL-devel-1.2.15-1.x86_64.rpm
#官网的SDL-1.2.15比RedHat多了/usr/lib64/libSDLmain.a文件
#yum erase SDL SDL-devel
rpm -ivh SDL-1.2.15-1.x86_64.rpm --force
rpm -ivh SDL-devel-1.2.15-1.x86_64.rpm --force
#编译SDL2
wget http://www.libsdl.org/release/SDL2-2.0.3.tar.gz
tar -xzvf SDL2-2.0.3.tar.gz
cd SDL2-2.0.3
./configure --prefix=/usr/local/share/sdl2-2.0.3
make && make install && make clean
cat > sdl2-x86_64.conf <<EOF
/usr/local/share/sdl2-2.0.3/lib
EOF
ldconfig
cat >> /etc/profile
export PATH=$PATH:/usr/local/share/sdl2-2.0.3/bin
if [ $FFDIR ]
then
echo "\$FFDIR is already exist"
else
cat >> /etc/profile <<EOF
export FFDIR=/usr/local/share/ffmpeg
export PATH=\$PATH:\$FFDIR/bin
EOF
source /etc/profile
fi
mkdir -p $FFDIR/src $FFDIR/build $FFDIR/bin
#Compilation & Installation
cd $FFDIR/src
#git clone --depth 1 git://github.com/yasm/yasm.git
#cd yasm
if [ ! -f yasm-1.3.0.tar.gz ]
then
wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz
tar -xzvf yasm-1.3.0.tar.gz
fi
cd yasm-1.3.0
autoreconf -fiv
./configure --prefix=$FFDIR/build --bindir=$FFDIR/bin
make && make install && make distclean
cd $FFDIR/src
#git clone --depth 1 git://git.videolan.org/x264
#cd x264
if [ ! -f x264-snapshot-20150908-2245-stable.tar.bz2 ]
then
wget http://download.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20150908-2245-stable.tar.bz2
tar -xjvf x264-snapshot-20150908-2245-stable.tar.bz2
fi
cd x264-snapshot-20150908-2245-stable
./configure --prefix=$FFDIR/build --bindir=$FFDIR/bin --enable-static --enable-shared --enable-pic
make && make install && make distclean
cd $FFDIR/src
#hg clone https://bitbucket.org/multicoreware/x265
#cd x265/build/linux
if [ ! -f x265_1.8.tar.gz ]
then
wget https://bitbucket.org/multicoreware/x265/downloads/x265_1.8.tar.gz
tar -xzvf x265_1.8.tar.gz
fi
cd x265_11047/build/linux
cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=$FFDIR/build -DENABLE_SHARED:bool=on -DENABLE_PIC:bool=on ../../source
make && make install && make clean
cd $FFDIR/src
#git clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aac
#cd fdk-aac
if [ ! -f fdk-aac-0.1.4.tar.gz ]
then
wget http://downloads.sourceforge.net/opencore-amr/fdk-aac-0.1.4.tar.gz
tar -xzvf fdk-aac-0.1.4.tar.gz
fi
cd fdk-aac-0.1.4
autoreconf -fiv
./configure --prefix=$FFDIR/build --enable-static --enable-shared --enable-pic
make && make install && make distclean
cd $FFDIR/src
if [ ! -f lame-3.99.5.tar.gz ]
then
wget http://downloads.sourceforge.net/lame/lame-3.99.5.tar.gz
tar -xzvf lame-3.99.5.tar.gz
fi
cd lame-3.99.5
./configure --prefix=$FFDIR/build --bindir=$FFDIR/bin --enable-static --enable-shared --enable-pic --enable-nasm
make && make install && make distclean
cd $FFDIR/src
#git clone git://git.opus-codec.org/opus.git
#git clone https://github.com/xiph/opus.git
#cd opus
if [ ! -f opus-1.1.tar.gz ]
then
wget http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
tar -xzvf opus-1.1.tar.gz
fi
cd opus-1.1/
autoreconf -fiv
./configure --prefix=$FFDIR/build --enable-static --enable-shared --enable-pic
make && make install && make distclean
cd $FFDIR/src
if [ ! -f libogg-1.3.2.tar.gz ]
then
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz
tar -xzvf libogg-1.3.2.tar.gz
fi
cd libogg-1.3.2
./configure --prefix=$FFDIR/build --enable-static --enable-shared --enable-pic
make && make install && make distclean
cd $FFDIR/src
if [ ! -f libvorbis-1.3.5.tar.gz ]
then
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz
tar -xzvf libvorbis-1.3.5.tar.gz
fi
cd libvorbis-1.3.5
LDFLAGS="-L$FFDIR/build/lib" CPPFLAGS="-I$FFDIR/build/include" ./configure --prefix=$FFDIR/build --with-ogg=$FFDIR/build --enable-static --enable-shared --enable-pic
make && make install && make distclean
cd $FFDIR/src
#git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git
#git clone --depth 1 https://github.com/webmproject/libvpx.git
#git clone https://github.com/webmproject/libvpx
#cd libvpx
if grep -i "release 6" /etc/redhat-release
then
yum install -y libvpx
else
if [ ! -f libvpx-1.4.0.tar.bz2 ]
then
wget http://storage.googleapis.com/downloads.webmproject.org/releases/webm/libvpx-1.4.0.tar.bz2
tar -xjvf libvpx-1.4.0.tar.bz2
fi
cd libvpx-1.4.0
./configure --prefix=$FFDIR/build --disable-unit-tests --enable-static --enable-shared --enable-pic
make && make install && make distclean
fi
cd $FFDIR/src
#git clone --depth 1 git://source.ffmpeg.org/ffmpeg
#git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
#git clone https://github.com/FFmpeg/FFmpeg.git
#cd FFmpeg/
if [ ! -f ffmpeg-2.8.1.tar.bz2 ]
then
wget http://ffmpeg.org/releases/ffmpeg-2.8.1.tar.bz2
tar -xjvf ffmpeg-2.8.1.tar.bz2
fi
cd ffmpeg-2.8.1
PKG_CONFIG_PATH=$FFDIR/build/lib/pkgconfig ./configure --prefix=$FFDIR/build --extra-cflags=-I"$FFDIR/build/include" --extra-ldflags=-L"$FFDIR/build/lib" \
--bindir=$FFDIR/bin --enable-static --enable-shared --enable-pic --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame \
--enable-libopus --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libvpx --enable-ffplay
make && make install && make distclean
cat > /etc/ld.so.conf.d/ffmpeg-x86_64.conf <<EOF
/usr/local/share/ffmpeg/build/lib
EOF
ldconfig
hash -r
- 在RedHat 6.x和7.x上用编译ffmpeg
- MAC OS X上编译ffmpeg
- centos6.X上FFmpeg编译安装
- RHEL(redhat 5.x,6.x)和CentOS上Gitlab安装全过程
- ffmpeg 在mac os x 上的编译 及 Xcode项目中的运用
- 在OS X上编译i386架构的ffmpeg静态库
- 在 redhat 上编译
- Qt程序如何在Mac上用X-code编译
- Qt程序如何在Mac上用X-code编译
- 如何在CentOS 6.X 或 redhat 上安装JDK runtime environment (openjdk)
- 在Android上使用FFMPEG和SDL 2.X播放视频
- 在 Tomcat 4.x/5.x/6.x/7.x 中生成和安装 SSL 证书
- macbook在mamp上php7.0.x和php5.6.x安装拓展redis
- ios 4.x上的工程编译在3.x上的运行时的问题
- (转载)在 Mac OS X 上编译 V8
- 在mac上编译cocos2d-x-3.0rc0
- openwrt 在MAC OS X上编译失败
- Cocos2d-x 3.4在AndroidStudio上编译配置
- aja跨域举例
- lua小结
- 2015年ccpc赛后总结:
- script标签到底该放在哪里
- iOS讲解迷惑 -- XMPP--登录注册
- 在RedHat 6.x和7.x上用编译ffmpeg
- 函数、全局变量、局部变量和返回值的介绍与使用注意
- NSString Class Reference
- 黑马程序员——C语言日志——条件编译指令
- 调试工具BTrace 的使用--例子
- win8.1+MATLAB安装步骤
- struts2拦截器 默认拦截器 默认跳转 全局异常
- 操作系统学习笔记:文件系统实现
- LeetCode43——Multiply Strings