Install FFmpeg, FFmpeg-PHP, Mplayer, Mencoder, LAME MP3 encoder, FLVtool2, Libvorbis, GD 2, on Linux Ubuntu 8.10 XAMPP 1.7 server
This article covers how to install FFmpeg, FFmpeg-PHP, Mplayer, Mencoder, LAME MP3 encoder, FLVtool2, Libvorbis, GD library 2 on a Linux Ubuntu 8.10 Intrepid XAMPP 1.7 Apache web server.
If you are not using XAMPP, there will be some slight differences in the method of doing this and I recommend waiting for a future tutoral I plan on making.
Now this tutorial was created using a new installation of Ubuntu 8.10 Intrepid and already having installed XAMPP 1.7 for Linux. Please do not ask for support on other versions because I'm NOT a developer and I have no way of testing this on any other versions besides the ones used here. I spent several hours learning how to do this and putting it all together, so this is the only method I know. I also don't know a whole lot about troubleshooting this, so if it doesn't work, I may or may not be able to help you. In addition, finding help for it is next to impossible and therefore I can only give you what I know and you'll need to troubleshoot the rest.
There's two versions of this tutorial here; the written guide and the video.
You can use the Written Tutorial located below the video to copy/paste codes to save time and avoid mis-spelling. You may also find it more useful to follow along with.
The Video Tutorial:
The Written Tutorial:
- First we need to uninstall x264, libx264-dev, and ffmpeg if they are already installed. Open terminal and run the following command. Keep terminal open throughout this whole tutorial.
sudo apt-get purge ffmpeg x264 libx264-dev
- Next we need to get all of the packages we will need to install FFmpeg and x264.
sudo apt-get update
sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libfaad-dev libmp3lame-dev libtheora-dev libxvidcore4-dev libvorbis-dev
INSTALL x264
- We will get the most current source files from the official x264 git repository.
You can run ./configure --help to see what other features you can enable or disable.
cd ~/
sudo -s
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-shared
make
make install
ldconfig
INSTALL FFMPEG
- Now we will get the most recent source files from the official FFmpeg subversion repository.
You can run ./configure --help to see which options you can enable or disable. You may also leave off whichever options you do not need in the ./configure command.
** I also want to note, normally you would add --libogg here, but the recent version(s) of FFmpeg do not contain this option. At the time of writing this tutorial, I do not yet know what kind of impact not having this library enabled may or may not have on video scripts such as phpmotion and others requiring it. **
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-postproc --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-libx264 --enable-libxvid --enable-libvorbis --enable-shared --prefix=/usr
make clean && make
make install
This should complete your FFMPEG installation.
You may now delete the directories x264 and the ffmpeg that is inside of x264 if you like.
You may decide to keep them for future compiling if you need to make changes to the options you compiled them with.
INSTALL FFMPEG-PHP FOR UBUNTU 8.10 XAMPP 1.7
Now we will install FFMPEG-PHP. This is where XAMPP 1.7 will differ from any other Apache installation.
- Open your Synaptic Package Manager.
- Install the package php5-ffmpeg and any required dependencies.
- Now copy ffmpeg.so to your XAMPP php extension directory. You can use this command:
** Note: You can use [TAB] to finish typing directory names. Example: /php5/200[TAB] would finish the directory /php5/20060613+lfs/ . This is a MAJOR time saver! **
cp /usr/lib/php5/20060613+lfs/ffmpeg.so /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/
- Now re-open your Synaptic Package Manager and remove the following packages:
apache2-mpm-prefork, php5-gd, php5-ffmpeg, and libapache2-mod-php5 - Now change the permissions on the php.ini file using this command:
chmod 777 /opt/lampp/etc/php.ini
- Open /opt/lampp/etc/php.ini with the text editor.
Now scroll about half way down and find the section containing all of the extensions and add this line:
extension="ffmpeg.so" - Save and close php.ini.
- Now restart Apache using this command. If it's not running, you may still use this command to start it:
/opt/lampp/lampp restart
- Now open your browser and go to http://localhost/xampp/ and then click on phpinfo().
Scroll down and find ffmpeg. It should be between exif and filter.
** If it's not there, then you've probably missed something. Verify you copied ffmpeg.so to the correct folder for your php extensions. You may also want to check your Apache error log to see if there was any problems with loading it. **
If ffmpeg is there, then you've successfully installed ffmpeg-php.
INSTALL MPLAYER, MENCODER, AND FLVTOOL2
- You many now close Terminal. We will be using the Synaptic Package Manager to install the rest of these.
- Open your Synaptic Package Manager. Install the package mplayer, mencoder, flvtool2.
The packages are installed in the following places:
/usr/bin/flvtool2
/usr/bin/mplayer
/usr/bin/mencoder
ffmpeg is also in this same location:
/usr/bin/ffmpeg
This completes your install!
LAME MP3 ENCODER AND GD LIBRARY 2
LameMP3 encoder was installed in the first step. GD Library version 2 is already installed in Ubuntu 8.10. I'm not sure which package it is installed with, as I had no need to research it. If GD doesn't show up in your phpinfo and you're using Ubuntu 8.10, then please post it in the forum and I will research it and update this tutorial as well as help you find the correct package.
FINAL NOTES
As stated before, I really hope this works for you. This is once more the best tutorial I know of on how to do all of this and it actually work. Since I really don't know near as much about Linux as I do Windows (which even that isn't much), I'm not sure how much help I can offer if you encounter problems.
It was very disappointing to me to find how little support there is on each of these different components. I was very fortunate to happen to come across someone in IRC that helped me overcome the issue with ffmpeg-php. I will later try this on another distribution of Linux, probably Debian.
| Comments |
|
|
|
!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."
Last Updated (Saturday, 08 August 2009 00:33)






