![]() |
My Top 3 |
![]() |
How to Install FFmpeg on Linux Server
FFmpeg is so important if you are planning to run a video website with streaming with conversion of video files to different video formats. This tutorial is intended for Centos/Redhat versions of Linux where any novice user can install ffmpeg without compiling the source which is a more traditional way of installing the FFmpeg software on linux servers. In this tutorial i will show you the easy way to install ffmpeg and ffmpeg-php (php extension) with just yum rather than compiling ffmpeg from source files.
yum install ffmpeg
If you get command not found, then you will need to add few lines in the yum repository for dag installation.
Create a file named dag.repo in /etc/yum.repos.d with the following contents on it
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
gpgcheck=1
enabled=1
then
yum update
yum install ffmpeg
If everything is fine, then the installation should proceed smoothly. If not you will get something like warning GPG public key missing .
To fix rpmforge GPG key warning:
For more information refer to this faq If you get missing dependency error like shown below, in the middle of ffmpeg installation then most commonly you have GLIB 2.3 installed instead of GLIB 2.4 version. To check the current GLIB version installed on your server. just use yum list glib* and it should list all the packages whether installed or not. Try to see whether Glibc 2.4 installed, if not you will need to download the glib2.4 source package and compile them manually. To fix dependency error: Once this is done try, yum install ffmpeg. In most cases your installation should be completed without any problems. To check the ffmpeg working: To check what audi/video formats are supported Open the ffmpeg-formats.txt to see the ooutput D means decode Install FFMPEG-PHP Extension tar -xjf ffmpeg-0.5.2.1.tbz2 phpize ./configure Common Errors If you get an error like shared libraries not found problem and the program halts in the middle, then you must specify the ffmpeg installed path explicitly to the ./configure. “configure: error: ffmpeg shared libraries not found. Make sure ffmpeg is compiled as shared libraries using the –enable-shared option” To Fix: 1. First find out the ffmpeg path with ffmpeg –help command. The prefix default path should be like /usr/local/cpffmpeg That should resolve the problem! Editing PHP.INI nano /usr/local/lib/php.ini Put the below two lines at the end of the php.ini file To check whether ffmpeg enabled with php, point your browser to test.php file. It should show the confirmation If any case the ffmpeg does not show in the phpinfo() test make sure that php.ini path to ffmpeg.so is correct. Still the problem occurs, the reason could be you might be using older versions of ffmpeg-php which is buggy. Just download the latest version of ffmpeg-php source then compile it. Useful Links Install FFmpeg from Compiling Source (Tutorial Link)
rpm -Uhv
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package ffmpeg
Error: Missing Dependency: is needed by package ffmpeg
Error: Missing Dependency: rtld(GNU_HASH) is needed by package ffmpeg
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package a52dec
Error: Missing Dependency: rtld(GNU_HASH) is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package gsm
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package x264
Error: Missing Dependency: rtld(GNU_HASH) is needed by package xvidcore
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package lame
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package a52dec
Error: Missing Dependency: rtld(GNU_HASH) is needed by package faad2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package x264
Error: Missing Dependency: rtld(GNU_HASH) is needed by package lame
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package xvidcore
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package faac
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package faad2
Error: Missing Dependency: libgif.so.4 is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package faac
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package gsm
Error: Missing Dependency: libpng12.so.0(PNG12_0) is needed by package imlib2
Error: Missing Dependency: rtld(GNU_HASH) is needed by package libmp4v2
Error: Missing Dependency: libc.so.6(GLIBC_2.4) is needed by package libmp4v2wget />./configure
make
make install
Finally, check the ffmpeg whether it is working or not.> ffmpeg
> ffmpeg -formats
> ffmpeg –help
// This lists path of mpeg, its modules and other path information
> ffmpeg -i Input.file Output.fileffmpeg -formats > ffmpeg-format.txt
E means encode
V means video
A means audio
T = Truncated
FFmpeg-php is a very good extension and wrapper for PHP which can pull useful information about video through API interface. Inorder to install it you will need to download the source file and then compile and install extension in your server. You can download the source tarball :
wget
make
make install
If you get command not found error for phpize, then you will need to do yum install php-devel
2. Configure the FFmpeg-php with –with-ffmpeg option./configure
Once you have done that without any problems then you will see the php extension file and you will need mention that extension in php.ini file[ffmpeg]
Then restart the server service httpd restart
FFmpeg />Mplayer + Mencoder />Flv2tool />Libogg + Libvorbis />LAME MP3 Encoder (http://lame.sourceforge.net)
Nice FFmpeg Installation Tutorial (click here)
Important Audio Codecs />Common Errors & Fixes while Installing FFmpeg (click here)



Leave a Reply