Compile and install FFmpeg in centos6.5

Source: Internet
Author: User
Tags automake
The following installation steps are basically from the official website. Make a note so that you can check http://trac.ffmpeg.org/wiki/compilationguide1.installation dependency package using python#viewplaincopyprint? & Lt; spanstyle = & quot; font-size: 14px; & quot; & gt

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?
  1. "Font-size: 14px;"> yum install autoconf automake gcc-c ++ git libtool make nasm pkgconfig zlib-devel
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel

 

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?
  1. Cd ~ /Ffmpeg_sources
  2. Curl-O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
  3. Tar xzvf yasm-1.2.0.tar.gz
  4. Cd yasm-1.2.0
  5. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- bindir = "$ HOME/bin"
  6. Make
  7. Make install
  8. Make distclean
  9. 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?
  1. Cd ~ /Ffmpeg_sources
  2. Git clone -- depth 1 git: // git.videolan.org/x264
  3. Cd x264
  4. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- bindir = "$ HOME/bin" -- enable-static
  5. Make
  6. Make install
  7. Make distclean
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?
  1. Cd ~ /Ffmpeg_sources
  2. Git clone -- depth 1 git: // git.code.sf.net/p/opencore-amr/fdk-aac
  3. Cd fdk-aac
  4. Autoreconf-fiv
  5. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-shared
  6. Make
  7. Make install
  8. Make distclean
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?
  1. Cd ~ /Ffmpeg_sources
  2. Curl-O http://downloads.xiph.org/releases/opus/opus-1.1.tar.gz
  3. Tar xzvf opus-1.1.tar.gz
  4. Cd ops-1.1
  5. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-shared
  6. Make
  7. Make install
  8. Make distclean
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?
  1. Cd ~ /Ffmpeg_sources
  2. Curl-O http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz
  3. Tar xzvf libogg-1.3.1.tar.gz
  4. Cd libogg-1.3.1
  5. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-shared
  6. Make
  7. Make install
  8. Make distclean
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?
  1. Cd ~ /Ffmpeg_sources
  2. Curl-O http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
  3. Tar xzvf libvorbis-1.3.4.tar.gz
  4. Cd libvorbis-1.3.4
  5. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- with-ogg = "$ HOME/ffmpeg_build" -- disable-shared
  6. Make
  7. Make install
  8. Make distclean
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?
  1. Cd ~ /Ffmpeg_sources
  2. Git clone -- depth 1 https://chromium.googlesource.com/webm/libvpx.git
  3. Cd libvpx
  4. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-examples
  5. Make
  6. Make install
  7. Make clean
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:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.