-
Updated - Setup Red5 and FFMPEG on Ubuntu 8.0.4
Posted on August 14th, 2009 No comments
This an updated version of my previous post here. This version contains some of the latest software updates. Please note that this install may not work for 64bit system. If you can make it work for 64bit system, please let me know.Please note that a wrong software version could lead to compatibility issues, so I can’t guarantee it will work if you don’t download the version I specified in the instructions. This instruction is targeted to Ubuntu 8.04, but with some tweaks it should work for all linux O/S
Setup Red5 v0.7.0 on Ubuntu Hardy 8.04
Prerequisits
Please note that while installing java-package, you need to force install and agree to Suns Java service agreement (F12 in command line, or click on yes if using package manager)
sudo apt-get install java-package
sudo apt-get install sun-java6-jdk
sudo apt-get install sun-java6-jre
export JAVA_HOME=/usr/lib/jvm/java-1.6.0-sun/Download Red5 v0.7.0
http://www.red5.fr/release/0.7.0/debian/red5_0.7.0_all.deb
Install Red 5
sudo dpkg -i red5_0.7.0_all.debOnce installed, you can start/stop/restart by:
sudo /etc/init.d/red5 start|stop|restartRed5 is installed under the following directory by default:
/usr/lib/red5
To verify installation, use the port 5080 to test Red5:
run some demo and make sure everything works
Setup FFMPEG on Ubuntu Hardy 8.04
First make sure the system is up to date
sudo apt-get update
sudo apt-get upgradePrerequisites
sudo apt-get install libjpeg-progs libjpeg62 libjpeg62-dev
sudo apt-get install libsdl1.2-dev php5-dev build-essential
sudo apt-get install unzip subversion ruby libcurses-rubyMake a dir for downloads and operations
sudo mkdir /usr/local/ffmpegsource
cd /usr/local/ffmpegsourceDownload software
- MPlayer Binary Codec Packages: http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2
- FLVTool2: http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
- Lame: http://downloads.sourceforge.net/project/lame/lame/3.97/lame-3.97.tar.gz
- Libogg: http://downloads.xiph.org/releases/ogg/libogg-1.1.4.tar.gz
- libvorbis: http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.3.tar.gz
- amrnb: http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2
- amrwb: http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2
- libtheora: http://downloads.xiph.org/releases/theora/libtheora-1.0.tar.bz2
- Ffmpeg-php: http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.6.0.tbz2
Unzip the downloaded files
sudo tar zxvf lame-3.97.tar.gz
sudo tar zxvf libogg-1.1.4.tar.gz
sudo tar zxvf libvorbis-1.2.3.tar.gz
sudo tar zxvf flvtool2-1.0.6.tgz
sudo tar jxvf essential-20071007.tar.bz2
sudo bzip2 -cd amrnb-7.0.0.2.tar.bz2 | sudo tar xvf -
sudo bzip2 -cd amrwb-7.0.0.3.tar.bz2 | sudo tar xvf -
sudo bzip2 -cd libtheora-1.0.tar.bz2 | sudo tar xvf -
sudo tar jxvf ffmpeg-php-0.6.0.tbz2Use Subversion to checkout ffmpeg
sudo svn co -r 19352 svn://svn.mplayerhq.hu/ffmpeg/branches/0.5 ffmpeg
sudo svn co -r 29230 svn://svn.mplayerhq.hu/mplayer/branches/1.0rc3 mplayerCopy Codecs for mplayer
sudo mkdir /usr/local/lib/codecs
sudo mv /usr/local/ffmpegsource/essential-20071007/* /usr/local/lib/codecs/
sudo chmod -R 755 /usr/local/lib/codecs/
make tmp dir for mplayer
sudo mkdir /usr/local/ffmpegsource/tmp
sudo chmod 777 /usr/local/ffmpegsource/tmp
export TMPDIR=/usr/local/ffmpegsource/tmpInstall lame
cd /usr/local/ffmpegsource/lame-3.97
sudo ./configure
sudo make && sudo make installInstallĀ libogg
cd /usr/local/ffmpegsource/libogg-1.1.4
./configure
sudo make && sudo make installInstall libvorbis
cd /usr/local/ffmpegsource/libvorbis-1.2.3
./configure
sudo make && sudo make installInstall flvtool2
cd /usr/local/ffmpegsource/flvtool2-1.0.6/
sudo ruby setup.rb config
sudo ruby setup.rb setup
sudo ruby setup.rb installInstall mplayer & mencoder
cd /usr/local/ffmpegsource/mplayer
sudo ./configure --enable-jpeg
sudo make && sudo make installInstall AMR
AMRNB
cd /usr/local/ffmpegsource/amrnb-7.0.0.2
./configure
sudo make && sudo make install
AMRWB
cd /usr/local/ffmpegsource/amrwb-7.0.0.3
./configure
sudo make && sudo make installInstall libtheora (for ogg video encoding)
cd /usr/local/ffmpegsource/libtheora-1.0
./configure
sudo make && sudo make installInstall ffmpeg
cd /usr/local/ffmpegsource/ffmpeg/
sudo ./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared --enable-libamr-nb --enable-libamr-wb --enable-nonfree --enable-libtheora
sudo make
sudo make install
sudo ln -s /usr/local/lib/libavdevice.so.52 /usr/lib/libavdevice.so.52
sudo ln -s /usr/local/lib/libavformat.so.52 /usr/lib/libavformat.so.52
sudo ln -s /usr/local/lib/libavcodec.so.52 /usr/lib/libavcodec.so.52
sudo ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
sudo ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
sudo ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51
sudo ln -s /usr/local/lib/libamrnb.so.3 /usr/lib/libamrnb.so.3
sudo ln -s /usr/local/lib/libamrwb.so.3 /usr/lib/libamrwb.so.3Install ffmpeg-php
cd /usr/local/ffmpegsource/ffmpeg-php-0.6.0/
phpize
./configure
make
make install
modify php.ini to load ffmpeg-php and restart apache
sudo vim /etc/php5/apache2/php.ini
extension=ffmpeg.so (add this line to the end of the file)
sudo /etc/init.d/apachpe2 restartTest your ffmpeg setup
There are many ways to test your ffmpeg setup such as using command line. But using the PHP class phpvideotoolkit to test your setup and quick and easy.
You can download the toolkit at:
Run the examples provided and see if everything works as expected.
Note that phpvideotoolkit may still use ‘mp3′ as -acodec option, you need to change it to ‘libmp3lame’
That’s all. Hopefully this can help you save some time and any comment is welcomed!
Resources
- http://osflash.org/red5/ubuntu804
- http://luar.com.hk/blog/?p=669
- http://vexxhost.com/blog/2007/03/03/installing-ffmpeg-ffmpeg-php-mplayer-mencoder-flv2tool-lame-mp3-encoder-libogg-%E2%80%93-the-easy-way/
- http://rootit.org/2008/06/installing-ffmpeg-ffmpeg-php-other-dependencies-for-clipshare/
- FFmpeg, FFmpeg-PHP, Lame, Libogg, Libvorbis, FLVtool2, Mplayer, Mencoder, AMR Installation
- http://forums.theplanet.com/index.php?showtopic=64541
- http://luar.com.hk/blog/?p=670
Leave a reply


