Compile and install FFmpeg in centos6.5

Source: Internet
Author: User

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?
  1. <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?
  1. Cd ~ /Ffmpeg_sources
  2. Curl-Ohttp: // www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
  3. Tarxzvfyasm-1.2.0.tar.gz
  4. Cdyasm-1.2.0
  5. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- bindir = "$ HOME/bin"
  6. Make
  7. Makeinstall
  8. Makedistclean
  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. Gitclone -- depth1git: // git.videolan.org/x264
  3. Cdx264
  4. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- bindir = "$ HOME/bin" -- enable-static
  5. Make
  6. Makeinstall
  7. 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?
  1. Cd ~ /Ffmpeg_sources
  2. Gitclone -- depth1git: // git.code.sf.net/p/opencore-amr/fdk-aac
  3. Cdfdk-aac
  4. Autoreconf-fiv
  5. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-shared
  6. Make
  7. Makeinstall
  8. 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?
  1. Cd ~ /Ffmpeg_sources
  2. Curl-Ohttp: // downloads.xiph.org/releases/opus/opus-1.1.tar.gz
  3. Tarxzvfopus-1.1.tar.gz
  4. Cdopus-1.1
  5. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-shared
  6. Make
  7. Makeinstall
  8. 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?
  1. Cd ~ /Ffmpeg_sources
  2. Curl-Ohttp: // downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz
  3. Tarxzvflibogg-1.3.1.tar.gz
  4. Cdlibogg-1.3.1
  5. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-shared
  6. Make
  7. Makeinstall
  8. 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?
  1. Cd ~ /Ffmpeg_sources
  2. Curl-Ohttp: // downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
  3. Tarxzvflibvorbis-1.3.4.tar.gz
  4. Cdlibvorbis-1.3.4
  5. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- with-ogg = "$ HOME/ffmpeg_build" -- disable-shared
  6. Make
  7. Makeinstall
  8. 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?
  1. Cd ~ /Ffmpeg_sources
  2. Gitclone -- depth1https: // chromium.googlesource.com/webm/libvpx.git
  3. Cdlibvpx
  4. ./Configure -- prefix = "$ HOME/ffmpeg_build" -- disable-examples
  5. Make
  6. Makeinstall
  7. 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:

Related Article

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.