Linux VPS Hosting : FFMPEG Installation

How to install FFmpeg on
Linux
VPS Hosting?

FFmpeg is an important application software which is used to run a video website with streaming with conversion of video files into various video formats. By following the below steps you can install FFmpeg software easily on Linux VPS Hosting without compiling the files.

yum install ffmpeg

If you will get command not found, then you will have 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
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1

then

yum update

yum install ffmpeg

If everything works fine, then the installation should proceed smoothly and if not then you will get something like warning GPG public key missing .

To fix rpmforge GPG key warning:

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

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 will list all the packages whether installed or not. Try to see whether Glibc 2.4 installed, if not you will need to upgrade your Centos to latest version of 5.

How to check the ffmpeg working?
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.file

To check what audi/video formats are supported
ffmpeg -formats > ffmpeg-format.txt

Open the ffmpeg-formats.txt to see the ooutput

D means decode
E means encode
V means video
A means audio
T = Truncated

How to install FFMPEG-PHP Extension?

FFmpeg-php is a very good extension and wrapper for PHP which can pull useful information about video through API interface on a Linux VPS Hosting. Inorder to install it you will have to download the source file and then compile and install extension on your server. You can download the source tarball from : http://ffmpeg-php.sourceforge.net/

wget /path/to/this/file/ffmpeg-php-0.5.2.1.tbz2

tar -xjf ffmpeg-0.5.2.1.tbz2

phpize

./configure
make
make install

Common types of Errors are as follows:-

1)If you get command not found error for phpize, then you will need to do yum install php-devel

2)If you get an error like shared libraries not found problem and the program stops in the middle, then you must specify the ffmpeg installed path explicitly to the ./configure.

3)“configure: error: ffmpeg shared libraries not found. Make sure ffmpeg is compiled as shared libraries using the –enable-shared option”

How to fix these errors:

1) First find out the ffmpeg path with ffmpeg –help command. The prefix default path should be like /usr/local/cpffmpeg
2) Configure the FFmpeg-php with –with-ffmpeg option

./configure –with-ffmpeg=/usr/local/cpffmpeg

Tags: , , ,

Leave a Reply