Ffmpeg2.2.3 compilation and Installation

Source: Internet
Author: User

Reference: http://blog.chinaunix.net/uid-23069658-id-4018842.html

Download the required decoder:

Lame: wget http://nchc.dl.sourceforge.net/project/lame/lame/3.99/lame-3.99.5.tar.gz

Libogg: wget http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz

Libvorbis: wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz

Faad2: wget http://downloads.sourceforge.net/faac/faad2-2.7.tar.gz

Faac: wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gz

Libtheora: wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.xz

Vo-aacenc: wget http://mirrors.oschina.net/ubuntu/pool/universe/v/vo-aacenc/vo-aacenc_0.1.3.orig.tar.gz

Xvid-core1.3.3: wget http://downloads.xvid.org/downloads/xvidcore-1.3.3.tar.gz

Asm1.2.0: wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz

X264: wget ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2

Libraw1394: wget http://ncu.dl.sourceforge.net/project/libraw1394/libraw1394/libraw1394-2.0.5.tar.gz

Libdc1394: wget http://ncu.dl.sourceforge.net/project/libdc1394/libdc1394-2/2.2.1/libdc1394-2.2.1.tar.gz

Fribidi: wget http://fribidi.org/download/fribidi-0.19.6.tar.bz2

Fontconfig: wget http://www.freedesktop.org/software/fontconfig/release/fontconfig-2.11.1.tar.gz

Libass: wget https://libass.googlecode.com/files/libass-0.10.2.tar.xz

Librtmp: wget http://rtmpdump.mplayerhq.hu/download/rtmpdump-2.3.tgz

Speex: wget http://downloads.xiph.org/releases/speex/speex-1.2rc1.tar.gz

Twolame: wget http://downloads.sourceforge.net/twolame/twolame-0.3.13.tar.gz

Libdts: wget http://down1.chinaunix.net/distfiles/libdts-0.0.2.tar.gz

A52: wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz

Fdk-aac: wget http://superb-dca3.dl.sourceforge.net/project/opencore-amr/fdk-aac/fdk-aac-0.1.3.tar.gz

Opencore-amr: wget http://hivelocity.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-0.1.3.tar.gz

Ffmpeg 2.2.3: wget http://ffmpeg.org/releases/ffmpeg-2.2.3.tar.gz


Configure the pkg config path, which is displayed when libass is installed.
Package libass was not found in the pkg-config search path.
Perhaps you shoshould add the directory containing 'libass. pc'
To the PKG_CONFIG_PATH environment variable
.

[Root @ localhost ffmpeg] # vi/etc/profile
Add the following lines:

PKG_CONFIG =/usr/bin/pkg-config
PKG_CONFIG_PATH =/usr/local/lib/pkgconfig
Export path user logname mail hostname histsize histcontrol JAVA_HOME JRE_HOME CLASSPATH PKG_CONFIG PKG_CONFIG_PATH # Note: The following two variables are newly added.

Save and exit.
[Root @ localhost ffmpeg] # source/etc/profile
[Root @ localhost ffmpeg] # cd faac-1.28
[Root @ localhost ffmpeg] #./bootstrap
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install

Error: g ++: not found
Solution: yum install gcc + gcc-c ++
Make
Error: mpeg4ip. h: 126: error: new declaration 'Char * strcasestr (const char *, const char *)'
Solution: vim faac-1.28/common/mp4v2/mpeg4ip. h

Modify the object mpeg4ip. h from row 3 to row 3.
Before modification:
# Ifdef _ cplusplus
Extern "C "{
# Endif
Char * strcasestr (const char * haystack, const char * needle );
# Ifdef _ cplusplus
}
# Endif

After modification:
# Ifdef _ cplusplus
Extern "C ++ "{
# Endif
Const char * strcasestr (const char * haystack, const char * needle );
# Ifdef _ cplusplus
}
# Endif
Install

[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd lame-3.99.5
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd libogg-1.3.2
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd libtheora-1.1.1
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared

*** Cocould not run Ogg test program, checking why...
* ** The test program compiled, but did not run. This usually means
* ** That the run-time linker is not finding Ogg or finding the wrong
* ** Version of Ogg. If it is not finding Ogg, you'll need to set your
* ** LD_LIBRARY_PATH environment variable, or edit/etc/ld. so. conf to point
* ** To the installed location Also, make sure you have run ldconfig if that
*** Is required on your system
***
*** If you have an old version installed, it is best to remove it, although
* ** You may also be able to get things to work by modifying LD_LIBRARY_PATH
Configure: error:
Libogg is required to build this package!
Please see http://www.xiph.org/for how
Obtain a copy.

Ogg was installed but theora thought we didn't install it. The reason is, of course, the path of the dynamic library,
My solution is to create a file named local-libraries.conf in the/etc/ld. so. conf. d/directory with only one line of content:
/Usr/local/lib

Then run ldconfig-v
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd libvorbis-1.3.4
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd vo-aacenc-0.1.3
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # xvidcore-1.3.3/build/generic
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ../../../

[Root @ localhost ffmpeg] # cd yasm-1.2.0
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd x264-snapshot-20140618-2245
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared -- enable-pic
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd libraw1394-2.0.5
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd libdc1394-2.2.1
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd libfreetype2-master
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd fribidi-0.19.6
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd fontconfig-2.11.1
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared -- enable-libxml2
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd libass-0.10.2
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install

If the following error occurs:
../Libass/. libs/libass. so: undefined reference to 'libiconv'
../Libass/. libs/libass. so: undefined reference to 'libiconv _ close'
../Libass/. libs/libass. so: undefined reference to 'libiconv _ open'
Collect2: ld returned 1 exit status
Make [2]: *** [test] Error 1
Make [2]: Leaving directory '/root/tools/ffmpeg/libass-0.10.2/Test'
Make [1]: *** [all-recursive] Error 1
Make [1]: Leaving directory '/root/tools/ffmpeg/libass-0.10.2'
Make: *** [all] Error 2

Run the following configuration command:
[Root @ localhost ffmpeg] # PKG_CONFIG_PATH =/usr/local/lib/pkgconfig/./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd rtmpdump-2.3
[Root @ localhost ffmpeg] # make SYS = posix
[Root @ localhost ffmpeg] # make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd speex-1.2rc1
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared -- enable-sse
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd twolame-0.3.13
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd libdts-0.0.2
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local -- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd a52dec-0.7.4
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd faad2-2.7
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local -- with-mp4v2 -- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd amrwb-11.0.0.0
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local -- enable-shared

If the following error occurs during configuration: configure: error: You need patch utility to prepare sources.
Run the following command:
Yum-y install patch
Then execute again
./Configure -- prefix =/usr/local -- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd amrnb-11.0.0.0
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local -- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd opencore-amr-0.1.3
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd fdk-aac-0.1.3
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-shared
[Root @ localhost ffmpeg] # make & make install
[Root @ localhost ffmpeg] # cd ..

[Root @ localhost ffmpeg] # cd ffmpeg-2.2.3
[Root @ localhost ffmpeg] # LD_LIBRARY_PATH =/usr/local/include
[Root @ localhost ffmpeg] #./configure -- prefix =/usr/local/-- enable-gpl -- enable-version3 -- enable-nonfree \
-- Enable-shared -- enable-zlib -- enable-bzlib -- enable-libfaac -- enable-libmp3lame \
-- Enable-libtheora -- enable-libvo-aacenc -- enable-libvorbis -- enable-libx264 \
-- Enable-libxvid -- enable-pthreads -- enable-libdc1394 -- enable-libass -- enable-pic \
-- Enable-openssl -- enable-libtwolame -- enable-libspeex -- enable-librtmp -- enable-libfreetype \
-- Enable-libopencore-amrnb -- enable-libopencore-amrwb -- enable-avisynth -- enable-fontconfig \
-- Enable-libfdk-aac -- enable-rpath -- extra-cflags =-I/usr/local/include -- extra-ldflags =-L/usr/local/lib -- extra-libs =-liconv

-- Extra-libs =-liconv is added when the libiconv library cannot be found.

[Root @ localhost ffmpeg] # make & make install

The required package can download http://www.kuaipan.cn/file/id_157354068283490498.htm here

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.