Install FFmpeg in Centos5

Source: Internet
Author: User
Tags internap

Install necessary dependent Libraries
Yum install-y automake autoconf libtool gcc-c ++
1. download the required Decoder
Wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
Wget http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz
Wget http://downloads.sourceforge.net/faac/faac-1.26.tar.gz
Wget http://nchc.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
Wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.0.tar.gz
Wget ftp://ftp.videolan.org: 21 // pub/videolan/x264/snapshots/x264-snapshot-20090107-2245.tar.bz2
Wget http://downloads.xvid.org/downloads/xvidcore-1.1.3.tar.gz
Wget http://down1.chinaunix.net/distfiles/libdts-0.0.2.tar.gz
2. Unzip and install
Extract
For I in * .tar.gz; do tar-xzvf "$ I"; done
For I in * .tar.bz2; do tar-xjvf "$ I"; done
Installation parameters
A52dec:./configure-enable-shared = PKGS & make install
Faac & faad2:./bootstrap &./configure & make install
Xvidcore: cd build/generic;./configure & make install
Libx264:./configure-enable-mp4-output-enable-shared-enable-pthread & make install
Lame & yasm:./configure & make install
Finally, download and install ffmpeg
I use svn to synchronize data. If the data cannot be compiled, consider not to use the latest one. However, please note that you are connecting to this website, it was killed by the firewall in our country. You need to think about it yourself.
Svn checkout svn: // svn. mplayerhq. hu/ffmpeg/trunk ffmpeg
Compile Parameters
. /Configure-enable-gpl-enable-postproc-enable-nonfree-enable-postproc-enable-libfaad-enable-swscale-enable-avfilter-enable-pthreads-enable-libxvid-enable-libx264 -enable-libmp3lame-enable-libfaac-disable-ffserver-disable-ffplay
Supports rm and rmvb
Only ffmpeg can be used for rm and rmvb, and the following mplayer is required.
Svn checkout svn: // svn. mplayerhq. hu/mplayer/trunk mplayer
Wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
Wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
Wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
For I in * .tar.bz2; do tar-xjvf "$ I"; done
Cp-rf essential-20071007/*/usr/local/lib/codecs
Cp-rf all-20071007/*/usr/local/lib/codecs
Cp-rf essential-amd64-20071007/*/usr/local/lib/codecs
. /Configure-prefix =/usr/local/mplayer-enable-gui-enable-freetype-codecsdir =/usr/local/lib/codes-win32codecsdir =/usr/local/lib/ win32codcs
Update Dynamic Link Library
Because it is installed by the compiler, the system needs to find the dynamic link library.
# Echo "/usr/local/lib">/etc/ld. so. conf
# Echo "/usr/lib">/etc/ld. so. conf
# Ldconfig
The installation is complete.
The most basic commands (Be sure to understand)
The supported format is displayed. However, it seems that when a parameter is added, there is a problem. It seems that the parameter and supported format are different.
$ Ffmpeg-formats
Displays video-related information, such as duration, file sound, and video format.
Ffmpeg-I abc. ts
View what parameters can be added
Ffmpeg-h
Mplayer obtains video information
Mplayer-identify movie-filename-nosound-vc dummy-vo null
Capture images from videos with ffmpeg
Ffmpeg-I original video file path-y-f image2-ss 8-t 0.001-s image size (400x300) image storage path
Use ffmpeg to convert a video to flv
Ffmpeg-I original video file path-o target file path-of lavf-oac mp3lame-lameopts abr: br = 56-ovc lavc-lavcopts vcodec = flv: vbitrate = video code stream: mbd = 2: mv0: trell: v4mv: White: last_pred = 3: dia = 4: cmp = 6: vb_strategy = 1-vf scale = high: width-ofps 12-srate 22050 ′)
Ffmpeg 00:04:00-t 00:08:00-I-vcodec copy-acodec copy aaa. avi
FAQ
1. The following prompt appears:
-Soname, libx264.so. 65-lm-lpthread-lgpac_static-s
/Usr/bin/ld: cannot find-lgpac_static
Collect2: ld returned 1 exit status
Make: *** [libx264.so. 65] Error 1
Solution
Yum install zlib-devel
Wget http://internap.dl.sourceforge.net/sourceforge/gpac/gpac-0.4.5.tar.gz
Wget http://internap.dl.sourceforge.net/sourceforge/gpac/gpac_extra_libs-0.4.5.tar.gz
Tar-zxf gpac-0.4.5.tar.gz
Tar-zxf gpac_extra_libs-0.4.5.tar.gz
Cd gpac_extra_libs
Cp-r * ../gpac/extra_lib
Cd ../gpac
Chmod + x configure
./Configure
Make lib
Make apps
Make install-lib
Make install
Cp bin/gcc/libgpac. so/usr/lib

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.