INTRODUCTION ------------ Cross Platform Video is an attempt to be able to view Live Capture Wireless Leiden Webcams at the browsers of all possible (mobile) devices aka live streaming to browser. We also put in video credits for promotion of the various organisations involved. Steaming is an expensive solution when it comes to bandwith, thus credits is the least we can give. We are using http://www.jplayer.org for the playback framework. Apache as webserver to serve the static content (like png and m3u8 files) and with proxy support to avoid exposing the ffserver. NGINX has also be used during development and proved to be working fine. We will use the development version of ffmpeg to be able to quickly submit bugfixes if needed. SUPPORT ------- Currently supported is:: iOS (iPad, iPhone) - m3u8 Android 2.3 - 4.0 - flv Android 3.0+ - m3u8 Android 4.0+ - webm Firefox 3.1+ - ogv Firefox 4+ - webm Internet Explorer - flv Opera 10.60+ - webm Opera 10.50+ - ogv m3u8 is short for Apple Live Streaming Protocol [hls_draft]_ flv is Flash Video, altough this is an old format, most nicer would be to support f4v using RTMP. This could for example be done by http://www.rtmpd.com. For Internet Explorer the native solution would be Smooth Streaming [smooth_streaming]_, but we have not found an suitable Open Source Server for this. INSTALL ------- As compiler we will use CLANG/LLVM, producing for more user friendly errors and warnings as gcc. Secondly the code seems faster at first glance. We are not solving the dependency packages for your local operating system. We assume you use a FreeBSD system or Fedora systems, both cases are tested. First we will need ffmpeg, this will be installed in $HOME/ff:: $ mkdir $HOME/src $ cd $HOME/src $ git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg $ ./configure --enable-libx264 --enable-gpl --prefix=$HOME/ff --enable-libvpx --cxx=clang --cc=clang --ld=clang \ --enable-libtheora --enable-libfreetype --enable-librtmp $ make install Now comes configuring the Apache webserver, we assume you are serving your content from /usr/local/www/htdocs/player/ijsclub:: $ mkdir -p /usr/local/www/htdocs/player $ cp -R htdocs-player /usr/local/www/htdocs/player/ijsclub $ ln -s player.html /usr/local/www/htdocs/player/ijsclub/index.html Configuration for Apache Webserver:: $ cp conf/apache-player.conf /usr/local/etc/apache22/Includes/ $ apachectl -k restart RUNNING ------- First we need to start the ffserver:: $ $HOME/ff/bin/ffserver -f conf/ffserver.conf & Now we need to start streaming to it. The play.sh example provide a usefull starting point for filtering the stream and streaming it to various formats:: $ ./play.sh ADDING MORE STREAMS ------------------- To allow streaming more steams you will need to duplicate and alter some settings. We assume you are going to create a stream called **foobar**: 1. Alter *conf/ffserver.conf* to include new steams, copy-paste and search-and-replace is a good starting method:: $ vim conf/ffserver.conf 2. Alter play script to point to new streams:: $ cp play.sh play-foobar.sh $ vim play-foobar.sh 3. Create an new player directory:: $ cp -R htdocs-player /usr/local/www/htdocs/player/foobar $ ln -s player.html /usr/local/www/htdocs/player/foobar/index.html 4. Alter player to point to new sources:: $ vim /usr/local/www/htdocs/player/foobar/player.html 5. Restart ffserver and start all play-*.sh instances. HACKING ------- Running an NGINX instance at port 8080 is quite usefull for development purposes, as it could just be run under the local user:: $ svn co svn://svn.nginx.org/nginx/trunk $HOME/src/nginx-trunk $ cd $HOME/src/nginx-trunk $ ./configure --prefix=$HOME/nx $ make install $ $HOME/nx/sbin/nginx -c conf/nginx.conf QUESTIONS OR COMMENTS --------------------- Send them to our tech mailinglist at techniek@lijst.wirelessleiden.nl, to subscribe to it http://lijst.wirelessleiden.nl/mailman/listinfo/techniek REFERENCES ---------- -- [dev_guide] https://developer.android.com/guide/appendix/media-formats.html -- [hls_draft] http://tools.ietf.org/html/draft-pantos-http-live-streaming-10 -- [smooth_streaming] http://www.iis.net/downloads/microsoft/smooth-streaming