ClassX

The ClassX Installation Guide for Developers


Author: Boris (bajdin@mpi-inf.mpg.de)
Edited by: Derek Pang (dcypang@stanford.edu)

This instruction is written for Ubuntu Linux distribution, but should in principle work for any Debian based Linux. Root priviledges are required for some tasks, so make sure you are a user which is added to the 'sudo' group. Only use root priviledges where indicated with a 'sudo' command!

Warning: The user guide might be out-of-date and contain errors. Please feel free to email us (classxteam@gmail.com) if you found any.

1. Prepare the installation:


1.1 Update the system and get compiling tools:

sudo apt-get update
sudo apt-get install build-essential

1.2 Install a text editor (for example, emacs)

sudo apt-get install emacs

to run emacs: emacs
to run as root: sudo emacs
save a file: CTRL+X CTRL+S
exit emacs: CTRL+X CTRL+C

2. Install apache2 web server:


sudo apt-get install apache2

Install h.264 module for apache2 for video streaming

sudo apt-get install apache2-threaded-dev

Download the module:

cd ~
wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.7.tar.gz
tar -zxvf apache_mod_h264_streaming-2.2.7.tar.gz

Install the module:

cd ~/mod_h264_streaming-2.2.7
./configure --with-apxs=`which apxs2`
make
sudo make install

Configure the module and restart apache2:

Edit file /etc/apache2/httpd.conf as root and add the following two lines (if the lines are already present then the module has been already installed):

LoadModule h264_streaming_module /usr/lib/apache2/modules/mod_h264_streaming.so
AddHandler h264-streaming.extensions .mp4

Restart apache:

sudo /etc/init.d/apache restart

2.2 Install php for apache

sudo apt-get install php5 libapache2-mod-php5
sudo /etc/init.d/apache2 restart

3. ClassX installation preparation:


3.1 System preparation

sudo apt-get install build-essential checkinstall git libfaac-dev libjack-jackd2-dev \
libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev \
libva-dev libvdpau-dev libvorbis-dev libx11-dev libxfixes-dev texi2html yasm zlib1g-dev \
subversion libbz2-dev

3.2 Download ClassX code

cd ~
svn co https://classx.svn.sourceforge.net/svnroot/classx classx

4. ClassX encoder installation


4.1 Install x264 codec

cd ~/classx/classXEncoder/x264
./configure
make
sudo make install

4.2 Install ffmpeg

cd ~/classx/classXEncoder/ffmpeg
./configure --enable-gpl --enable-libx264
make
sudo make install

4.3 Compile ClassXEncoder

cd ~/classx/classXEncoder
make

5. ClassX slide recognition installation


5.1 Install prerequisits

sudo apt-get install cmake imagemagick pkgconfig libbz2-1.0 libbz2-dev libgtk2.0-dev python-dev \
libavcodec53 libdc1394-22 libdc1394-dev libdc1394-22-dev libtiff4 libtiff4-dev libjasper-dev \
libjpeg62 libjpeg62-dev zlib1g zlib1g-dev libpng12-0 libpng12-dev subversion perl libwww-perl

5.2 Download and install OpenCV

cd ~
wget -O opencv.tar.bz2 'http://sourceforge.net/projects/opencvlibrary/files/latest/download?source=directory'
tar xjf opencv.tar.bz2
cd ~/ (e.g. ~/OpenCV-2.3.1)
mkdir release
cd release
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX= ../
make
sudo make install

5.3 Compile slideRecognition

cd ~/classx/slideRecognition
make clean
make all

6. Final steps


6.1 Copy folder ClassXWebSystem to /var/www

cd ~/classx
sudo cp -r ClassXWebSystem /var/www

6.2 Copy required files

cd slideRecognition
sudo cp image_matching/image_matching SIFT-V0.8.1/siftpp/sift slideChangeDetect/changeDetect slideMatch/slideMatch /var/www/ClassXWebSystem/system/publishers/bin/SlideSynchronizer/
cd ~/classx/classXEncoder
cp ClassXEncoder /var/www/ClassXWebSystem/system/publishers/bin/VideoEncoder/

6.3 Configure the system

cd /var/www/ClassXWebSystem
perl configure.pl

6.4 Change upload size limit:
In order to be able to upload large files we need to change the size limit set by php. To do that run

sudo emacs /etc/php5/apache2/php.ini

In there find these two lines:

post_max_size =
upload_max_filesize =

Replace existing numbers with 8000M (for example, change 8M to 8000M). Save the file and exit. Make sure NOT to change anything else. Then restart apache

sudo /etc/init.d/apache2 restart


Tip: to search for a line in emacs you can do the following: CTRL+S

7. The Admin Page


Immediately after you finish running configure.pl, you must visit your admin page because your admin login will be created on the first visit. The admin page will be at http://your.server.name/ClassX/admin. It will allow you to add and remove publishers from the system.

8. System Walkthrough and support


The file "WALKTHROUGH.pdf" contains instructions which will familiarize you with many aspects of the ClassX system. If you are facing any trouble with the setup and use of ClassX, please send us an email at classxteam@gmail.com

9. Troubleshooting


9.1 Problem configuring ffmpeg
If ./configure command for ffmpeg from step 4.2 does not work (complaining that libx264 was not found):

- If it is a 64-bit machine and gcc is not recognizing it then every time a ./configure is run it should be run as:
CFLAGS=-fPIC ./configure
- If it still doesn't work then it is a library issue (problem with static libraries). Shared libraries need to be used instead. Repeat step 4.1 for x264 with:
CFLAGS=-fPIC ./configure --enable-shared