Compile and install FFmpeg in centos6.5
The following installation steps are basically from the official website. Make a note so that you can view them later.
Http://trac.ffmpeg.org/wiki/CompilationGuide
1. Install the dependency package
[Python] view plaincopyprint?
- <Spanstyle = "font-size: 14px;"> yuminstallautoconfautomakegccgcc-c ++ gitlibtoolmakenasmpkgconfigzlib-devel </span>
<span style="font-size:14px;">yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel</span>
2. Create a folder to store the source code
mkdir ~/ffmpeg_sources
3. Compile and install
Yasm
Yasm is an attacker used by x264 and FFmpeg.
[Python] view plaincopyprint?
- Cd ~ /Ffmpeg_sources
- Curl-Ohttp: // www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
- Tarxzvfyasm-1.2.0.tar.gz
- Cdyasm-1.2.0
- ./Configure -- prefix = "$ HOME/ffmpeg_build" -- bindir = "$ HOME/bin"
- Make
- Makeinstall
- Makedistclean
- Export "PATH = $ PATH: $ HOME/bin"
cd ~/ffmpeg_sourcescurl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gztar xzvf yasm-1.2.0.tar.gzcd yasm-1.2.0./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"makemake installmake distcleanexport "PATH=$PATH:$HOME/bin"
Libx0000h.264 video encoder.
[Python] view plaincopyprint?
- Cd ~ /Ffmpeg_sources
- Gitclone -- depth1git: // git.videolan.org/x264
- Cdx264
- ./Configure -- prefix = "$ HOME/ffmpeg_build" -- bindir = "$ HOME/bin" -- enable-static
- Make
- Makeinstall
- Makedistclean
cd ~/ffmpeg_sourcesgit clone --depth 1 git://git.videolan.org/x264cd x264./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-staticmakemake installmake distclean
Libfdk_aacAAC audio encoder.
[Python] view plaincopyprint?
- Cd ~ /Ffmpeg_sources
- Gitclone -- depth1git: // git.code.sf.net/p/opencore-amr/fdk-aac
- Cdfdk-aac
- Autoreconf-fiv
- ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-shared
- Make
- Makeinstall
- Makedistclean
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 installmake distclean
Libmp 3lameopus audio decoder and encoder.
[Python] view plaincopyprint?
- Cd ~ /Ffmpeg_sources
- Curl-Ohttp: // downloads.xiph.org/releases/opus/opus-1.1.tar.gz
- Tarxzvfopus-1.1.tar.gz
- Cdopus-1.1
- ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-shared
- Make
- Makeinstall
- Makedistclean
cd ~/ffmpeg_sourcescurl -O http://downloads.xiph.org/releases/opus/opus-1.1.tar.gztar xzvf opus-1.1.tar.gzcd opus-1.1./configure --prefix="$HOME/ffmpeg_build" --disable-sharedmakemake installmake distclean
LiboggOgg bitstream library. Required by libtheora and libvorbis.
[Python] view plaincopyprint?
- Cd ~ /Ffmpeg_sources
- Curl-Ohttp: // downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz
- Tarxzvflibogg-1.3.1.tar.gz
- Cdlibogg-1.3.1
- ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-shared
- Make
- Makeinstall
- Makedistclean
cd ~/ffmpeg_sourcescurl -O http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gztar xzvf libogg-1.3.1.tar.gzcd libogg-1.3.1./configure --prefix="$HOME/ffmpeg_build" --disable-sharedmakemake installmake distclean
LibvorbisVorbis audio encoder. Requires libogg.
[Python] view plaincopyprint?
- Cd ~ /Ffmpeg_sources
- Curl-Ohttp: // downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
- Tarxzvflibvorbis-1.3.4.tar.gz
- Cdlibvorbis-1.3.4
- ./Configure -- prefix = "$ HOME/ffmpeg_build" -- with-ogg = "$ HOME/ffmpeg_build" -- disable-shared
- Make
- Makeinstall
- Makedistclean
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 installmake distclean
LibvpxVP8/VP9 video encoder.
[Python] view plaincopyprint?
- Cd ~ /Ffmpeg_sources
- Gitclone -- depth1https: // chromium.googlesource.com/webm/libvpx.git
- Cdlibvpx
- ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-examples
- Make
- Makeinstall
- Makeclean
cd ~/ffmpeg_sourcesgit clone --depth 1 https://chromium.googlesource.com/webm/libvpx.gitcd libvpx./configure --prefix="$HOME/ffmpeg_build" --disable-examplesmakemake installmake clean
Note: libvpx cannot be cloned by git because Google cannot be accessed in China recently. You can download it elsewhere: http://yunpan.cn/QhNk5tDqQV 3MM access password 45f6
FFmpeg
cd ~/ffmpeg_sourcesgit clone --depth 1 git://source.ffmpeg.org/ffmpegcd ffmpegPKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig"export PKG_CONFIG_PATH./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --bindir="$HOME/bin" --extra-libs=-ldl --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264makemake installmake distcleanhash -r. ~/.bash_profile
Check the version after the installation is complete: