centos ffmpeg安装编译
来源:互联网 发布:知乎同济大学环境工程 编辑:程序博客网 时间:2024/05/29 10:27
Note: The # indicates that the command should be executed as superuser or root and is only required in this guide for the yum command.
Get the dependencies. These are required for compiling, but you can remove them when you are done if you prefer (except make; it should be installed by default and many things depend on it).
# yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel
In your home directory make a new directory to put all of the source code into:
mkdir ~/ffmpeg_sources
Compilation & Installation
Note: If you do not require certain encoders you may skip the relevant section and then remove the appropriate ./configure option in FFmpeg. For example, if libvorbis is not needed, then skip that section and then remove --enable-libvorbis from the Install FFmpeg section.
Yasm
Yasm is an assembler used by x264 and FFmpeg.
cd ~/ffmpeg_sourcesgit clone --depth 1 git://github.com/yasm/yasm.gitcd yasmautoreconf -fiv./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"makemake installecho
Note: The echo at the end is just a sacrificial command because some users are forgetting to manually execute the last command when copying and pasting each code block.
libx264
H.264 video encoder. See the H.264 Encoding Guide for more information and usage examples.
Requires ffmpeg to be configured with --enable-gpl --enable-libx264.
cd ~/ffmpeg_sourcesgit clone --depth 1 git://git.videolan.org/x264cd x264PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-staticmakemake installecho
libx265
H.265/HEVC video encoder. See the H.265 Encoding Guide for more information and usage examples.
Requires ffmpeg to be configured with --enable-gpl --enable-libx265.
cd ~/ffmpeg_sourceshg clone https://bitbucket.org/multicoreware/x265cd ~/ffmpeg_sources/x265/build/linuxcmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED:bool=off ../../sourcemakemake installecho
libfdk_aac
AAC audio encoder.
Requires ffmpeg to be configured with --enable-libfdk_aac (and --enable-nonfree if you also included --enable-gpl).
cd ~/ffmpeg_sourcesgit clone --depth 1 git://git.code.sf.net/p/opencore-amr/fdk-aaccd fdk-aacautoreconf -fiv./configure --prefix="$HOME/ffmpeg_build" --disable-sharedmakemake installecho
libmp3lame
MP3 audio encoder.
Requires ffmpeg to be configured with --enable-libmp3lame.
cd ~/ffmpeg_sourcescurl -L -O http://downloads.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gztar xzvf lame-3.99.5.tar.gzcd lame-3.99.5./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --disable-shared --enable-nasmmakemake installecho
libopus
Opus audio decoder and encoder.
Requires ffmpeg to be configured with --enable-libopus.
cd ~/ffmpeg_sourcesgit clone http://git.opus-codec.org/opus.gitcd opusautoreconf -fivPKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --disable-sharedmakemake installecho
libogg
Ogg bitstream library. Required by libtheora and libvorbis.
cd ~/ffmpeg_sourcescurl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gztar xzvf libogg-1.3.2.tar.gzcd libogg-1.3.2./configure --prefix="$HOME/ffmpeg_build" --disable-sharedmakemake installecho
libvorbis
Vorbis audio encoder. Requires libogg.
Requires ffmpeg to be configured with --enable-libvorbis.
cd ~/ffmpeg_sourcescurl -O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gztar xzvf libvorbis-1.3.4.tar.gzcd libvorbis-1.3.4./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-sharedmakemake installecho
libvpx
VP8/VP9 video encoder.
Requires ffmpeg to be configured with --enable-libvpx.
cd ~/ffmpeg_sourcesgit clone --depth 1 https://chromium.googlesource.com/webm/libvpx.gitcd libvpx./configure --prefix="$HOME/ffmpeg_build" --disable-examplesmakemake installecho
FFmpeg
cd ~/ffmpeg_sourcescurl -O http://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2tar xjvf ffmpeg-snapshot.tar.bz2cd ffmpegPKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib -ldl" --bindir="$HOME/bin" --pkg-config-flags="--static" --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265makemake installhash -r
Compilation is now complete and ffmpeg (also ffprobe, ffserver, lame, and x264) should now be ready to use. The rest of this guide shows how to update or remove FFmpeg.
Tip: Keep the ffmpeg_sources directory and all contents if you intend to update as shown below. Otherwise you can delete this directory.
Updating
Development of FFmpeg is active and an occasional update can give you new features and bug fixes. First, remove the old files and then update the dependencies:
rm -rf ~/ffmpeg_build ~/bin/{ffmpeg,ffprobe,ffserver,lame,vsyasm,x264,x265,yasm,ytasm}# yum install autoconf automake cmake freetype-devel gcc gcc-c++ git libtool make mercurial nasm pkgconfig zlib-devel
Update Yasm
cd ~/ffmpeg_sources/yasmmake distcleangit pull
Then run ./configure, make, and make install as shown in the Install yasm section.
Update x264
cd ~/ffmpeg_sources/x264make distcleangit pull
Then run ./configure, make, and make install as shown in the Install x264 section.
Update x265
cd ~/ffmpeg_sources/x265rm -rf ~/ffmpeg_sources/x265/build/linux/*hg updatecd ~/ffmpeg_sources/x265/build/linux
Then run cmake, make, and make install as shown in the Install x265 section.
Update libfdk_aac
cd ~/ffmpeg_sources/fdk_aacmake distcleangit pull
Then run ./configure, make, and make install as shown in the Install libfdk_aac section.
Update libvpx
cd ~/ffmpeg_sources/libvpxmake distcleangit pull
Then run ./configure, make, and make install as shown in the Install libvpx section.
Update FFmpeg
rm -rf ~/ffmpeg_sources/ffmpeg
Then re-run the Install FFmpeg section.
Reverting changes made by this guide
rm -rf ~/ffmpeg_build ~/ffmpeg_sources ~/bin/{ffmpeg,ffprobe,ffserver,lame,vsyasm,x264,yasm,ytasm}# yum erase autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ git libtool mercurial nasm pkgconfig zlib-develhash -r
If You Need Help
Feel free to ask your questions at the #ffmpeg IRC channel or the ffmpeg-user mailing list.
- centos ffmpeg安装编译
- centos下ffmpeg编译安装
- Linux---centos编译安装ffmpeg
- CentOS 6.5编译安装FFMPEG
- 在CentOS上编译安装FFmpeg
- 在CentOS上编译安装FFmpeg
- CentOS 编译 ffmpeg
- centos编译ffmpeg x264
- centos编译ffmpeg x264
- centos 编译 ffmpeg
- CentOS 编译ffmpeg
- 在CentOS上编译安装FFmpeg(转载)
- CentOS ffmpeg 安装成功
- centos安装ffmpeg
- centos 快速安装ffmpeg
- centos yum安装ffmpeg
- centos 安装 ffmpeg
- centos yum安装ffmpeg
- BZOJ 3884: 上帝与集合的正确用法
- [mmc subsystem] host(第三章)——sdhci-pltfm说明
- java 线程 join
- Textview,EditText属性
- [mmc subsystem] host(第四章)——host实例(sdhci-msm说明)
- centos ffmpeg安装编译
- 115个Java面试题和答案——终极列表(上)
- 十进制转换二进制
- 树莓派---wiringPi串口使用(win10+树莓派3+usb转串口)
- Android控件之Time/DatePicker
- ListBox
- PAT 1002 写出这个数
- 树 的 存储结构 和 代码实现
- 一、Linux下安装搭建Memcached集群环境