Your Webhosting Questions
Answered by the Webhosting Experts
Tags
...
...

How to Install FFMPEG, FFMPEG-PHP, FLVTOOL, LAME, MPLAYER, LIBOGG, LIBVORBIS, and MENCODER

Download Tarballs to ‘src’ directory:

1 cd /usr/local/src

2 wget https://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz

3 wget https://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz

4 wget https://www.mplayerhq.hu/MPlayer/releases/mplayer-export-snapshot.tar.bz2

5 wget https://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2

6 wget https://downloads.xiph.org/releases/ogg/libogg-1.2.0.tar.gz

7 wget https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.1.tar.gz

8 wget https://www.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2

9 wget https://ffmpeg.org/releases/ffmpeg-0.6.tar.gz

 

Un-tar sources:

1 tar xvzf flvtool2-1.0.6.tgz

2 tar xvzf lame-3.98.4.tar.gz

3 tar jxvf ffmpeg-php-0.6.0.tbz2

4 tar xvzf libogg-1.2.0.tar.gz

5 tar xvzf libvorbis-1.3.1.tar.gz

6 tar jxvf essential-20071007.tar.bz2

7 tar jxvf mplayer-export-snapshot.tar.bz2

8 tar xvzf ffmpeg-0.6.tar.gz

 

Make a directory to store all the codecs:

1 # mkdir /usr/local/lib/codecs/

 

Install any necessary packages:

1 yum install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ ncurses-devel

 

Copy codecs for mplayer:

1 mv /usr/local/src/essential-20071007/* /usr/local/lib/codecs/

2 chmod -R 755 /usr/local/lib/codecs/

 

Installing Lame:

1 cd /usr/local/src/lame-3.98.4

2 ./configure

3 make && make install

 

Installing Libogg:

1 cd /usr/local/src/libogg*

2 ./configure && make && make install

3 Installing libvorbis:

view source

print?

1 cd /usr/local/src/libvorbis*

2 ./configure && make && make install

 

Installing flvtool2:

1 cd /usr/local/src/flvtool*

2 ruby setup.rb config

3 ruby setup.rb setup

4 ruby setup.rb install

 

Installing mplayer:

1 # cd /usr/local/src/mplayer*

2 ./configure && make && make install

 

Installing ffmpeg PHP module

1 cd /usr/local/src/ffmpeg-*

2 ./configure –enable-libmp3lame –enable-libvorbis –disable-mmx –enable-shared

 

(If you need to customize your install, run “./configure –help” to see a complete list of the available flags)

1 make && make install

 

 

1 ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50

2 ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51

3 ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49

4 ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0

5 ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51

 

Installing ffmpeg-php:

1 # cd /usr/local/src/ffmpeg-php*

2 phpize

3 ./configure

 

There’s a small issue in this version of ffmpeg-php which, when “make” is run, will cause the following error:

1 gcc -I. -I/usr/local/src/ffmpeg-php-0.6.0 -DPHP_ATOM_INC -I/usr/local/src/ffmpeg-php-0.6.0/include -I/usr/local/src/ffmpeg-php-0.6.0/main -I/usr/local/src/ffmpeg-php-0.6.0 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/local/include/libavcodec/ -I/usr/local/include/libavformat/ -I/usr/local/include/libavutil/ -I/usr/local/include/libswscale/ -I/usr/local/include/libavfilter/ -I/usr/local/include/libavdevice/ -I/usr/include/php -DHAVE_CONFIG_H -g -O2 -Wall -fno-strict-aliasing -c /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c -fPIC -DPIC -o .libs/ffmpeg_frame.o

2 /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zim_ffmpeg_frame_toGDImage’:

3 /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)

4 /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: (Each undeclared identifier is reported only once

5 /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:336: error: for each function it appears in.)

6 /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c: In function ‘zim_ffmpeg_frame_ffmpeg_frame’:

7 /usr/local/src/ffmpeg-php-0.6.0/ffmpeg_frame.c:421: error: ‘PIX_FMT_RGBA32’ undeclared (first use in this function)

8 make: *** [ffmpeg_frame.lo] Error 1

 

To correct this issue, we’ll update ffmpeg_frame.c and replace every instance of PIX_FMT_RGBA32 with PIX_FMT_RGB32

1 vi ffmpeg_frame.c

2 :%s/PIX_FMT_RGBA32/PIX_FMT_RGB32

3 :w :q!

 

Now we can proceed with compiling:

1 make

2 make install

 

Now that we’ve compiled, let’s make sure that ffmpeg.so is in the proper extensions directory:

1 php -i | grep extensions

2 /usr/local/lib/php/extensions/no-debug-non-zts-20060613

 

Now we’ll tell PHP that it needs to load our module:

1 echo ‘extension=ffmpeg.so’ >> /usr/local/lib/php.ini

 

Restart Apache:

1 service httpd restart

 

Now we’ll do a quick list of the modules to ensure that ffmpeg-php is loaded:

1 php -m | grep ffmpeg

2 ffmpeg

All done!

Need More Personalized Help?

If you have any further issues, questions, or would like some assistance checking on this or anything else, please reach out to us from your my.hivelocity.net account and provide your server credentials within the encrypted field for the best possible security and support.

If you are unable to reach your my.hivelocity.net account or if you are on the go, please reach out from your valid my.hivelocity.net account email to us here at: [email protected]. We are also available to you through our phone and live chat system 24/7/365.

Tags +
...