Install FFmpeg on CentOS or RedHat EL 6.x
If you are upgrading from a previous version of Razuna you should always update your ImageMagick, Exiftool and Ffmpeg installation!
The following install steps have been proven to work on RedHat Enterprise Linux 6.2 and 6.5. You can check which version you are running with
cat /etc/redhat-release |
Additionally, we assume that you are connected and registered with the Red Hat network and/or updated the system with the latest updates from the repositories.
Follow this guide step by step!
Install the additional repo
rpm -Uhv http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm |
Update repository
yum -y update |
Install all necessary packages
yum install glibc gcc gcc-c++ autoconf automake libtool git make nasm pkgconfigyum install SDL-devel a52dec a52dec-devel alsa-lib-devel faac faac-devel faad2 faad2-develyum install freetype-devel giflib gsm gsm-devel imlib2 imlib2-devel lame lame-devel libICE-devel libSM-devel libX11-develyum install libXau-devel libXdmcp-devel libXext-devel libXrandr-devel libXrender-devel libXt-develyum install libogg libvorbis vorbis-tools mesa-libGL-devel mesa-libGLU-devel xorg-x11-proto-devel zlib-develyum install libtheora theora-toolsyum install ncurses-develyum install libdc1394 libdc1394-develyum install amrnb-devel amrwb-devel opencore-amr-devel |
Install xvid
cd /optwget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gztar xzvf xvidcore-1.3.2.tar.gzcd xvidcore/build/generic./configure --prefix="$HOME/ffmpeg_build"makemake install |
Install LibOgg
cd /optwget 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 install |
Install Libvorbis
cd /optwget 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 install |
Install Libtheora
cd /optwget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.gztar xzvf libtheora-1.1.1.tar.gzcd libtheora-1.1.1./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-examples --disable-shared --disable-sdltest --disable-vorbistestmakemake install |
Install Aacenc
cd /optwget http://downloads.sourceforge.net/opencore-amr/vo-aacenc-0.1.2.tar.gztar xzvf vo-aacenc-0.1.2.tar.gzcd vo-aacenc-0.1.2./configure --prefix="$HOME/ffmpeg_build" --disable-sharedmakemake install |
Install Yasm
yum remove yasmcd /opt wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gztar xzfv yasm-1.2.0.tar.gzcd yasm-1.2.0./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"makemake installexport "PATH=$PATH:$HOME/bin" |
Install Libvpx
cd /optgit clone http://git.chromium.org/webm/libvpx.gitcd libvpxgit checkout tags/v.1.3.0./configure --prefix="$HOME/ffmpeg_build" --disable-examplesmakemake install |
Install X264
cd /optgit clone git://git.videolan.org/x264.gitcd x264./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" --enable-static makemake install |
Note: (Sometimes the network might be down. Then you can also grab it via wget at ftp://ftp.videolan.org/pub/videolan/x264/snapshots/last_stable_x264.tar.bz2) and then use “tar xvjf last_xxx” to extract.
Configure Libraries
export LD_LIBRARY_PATH=/usr/local/lib/echo /usr/local/lib >> /etc/ld.so.conf.d/custom-libs.confldconfig |
Compile FFmpeg (the configure options have to be on one line)
cd /optgit clone git://source.ffmpeg.org/ffmpeg.gitcd ffmpeggit checkout release/2.2PKG_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 makemake install |
(The –arch=x86_64 option should only be used if you are on a 64Bit System!)
You can also use their Github repository at https://github.com/FFmpeg/FFmpeg.git.
That’s it. This should give you a full functional FFMpeg installation for Razuna. Test it now with;
ffmpeg |
This should give you the following back (yours might vary a bit);
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.100Hyper fast Audio and Video encoderusage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... |
Try to convert a movie with;
ffmpeg -i movie.mov -vcodec libx264 -vpre hq -acodec libfaac movie.mp4 |
Troubleshoot
It could be that you run into issues with a message of “ffmpeg: error while loading shared libraries….:. This simply means that it can’t find the required libraries, in short you need to add them to the linked library configuration.
Check what libraries are missing with:
ldd `which ffmpeg` |
This will give you a list of libraries ffmpeg is using. If any of them are marked with “not found” then search for the missing library in question, e.g. “libswresample.so.0” with:
find / -name libswresample.so.0 |
Once you have the path simply add it to /etc/ld.so.conf and issue a “ldconfig”.
This should get you ffmpeg up and running.
If you have problems with swscale while compiling
Try to get swscale sperate from svn tree
cd ffmpegcd libswscalesvn switch svn://svn.ffmpeg.org/mplayer/trunk/libswscale -r 29857 |
than just try to compile ffmpeg again
You can also try to
git clone https://github.com/FFmpeg/FFmpeg.git ffmpeg
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20110131.tar.bz2
wget ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-snapshot-20120412-2245.tar.bz2