Skip to content

Instantly share code, notes, and snippets.

@lucasa
Forked from newbamboo/local_installation.markdown
Created October 17, 2012 20:46
Show Gist options
  • Save lucasa/3908072 to your computer and use it in GitHub Desktop.
Save lucasa/3908072 to your computer and use it in GitHub Desktop.

Installing Panda on your local machine or server

This guide is an alternative to using the prebuilt AMI which includes all the software required to run Panda.

Please note that this guide been mainly tested on OSX and Ubuntu. Please post modifications to the mailing list if you try another platform.

Before starting, your system must have a working Ruby (1.8.x) installation along with Rubygems (>= 1.3.1) and MySQL running happily.

Install dependencies

First install the following gems:

sudo gem install extlib dm-core dm-timestamps dm-migrations --no-ri --no-rdoc -v 0.9.11
sudo gem install merb-core merb-assets merb-helpers merb-mailer merb_datamapper --no-ri --no-rdoc -v 1.0.11
sudo gem install data_objects do_mysql --no-ri --no-rdoc -v 0.9.11
sudo gem install activesupport --no-ri --no-rdoc -v 2.1.1
sudo gem install mongrel uuid RubyInline aws-s3 flvtool2 --no-ri --no-rdoc

Next you'll need to install libgd, ffmpeg, and the rvideo gem:

Ubuntu / Debian

apt-get install libgd2-noxpm libgd2-noxpm-dev

On OSX (using macports)

Installing gd2 with macports seems to be the fastest way to install the required dependencies:

sudo port install gd2

For some reason (which I've not really looked into) the macports install doesn't quite install everything so you still need to install libgd itself (but not the dependencies) from source:

mkdir -p ~/src && cd ~/src
curl http://www.libgd.org/releases/gd-2.0.35.tar.gz > gd-2.0.35.tar.gz
tar zxvf gd-2.0.35.tar.gz
cd gd-2.0.35 && ./configure && make && sudo make install

Alternatively, if you want to build everything from source, see this tutorial. Here's a possible gotcha.

Other platforms

The following libraries are required for libgd:

All can be downloaded and installed with a simple configure, make install.

RVideo (0.9.4)

We're using greatseth's brach of RVideo which is being actively developed:

gem install greatseth-rvideo -s http://gems.github.com --no-ri --no-rdoc

Install the rvideo tools (on OS X at least - your system may differ). You might want to check your gem library location (gem env).

sudo cp lib/rvideo/tools/*.rb /Library/Ruby/Gems/1.8/gems/rvideo-0.9.4/lib/rvideo/tools/.

FFMPEG

Ubuntu / Debian

We must compile from source to get codecs we want. Instructions are based on this guide: http://ubuntuforums.org/showthread.php?t=786095&highlight=libx264

Get the deps:

apt-get install faad libfaad-dev libfaac0 libmp3lame0 libmp3lame-dev libxvidcore4 libxvidcore4-dev libtheora-dev zlib1g-dev libfaad-dev libfaac-dev libvorbis-dev libschroedinger-dev libspeex-dev libgsm1-dev build-essential checkinstall yasm

Install x286:

git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-shared
make
checkinstall --fstrans=no --install=yes --pkgname=x264 --pkgversion "1:0.svn`date +%Y%m%d`-0.0ubuntu1" --default
ldconfig

Grab FFMpeg and compile:

wget http://ffmpeg.org/releases/ffmpeg-0.5.tar.bz2
tar xjf ffmpeg-0.5.tar.bz2
cd ffmpeg-0.5
./configure --disable-debug --enable-postproc --enable-pthreads --enable-nonfree --enable-shared --enable-libx264 --enable-gpl --enable-libfaad --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis  --enable-libxvid --enable-libvorbis --enable-libgsm --prefix=/usr
make
checkinstall --fstrans=no --install=yes --pkgname=ffmpeg --pkgversion "3:0.svn`date +%Y%m%d`-12ubuntu3" --default

On OS X

Available in all good package repositories including Darwin Ports.

sudo port install ffmpeg +x264 +faac

If you're developing on Mac OS X, you can save some time by grabbing ffmpeg out of the ffmpegX application instead of compiling it.

Check ffmpeg works

Running ffmpeg --formats should be enough to ensure your install is sane.

Setup Panda

You should follow the getting started guide from the configure panda section onwards. You'll might also want to use the filesystem storage option instead of S3 if this is an installation outside of Amazon's Web Services.

Controlling Panda

Once you have Panda configured, you can start the application from inside its directory like so:

merb

To start the encode and notifier you can use the following commands:

merb -e encoder -p 5000 -r bin/encoder.rb
merb -e notifier -p 5001 -r bin/notifier.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment