The FFMPEG software is only a decoding and encoding software. If multiple formats are supported, you must first install the corresponding library. Next let's talk about the library I installed.

Source: Internet
Author: User

The FFMPEG software is only a decoding and encoding software. If multiple formats are supported, you must first install the corresponding library. The following describes the library I installed:
1. Install faad2

# Wget http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz
# Tar xvfz faad2-2.6.1.tar.gz
# Cd faad2
#./Bootstrap
#./Configure
# Make
# Make install

2. Install liba52

# Wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
# Tar xvfz a52dec-0.7.4.tar.gz
# Cd a52dec-0.7.4
#./Configure
# Make
# Make install

3. Install libdirac

# Wget http://downloads.sourceforge.net/dirac/dirac-0.10.0.tar.gz
# Tar xvfz dirac-0.10.0.tar.gz
# Cd dirac-0.10.0
#./Configure
# Make
# Make install

4. Install faac2

# Wget http://downloads.sourceforge.net/faac/faac-1.26.tar.gz
# Tar xvfz faac-1.26.tar.gz
# Cd faac
#./Bootstrap
#./Configure
# Make
# Make install

5. Install libamrnb

# Wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2
# Tar xvfj amrnb-7.0.0.2.tar.bz2
# Cd amrnb-7.0.0.2
#./Configure
# Make
# Make install

6. Install libamrwb

# Wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2
# Tar xvfj amrwb-7.0.0.3.tar.bz2
# Cd amrwb-7.0.0.3
#./Configure
# Make
# Make install

7. Install libmp 3lame

# Wget http://downloads.sourceforge.net/lame/lame-3.97.tar.gz
# Tar xzf lame-3.97.tar.gz
# Cd lame-3.97
#./Configure
# Make
# Make install

8. Install libx264
This package needs to be obtained using git, so install git first:

# Wget http://kernel.org/pub/software/scm/git/git-1.6.2.tar.gz (address to confirm)
# Tar zxvf git-1.6.2.tar.gz
# Cd git-1.6.2
#./Configure
# Make
# Make install

Then install libx264

#/Usr/local/bin/git clone git: // git.videolan.org/x264.git x264
# Cd x264
#./Configure -- enable-pthread -- enable-shared -- disable-ASM
# Make
# Make install

8. Install libnut. The software requires SVN to obtain the source code. SVN can be directly installed using Yum install SVN. Download first:

# SVN Co SVN: // SVN. mplayerhq. hu/nut/src/trunk libnut

After the download, the code is saved in the newly created libnut directory. For 64-bit Linux, You need to modify the configuration file:

# Cd libnut
# Vi config. Mak

Add the following in the next line of the last cflags:

Cflags + =-FPIC

Then compile and install:

# Make
# Make install

9. Install libogg

# Wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
# Tar xvf libogg-1.1.3.tar.gz
# Cd libogg-1.1.3
#./Configure
# Make
# Make install

10. Install libtheora (obtained by SVN)

# SVN Co http://svn.xiph.org/trunk/theora theora
# Cd theora
#./Autogen. Sh
#./Configure
# Make
# Make install

11. Install libvorbis

# Wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
# Tar xvfz libvorbis-1.2.0.tar.gz
# Cd libvorbis-1.2.0
#./Configure
# Make
# Make install

12. Install libxvid

# Wget http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz
# Tar xvf xvidcore-1.2.1.tar.gz
# Cd xvidcore-1.2.1/build/generic
#./Bootstrap. Sh
#./Configure -- disable-assembly
# Make
# Make install


After the above media support library is installed, you can set the environment to prepare for compiling FFMPEG!
13. Modify Environment Variables

# Vi/etc/lD. So. conf

Add a line at the end of the file:

/Usr/local/lib

Then take effect:

# Ldconfig

14. Install FFMPEG
It can be obtained through SVN, but the file is large, so it is particularly slow:

# SVN checkout SVN: // SVN. mplayerhq. hu/FFMPEG/trunk FFMPEG
# Cd FFMPEG

You can also download it by yourself:

# Http://www.ffmpeg.org/releases/ffmpeg-0.5.tar.bz2
# Bzip2-D ffmpeg-0.5.tar.bz2
# Tar-XF ffmpeg-0.5.tar
# Cd ffmpeg-0.5

Compile (the pkg_config_path parameter must be set for 64-bit systems ):

# Export pkg_config_path =/usr/local/lib/pkgconfig cflags = "-FPIC-M64"
#./Configure -- enable-shared \
-- Enable-GPL \
-- Enable-nonfree \
-- Enable-postproc \
-- Enable-avfilter \
-- Enable-avfilter-lavf \
-- Enable-pthreads \
-- Enable-libamr-Nb \
-- Enable-libamr-WB \
-- Enable-libdirac \
-- Enable-libfaac \
-- Enable-libfaad \
-- Enable-libfaadbin \
Enable-libmp3lame \
-- Enable-libnut \
-- Enable-libtheora \
-- Enable-libvorbis \
Enable-libx264 \
-- Enable-libxvid \
-- Enable-decoder = libx264 \
-- Enable-Encoder = libx264
# Make
# Make install


14. Possible errors:

/Usr/include/Linux/videodev. h: 56: Error: syntax error before "ulong"
/Usr/include/Linux/videodev. h: 72: Error: syntax error before '} 'token
Libavdevice/v4l. C: In function 'Grab _ read_header ':
Libavdevice/v4l. C: 75: Error: storage size of 'tuner' isn' t known
Libavdevice/v4l. C: 133: Error: Invalid application of 'SIZE' to incomplete type 'video _ tuner'
Libavdevice/v4l. C: 140: Error: Invalid application of 'SIZE' to incomplete type 'video _ tuner'
Libavdevice/v4l. C: 75: Warning: unused variable 'tuner'

This may be because the source code videodev. H is not written for the next version of Linux. The standard C does not have the ulong type, so it must be changed to unsigned long.

15. Run FFMPEG-formats. Possible errors:

FFmpeg: Error while loading shared libraries: libavfilter. so.0: cannot open shared object file: no such file or directory

The environment path is not set. Add an FFMPEG. conf configuration file:

# Cd/etc/lD. So. conf. d
# Vi FFMPEG. conf

Write in the file:

/Usr/local/lib

Then confirm the effectiveness:

# Ldconfig

16. Others:
The installation of libgsm is not mentioned in this Article. Please refer to the following documents.

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.