How to Install FFmpeg on a shared Server ” Dreamhost”
Posted by Fahdos on Sep 16th, 2008 in Web & Design
Some of you, probably, will or want to create a video website like YouTube (YoutTube clone). To be able to do so you’re going to need ffmpeg, lame, libvorbis and other programs installed on your server. Today, I’ll explain how to install them easily.
There are two methods to do it, the dirty one and the easy (very easy) one. I’ll start with the dirty one:
How to manually install ffmpeg, lame, libogg, libvorbis…
This is exactly how I did it last year (how we did it :D cos Fay helped me) :P
First of all, you have to login to your server using SSH as the owner account of your directory, and because I’m not a Linux user I used Putty (http://www.putty.org)
Create these directories, and set their correct permissions
$ chmod 777 tmp
$ chmod 775 bin lib
mkdir: creates the directory
chmod: sets the correct permissions for the directory
Export these variables
$ export PATH=$HOME/bin:$PATH
$ export LD_LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH
$ export CPATH=$HOME/include:/usr/local/include:$CPATH
$ export LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LIBRARY_PATH
$ mkdir src
$ cd src
Autoconf
$ tar -zxf autoconf-2.63.tar.gz
$ cd autoconf-2.63
$ ./configure –prefix=$HOME
$ make && make install
$ cd ..
LAME:
$ tar -zxvf lame-398.tar.gz
$ cd lame-398
$ ./configure "–prefix=$HOME" "–enable-shared"
$ make && make install
$ cd..
Libogg
$ tar -zxf libogg-1.1.3.tar.gz
$ cd libogg-1.1.3
$ ./configure –prefix=$HOME
$ make && make install
$ cd ..
Libvorbis
$ tar -zxf libvorbis-1.2.0.tar.gz
$ cd libvorbis-1.2.0
$ ./configure –prefix=$HOME
$ make && make install
$ cd ..
Mplayer:
$ bunzip2 essential-20061022.tar.bz2
$ tar -xf essential-20061022.tar
$ mv essential-20061022 $HOME/lib
$ wget http://www3.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc1.tar.bz2
$ bunzip2 MPlayer-1.0rc1.tar.bz2
$ tar -xf MPlayer-1.0rc1.tar
$ cd MPlayer-1.0rc1
$ ./configure –prefix=$HOME –with-codecsdir=$HOME/lib/essential-20061022/
$ make && make install
$ cd ..
Amr
$ wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.2.tar.bz2
$ gunzip amrnb-7.0.0.0.tar.bz2
$ gunzip amrwb-7.0.0.2.tar.bz2
$ tar xvf amrnb-7.0.0.0.tar
$ tar xvf amrwb-7.0.0.2.tar
$ cd amrnb-7.0.0.0
$ ./configure –prefix=$HOME
$ make && make install
$ cd ..
$ cd amrwb-7.0.0.2
$ ./configure –prefix=$HOME
$ make && make install
$ cd ..
FFmpeg
$ cd ffmpeg
$ ./configure –prefix=$HOME –cross-compile –enable-shared –enable-libmp3lame –enable-libamr-nb –enable-libamr-wb –extra-cflags=-I$HOME/include –extra-ldflags=-L$HOME/lib
$ make && make install
$ cd..
Test :
Now you can test to convert for exemple an AVI file to flv.
Here is the command I use to generate FLVs:
Exemple :
Cooool, It works
But there’s still one problem; after restarting your server you’ll get this error while trying to do the test again
bin/ffmpeg: error while loading shared libraries: libavformat.so.51: cannot open shared object file: No such file or directory
The solution is quite simple
Login with SSH again and tape:
i
Then past these lines:
export PATH=$HOME/bin:$PATH
export LD_LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LD_LIBRARY_PATH
export CPATH=$HOME/include:/usr/local/include:$CPATH
export LIBRARY_PATH=$HOME/lib:/usr/local/lib:$LIBRARY_PATH
Tape the Esc key then tape
Restart your server and test it again, now it will work
How to Automatically install ffmpeg, lame, libogg, libvorbis…
We will use The ffmpeginstall Script for the shared server:
This series of scripts will install all required modules for running video streaming application websites in a shared environment. A number of webhosts provides large amount of disk space and normal shell access to your Linux server. So now you can setup your own ffmpeg environment in a shared account.
To do so, just visit www.ffmpeg.sherin.in
It will install all you need with just few clicks. Documentation
NB: the website maybe down, so please download the file from :
Automatic Installation (11.8 KiB, 1,151 hits)
For instruction, open the INSTALL File.
Have Fun :D








Sep 19th