• ¡Welcome to Square Theme!
  • This news are in header template.
  • Please ignore this message.
Hello There, Guest! Login RegisterLogin with Facebook


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Install FFMPEG CentOS
#1
ffmpeg is the most popular opensource video streaming software and its being used on many servers, websites who are offering video based streaming services.  We have often seen many users facing lots of difficulties installing ffmpeg. So here is something i will show the most easiest way to get ffmpeg installed on a centos 6. 3 or 6.4 server using the yum package command line.  This article Install FFMPEG CentOS only describes the steps on our tested centos  based server and its works like charm.

First lets check the correct version of your server.

Code:
cat /etc/redhat-release

Then install the correct repo from rpmforge through which we will install ffmpeg packages via yum. Take note its 64bit packages.

Code:
rpm -Uhv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

Alright, Lets begin with installing ffmpeg and other necessary packages required. This should take approx 20 to 30 mins.


Code:
yum install glibc gcc gcc-c++ autoconf automake libtool git make nasm pkgconfig
yum install SDL-devel a52dec a52dec-devel alsa-lib-devel faac faac-devel faad2 faad2-devel
yum install freetype-devel giflib gsm gsm-devel imlib2 imlib2-devel lame lame-devel libICE-devel libSM-devel libX11-devel
yum install libXau-devel libXdmcp-devel libXext-devel libXrandr-devel libXrender-devel libXt-devel
yum install libogg libvorbis vorbis-tools mesa-libGL-devel mesa-libGLU-devel xorg-x11-proto-devel zlib-devel
yum install libtheora theora-tools
yum install ncurses-devel
yum install libdc1394 libdc1394-devel
yum install amrnb-devel amrwb-devel opencore-amr-devel

All done, Now lets install the other external tools like xvid, libogg,libvorbis,libtheora and x264 etc. We will use /usr/local/src for source compilations

Install xvid

Code:
cd /usr/local/src
wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
tar xzvf xvidcore-1.3.2.tar.gz
cd xvidcore/build/generic
./configure --prefix="$HOME/ffmpeg_build"
make
make install

Install LibOgg

Code:
cd /usr/local/src
wget http://downloads.xiph.org/releases/ogg/libogg-1.3.1.tar.gz
tar xzvf libogg-1.3.1.tar.gz
cd libogg-1.3.1
./configure –disable-shared
make
make install

Install LibVorbis

Code:
cd /usr/local/src
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.4.tar.gz
tar xzvf libvorbis-1.3.4.tar.gz
cd libvorbis-1.3.4
./configure –disable-shared
make
make install

Install Libtheora 


Code:
cd /usr/local/src
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gz
tar xzvf libtheora-1.1.1.tar.gz
cd libtheora-1.1.1
./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-examples --disable-shared --disable-sdltest --disable-vorbistest
make
make install

Install Aacenc 

Code:
cd /usr/local/src
wget http://downloads.sourceforge.net/opencore-amr/vo-aacenc-0.1.2.tar.gz
tar xzvf vo-aacenc-0.1.2.tar.gz
cd vo-aacenc-0.1.2
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install

Install Yasm


Code:
cd /usr/local/src
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzfv yasm-1.2.0.tar.gz
cd yasm-1.2.0
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"
make
make install
export "PATH=$PATH:$HOME/bin"

Install Libvpx

Code:
cd /usr/local/src
git clone https://chromium.googlesource.com/webm/libvpx.git
cd libvpx
git checkout tags/v.1.3.0
./configure –disable-examples
make
make install

Install X264

Code:
cd /usr/local/src
git clone git://git.videolan.org/x264.git
cd x264
./configure –enable-static
make
make install

Time to configure the libraries path.

Code:
export LD_LIBRARY_PATH=/usr/local/lib/
echo /usr/local/lib >> /etc/ld.so.conf.d/custom-libs.conf
ldconfig

Configure ffmpeg - ( Note ./configure parameters should be one single line)

Code:
cd /usr/local/src
git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
git checkout release/2.5
PKG_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-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac \
--enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libvo-aacenc --enable-libxvid --disable-ffplay \
--enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads
make
make install

That's it, You are done now. Test the ffmpeg command on server and you should see the output as shown below.

Code:
ffmpeg version 2.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Mar 28 2014 01:28:21 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-4)
configuration: –enable-version3 –enable-libopencore-amrnb –enable-libopencore-amrwb –enable-libvpx –enable-libfaac –enable-libmp3lame –enable-libtheora –enable-libvorbis –enable-libx264 –enable-libvo-aacenc –enable-libxvid –disable-ffplay –enable-shared –enable-gpl –enable-postproc –enable-nonfree –enable-avfilter –enable-pthreads –extra-cflags=-fPIC
libavutil      52. 66.100 / 52. 66.100
libavcodec     55. 52.102 / 55. 52.102
libavformat    55. 33.100 / 55. 33.100
libavdevice    55. 10.100 / 55. 10.100
libavfilter     4.  2.100 /  4.  2.100
libswscale      2.  5.102 /  2.  5.102
libswresample   0. 18.100 /  0. 18.100
libpostproc    52.  3.100 / 52.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…

Some basic issues may arise which you can test by making sure which libaries are missing.

Code:
ldd `which ffmpeg`

Once you have the path for any missing library simply add it to /etc/ld.so.conf and issue a "ldconfig" command.

Thats all. Do let us know if you have any issues with the installation. We will be happy to assist you.



Thank You,
Inder Singh.
Founder & Chief Technical Officer.
https://www.24x7servermanagement.com/
Server Management | Server Monitoring | Server Security
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)