Video Streaming
VideoWhisper RTMP Web Session Check
0For sites and integrations where additional security measures are required, VideoWhisper applications support login session check on RTMP side.
This is used to make sure no clients will be able to connect to rtmp server without having previously logged in with the _login.php scripts.
When a new client tries to connect to RTMP server with a session name, rtmp application will check on the web server if that client session exists. If web server does not confirm that client logged in, rtmp server will reject the connection. RTMP server will also check for a webKey that needs to be configured same way on rtmp and web server: this will prevent connections in case of web domain hijacking.
Notes
- This will disable connections from external encoders (ie. FMLE) and players (ie. JwPlayer) to that rtmp address, as these will not provide a session name to check for validity.
- Usually, each installation will require its own rtmp side that checks session info with that installation. Otherwise you will have to tweak scripts to check on all installations.
RTMP Configuration
RTMP side web session check is currently supported for Wowza rtmp side. Download latest version of Wowza rtmp side, deploy to your server and update these settings in conf/videowhisper-web/Application.xml :
…
<Properties>
<Property>
<Name>acceptPlayers</Name>
<Value>true</Value>
</Property>
<Property>
<Name>webLogin</Name>
<Value>http://installation_url/rtmp_login.php?s=</Value>
</Property>
<Property>
<Name>webKey</Name>
<Value>VideoWhisper</Value>
</Property>
<Property>
<Name>webLogout</Name>
<Value>http://installation_url/rtmp_logout.php?s=</Value>
</Property>
</Properties>
</Application>
Then restart WowzaMediaServer service. For troubleshooting check Wowza access logs. If errors occur in the error logs submit a ticket to VideoWhisper about this.
Web Configuration
Download latest Video Conference php edition and check these integration files:
rtmp.inc.php – stores session info when user authenticates from vc_login.php ; contains $webKey if you want to change it
rtmp_login.php – called by rtmp server to see if a session name is valid (authenticated); also gets canKick permission to allow user to kick clients
rtmp_logout.php – called by rtmp server when client with a session name disconnected (to cleanup session)
Configure settings.php to use the videowhisper-web rtmp address.
To integrate this on other editions or installations you will need to copy the 3 files mentioned above to installation folder and include rtmp.inc.php in the _login.php scripts that authorize the user.
Other changes could be required depending on particularities of each integration.
Sample Demo Configuration
Installation url: http://www.videowhisper.com/demos/vc_web
Using rtmp address: rtmp://videowhisper.com/videowhisper-web
<Property>
<Name>webLogin</Name>
<Value>http://www.videowhisper.com/demos/vc_web/rtmp_login.php?s=</Value>
</Property>
<Property>
<Name>webKey</Name>
<Value>VideoWhisper</Value>
</Property>
<Property>
<Name>webLogout</Name>
<Value>http://www.videowhisper.com/demos/vc_web/rtmp_logout.php?s=</Value>
</Property>
Related Posts:
Install Red5 on Debian
0At least Debian 5 (Lenny) required.
Checkout release:
cat /proc/version
uname -a
cat /etc/issue
cat /etc/debian_version
If system is not in English, enable that:
dpkg-reconfigure locales
export LANG=en_US.UTF-8
Update /etc/enviroment
You may need to reboot.
Update:
apt-get update
Install Subversion:
apt-get -y install subversion
Install tools to build your own Debian packages:
apt-get -y install dpkg-dev debhelper dh-make devscripts fakeroot
Install Java (accept sun license if applies):
apt-get -y install java-package
apt-get -y install sun-java6-jre
apt-get -y install sun-java6-jdk
java -version
Install Apache Ant:
wget http://www.apache.org/dist/ant/binaries/apache-ant-1.8.2-bin.tar.gz
tar zxvf apache-ant-1.8.2-bin.tar.gz
mv apache-ant-1.8.2 /usr/local/ant
export ANT_HOME=/usr/local/ant
/usr/local/ant/bin/ant -version
Download the latest development version of Red5:
svn co http://red5.googlecode.com/svn/java/server/trunk red5-trunk
Run ant to build red5:
cd red5-trunk
/usr/local/ant/bin/ant
Deploy red5:
mkdir /usr/local/red5
cp -R dist/* /usr/local/red5/
cd /usr/local/red5
chmod 755 red5.sh
Deploy your custom apps in/usr/local/red5/webapps .
In example VideoWhisper Red5 RTMP application needed to run VideoWhisper solutions.
Start Red5 in background:
cd /usr/local/red5
./red5.sh >> red5.log &
Verify the correct ports are being bound to:
netstat -ant
You need to restart red5 each time you add webapps to /usr/local/red5/webapps or change configuration.
Close Red5:
cd /usr/local/red5
./red5-shutdown.sh
Or kill Red5 processes:
ps aux | grep red5
kill $process_id
Then start it again:
cd /usr/local/red5
./red5.sh >> red5.log &
Related Posts:
Setting up VideoWhisper RTMP on Influxis
0If you have a FMS account with Influxis, use these instructions for setting up a new application:
1. Create application from Tools > New App Builder or My Applications > Add New Application. Use any name i.e. “videowhisper” and save generated rtmp path.
2. From Tools > File Manager / File Admin edit videowhisper/main.asc file and make sure it has the contents of videowhisper/main.asc (open it with notepad or other text editor). If needed select all from text editor (CTRL+A), copy (CTRL+C), move to form, select all from there (CTRL+A), paste from clipboard (CTRL+V).
Get VideoWhisper FMIS rtmp side from Downloads : RTMP VideoWhisper Applications > FMIS .
3. From Account Settings > Domain Permissions, Set Referring Domain(s), Add New Domain – add your domain that hosts the flash (i.e. your-domain.com)
4. Reset the VHost for your Influxis account so it loads new applications or updates.
In your Influxis account go to My Applications > FCS Administration Console: Connect then go to Maintenance : Adaptor / VHost: Restart .
Related Posts:
Playback RTMP with JW Player
You can publish a rtmp stream to a rtmp address and then playback with an external player like JWPlayer.
If you publish StreamName to rtmp address rtmp://your-rtmp-address-here then you will need to configure JW Player:
var flashvars = { file: StreamName.flv, streamer: rtmp://your-rtmp-address-here, autostart:”true”, type:”rtmp”}
Webcam video streams can be published from web with a video Live Streaming broadcasting script. With the VideoWhisper Live Streaming soulution, StreamName is channel name (in example Studio586). Important: As latest VideoWhisper solutions also support P2P streaming, these need to be configured with alwaysRTMP=1 parameter in their _login.php or equivalent script so streams are always published to RTMP server.
If you want to publish for other devices special encoders and codecs would be required. Using an external encoder you can encode with codecs and settings not available in browser flash player (due to flash limitations). Not all encoders and versions are compatible with all rtmp servers and versions. Some require special configuration and usage instructions.
Adobe Flash Media Live Encoder can be used for Adobe Media Interactive server and is also reported to work with Wowza.
Wowza & Wirecast documentation and support is available for Wowza Media Server hosting.
Note that when publishing H.264, video player should be configured to play StreamName.mp4 instead of StreamName.flv .
Related Posts:
Configuring Flash Live Video Streaming Applications
Measure connection capabilities
To configure flash applications streaming you will first need to determine the connections that most users will have. So test first with your connection and also request other users to test.
So let’s consider this situation determined by http://www.speedtest.net (measure speed to a server close to the location of your streaming server):
Download: 9.43Mbp/s
Upload: 0.49Mbps
This looks like ADSL (in this situation upload bandwidth is 20 times lower than total connection bandwidth).
0.49 Mbps = 502 Kbps (kilobits per second)
8 bits = 1 byte, so that means you can upload with 62 kb/s (kilobytes per second)
As you can see, usually, connection is the cause of quality and latency limitations. A server with 1000Mbps connection will theoretically be able to handle up to 2000 x 0.49Mbps streams, so the server is not the problem with your tests, unless you’re on a shared plan and other clients are maxing out the resources.
How to configure flash videochat applications?
Considering you also have to upload audio and other data on that connection, you could setup camBandwidth to 49152 bytes/s (allocate for the compressed video stream).
On chat systems buffering should be reduced to 0.1 so delays are minimized. On 1 way streaming systems, you can use higher buffering to increase fluency in case of connection turbulence.
Flash streaming applications vs Skype
Skype desktop application uses different technology than these web based applications limited by browser based flash technology limitations . Skype uses:
- p2p connections between all users and also uses fast 3rd users as proxies (not using server – so if you are in the same local network with the other tester or with a 3rd skype client with better connection, it uses the local bandwidth)
- better codecs to get better quality for same bandwidth (flash player currently encodes only h263 and external encoders must be used to encode h264)
Related Posts:
Red5 Linux Server Optimizations and Tools
Some java optimizations to add in red5.sh :
export JAVA_OPTS=”-Xrs -Xms128M -Xmx256M -Dsun.rmi.dgc.client.gcInterval=300000 -Dsun.rmi.dgc.server.gcInterval=360000 -Djava.net.preferIPv4Stack=true -XX:+ExplicitGCInvokesConcurrent -XX:+UseConcMarkSweepGC -Xverify:none”
Assuming red5 was installed in /opt/red5/dist admin will often need to restart it or check if it’s running.
Make sure Red5 restarts: restart.sh
#!/bin/bash
#Restart the process
#First see if running
PID=`ps -eo ‘tty pid args’ | grep ‘red5′ | grep -v grep | grep -v restart | tr -s ‘ ‘ | cut -f2 -d ‘ ‘`
cd /opt/red5/dist
if [ -z "$PID" ]
then
#not running
echo “Red5 was not running at `date`” >> /opt/red5/dist/run-restart.log
else
echo “Red5: $PID”
#shutdown
/opt/red5/dist/red5-shutdown.sh
sleep 6
#make sure
kill $PID >> null
sleep 2
fi
#start
/opt/red5/dist/red5.sh >> /opt/red5/dist/red5.log &
echo “On request restarted Red5 at `date`” >> /opt/red5/dist/run-restart.log
Mare sure Red5 process is running, if not start it: running.sh
#!/bin/bash
#set environment
PID=`ps -eo ‘tty pid args’ | grep ‘red5′ | grep -v grep | grep -v running | tr -s ‘ ‘ | cut -f2 -d ‘ ‘`
if [ -z "$PID" ]
then
#Restart the process
cd /opt/red5/dist
/opt/red5/dist/red5.sh >> /opt/red5/dist/red5.log &
echo “Restarted Red5 at `date`” >> /opt/red5/dist/run-restart.log
else
#do nothing
echo “Red5 is already running with PID=$PID at `date`” >> /opt/red5/dist/run-checked.log
fi
Red5 Services
Red5 Hosting
Red5 installation on VPS & Dedicated Servers (Linux / Windows)
Related Posts:
Red5 0.9 Final Released
Get latest Red5 0.9 Final (27 January 2010) from http://code.google.com/p/red5/.
This final release includes important improvements and bug fixes.
http://code.google.com/p/red5/updates/list
Red5 Tutorials
Red5 Centos Linux Installation
Red5 Unbuntu Linux Installation
Run Red5 & Wowza Flash Media Servers on Same Linux Server
Red5 Services
Red5 Hosting
Red5 installation on VPS & Dedicated Servers (Linux / Windows)
Related Posts:
Run Red5 & Wowza Flash Media Servers on Same Linux Server
This post shows how to install Wowza on a server where there is another RTMP server, already installed, i.e. Red5. Run 2 rtmp servers at same time and allow applications to connect on both simultaneously.
Related Posts:
Install ffmpeg mplayer flvtool2 yamdi x264 theora mp3lame vorbis ogg faac
This is a tutorial to enable video sharing support on Centos servers.
This should install ffmpeg, mplayer, mencoder, flvtool2, yamdi, x264, theora, mp3lame, vorbis, ogg, faac, faad2, xvid, mediainfo, mp4box, neroaacenc . These tools will enable on your server:
- video and audio conversion
- thumbnail generation
- FLV meta injection (flvtool2, yamdi)
- extra codecs (x264, theora, mp3lame, vorbis, ogg, faac, faad2, xvid)
This is functional and we update it each time we configure a new server.
Installation is done using the “root” account.
Attention: If you copy and paste commands below, make sure “-” are not converted to “.”. If these get converted, edit “.” back to “-”. Some options use 2 * “-”.
Some prerequisites:
yum install gcc gcc-c++ automake autoconf libtool yasm git subversion
yum install zlib-devel libmad-devel libvorbis-devel libtheora-devel lame-devel faac-devel a52dec-devel xvidcore-devel freetype-devel
yuminstalllibogg zlib-devel libtoolrpm -ivh http://rpm.livna.org/livna-release.rpm
yuminstallyasm
yuminstalllibogg libogg-devel libvorbis libvorbis-devel
The quick way to setup ffmpeg, mplayer, mencoder:
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
or if you have 64bit server
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
yum -y install ffmpeg ffmpeg-devel mplayer mencoder
ffmpeg-libpostproc
Edit the /etc/ld.so.conf file and add the following lines:
/usr/local/lib
/usr/lib
GIT
(required to get X264)
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
cd /usr/local/srcwget http://www.kernel.org/pub/software/scm/git/git-1.6.0.4.tar.gztar -zxvf git-1.6.0.4.tar.gzcd git-1.6.0.4make prefix=/usr/local allmake prefix=/usr/local/ installgit –version
cd /usr/local/src
wget http://www.kernel.org/pub/software/scm/git/git-manpages-1.6.0.4.tar.gz
cd /usr/local/share/man
tar -zxvf /usr/local/src/git-manpages-1.6.0.4.tar.gz
YASM
YASM is a modular assembler, it is required by the x264 package.
cd /usr/local/src/
wget http://www.tortall.net/projects/yasm/releases/yasm-0.7.0.tar.gz
tar zfvx yasm-0.7.0.tar.gz
cd yasm-0.7.0
./configure
make && make install
cd ..
cd /usr/local/src/git clone git://git.videolan.org/x264.git
cd /usr/local/src/x264
./configure –enable-shared –prefix=/usr
make && make install
ls -s /usr/local/lib/libx264.so /usr/lib/libx264.so
cd /usr/local/src/wget http://www.mplayerhq.hu/MPlayer/releases/codecs/essential-20071007.tar.bz2tarxjvf essential-20071007.tar.bz2mkdir/usr/local/lib/codecs/mvessential-20071007/ /usr/local/lib/codecs/chmod-R 755 /usr/local/lib/codecs/
Or all codecs:
cd /usr/local/src/wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20100303.tar.bz2
tar xjvf all-20100303.tar.bz2mkdir/usr/local/lib/codecs/mv all-20100303
/usr/local/lib/codecs/
LAME
cd /usr/local/src/
wget http://downloads.sourceforge.net/project/lame/lame/3.98.4/lame-3.98.4.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Flame%2Ffiles%2F&ts=1285175656&use_mirror=switch
tar zxvf lame-3.98.4.tar.gz
cd /usr/local/src/lame-3.98.4
./configure
make && make install
OGG
cd /usr/local/src/
wget downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
tar zxvf libogg-1.1.3.tar.gz
cd /usr/local/src/libogg-1.1.3
./configure –enable-shared && make && make install
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
VORBIS
cd /usr/local/src/
wget downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz
cd /usr/local/src/libvorbis-1.1.2
./configure && make && make install
cd /usr/local/src/wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2tar jxvf libtheora-1.1.1.tar.bz2cd /usr/local/src/libtheora-1.1.1./configure –prefix=/usr--enable-sharedmake && make installls -s /usr/local/lib/libtheora.so /usr/lib/libtheora.so
cd /usr/local/src/wget http://downloads.sourceforge.net/faac/faac-1.28.tar.gztar zxvf faac-1.28.tar.gz
cd /usr/local/src/faac-1.28./configure –prefix=/usr
make && make install
FAAD2
cd /usr/local/src/
wget http://downloads.sourceforge.net/faac/faad2-2.6.1.tar.gz
tar zxf faad2-2.6.1.tar.gz
cd faad2
autoreconf -vif
./configure –disable-drm –disable-mpeg4ip
make && make install
cd /usr/local/src/
wget http://openjpeg.googlecode.com/files/openjpeg_v1_3.tar.gz
tarzxvf openjpeg_v1_3.tar.gz
cdOpenJPEG_v1_3make &&makeinstallldconfig
cd /usr/local/src/
wget http://downloads.xvid.org/downloads/xvidcore-1.2.1.tar.gz
tar zxfv xvidcore-1.2.1.tar.gz
cd /usr/local/src/xvidcore/build/generic
./configure--enable-shared
make && make installls -s /usr/local/lib/libxvidcore.so.4.2 /usr/lib/libxvidcore.so.4.2
Before installing ffmpeg, setup some linking for scripts that look in certain locations for codecs:
ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51
ln -s /usr/local/lib/libavdevice.so.52 /usr/lib/libavdevice.so.52ln -s /usr/lib/libtheora.so.0.3.10 /usr/local/lib/libtheora.so.0.3.10
ln -s /usr/lib/libx264.so.80 /usr/local/lib/libx264.so.80
ln -s /usr/lib/libtheora.so.0.3.10 /usr/local/lib/libtheora.so
ln -s /usr/lib/libx264.so.80 /usr/local/lib/libx264.so
FFMPEG (download latest from SVN)
export TMPDIR=$HOME/tmp
export LD_LIBRARY_PATH=/usr/local/lib/cd /usr/local/src/
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd /usr/local/src/ffmpeg/
./configure --enable-libfaac--enable-shared --enable-memalign-hack --enable-gpl --enable-libtheora --enable-libmp3lame --enable-libopenjpeg --enable-libvorbis --enable-libx264 --enable-libxvid --enable-nonfree --enable-postproc --enable-avfilter--enable-swscale
make && make installln -s /usr/local/bin/ffmpeg /usr/bin/ffmpeg
FFMPEG configure options use 2 x “-”.
MPLAYER
cd /usr/local/src/
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd /usr/local/src/mplayer
svn update
cd /usr/local/src/mplayer
./configure && make && make installln -s /usr/local/bin/mencoder /usr/bin/mencoder
ln -s /usr/local/bin/mplayer /usr/bin/mplayer
FLVTOOL2
First install Ruby from WHM.
cd /usr/local/src/
wget rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
tar zxvf flvtool2_1.0.5_rc6.tgz
cd /usr/local/src/flvtool2_1.0.5_rc6/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install
YAMDI
cd /usr/local/src/
wget http://downloads.sourceforge.net/project/yamdi/yamdi/1.4/yamdi-1.4.tar.gz?use_mirror=ufpr
tar zxf yamdi-1.4.tar.gz
cd yamdi-1.4
gcc yamdi.c -o yamdi -O2 -Wall
mv yamdi /usr/bin/
yamdi -h
INSTALLATION RESULTS
mencoder: /usr/local/bin/mencoder
mplayer: /usr/local/bin/mplayer
yamdi: /usr/bin/yamdi
Add these shortcuts to /usr/bin if you need these there by default:
mencoder to /usr/local/bin/mencoder
mplayer to /usr/local/bin/mplayer
SuPHP fix
With suphp “env -i” is required when executing php scripts.
exec(“env -i /usr/bin/php ” . $cmd. ‘>/dev/null &’);
MediaInfo
http://mediainfo.sourceforge.net/en/Download/CentOS
wget http://downloads.sourceforge.net/zenlib/libzen0-0.4.14-1.i386.CentOS_5.rpm
wget http://downloads.sourceforge.net/zenlib/libzen0-devel-0.4.14-1.i386.CentOS_5.rpm
wget http://downloads.sourceforge.net/mediainfo/libmediainfo0-0.7.32-1.i386.CentOS_5.rpm
wget http://downloads.sourceforge.net/mediainfo/libmediainfo0-devel-0.7.32-1.i386.CentOS_5.rpm
wget http://downloads.sourceforge.net/mediainfo/mediainfo-0.7.32-1.i386.CentOS_5.rpm
rpm -vi libzen0-0.4.14-1.i386.CentOS_5.rpm
rpm -vi libzen0-devel-0.4.14-1.i386.CentOS_5.rpm
rpm -vi libmediainfo0-0.7.32-1.i386.CentOS_5.rpm
rpm -vi libmediainfo0-devel-0.7.32-1.i386.CentOS_5.rpm
rpm -vi mediainfo-0.7.32-1.i386.CentOS_5.rpmln -s /usr/bin/mediainfo /usr/local/bin/mediainfo
MP4Box
yum -y install freetype-devel SDL-devel freeglut-devel
wget -c http://mirror.ffmpeginstaller.com/source/gpac/gpac-full-0.4.5.tar.gz
tar -xzf gpac-full-0.4.5.tar.gz
cd gpac./configure –prefix=/usr/local/cpffmpeg/ –extra-cflags=-I/usr/local/cpffmpeg/include/ –extra-ldflags=-L/usr/local/cpffmpeg/lib –disable-wx –strip
make && make lib && make apps && make install lib && make install
cp bin/gcc/libgpac.so /usr/lib
ln -s /usr/local/cpffmpeg/bin/MP4Box /usr/local/bin/MP4Box
ln -s /usr/local/cpffmpeg/bin/MP4Box /usr/bin/MP4Boxinstall -m644 bin/gcc/libgpac.so /usr/local/lib/libgpac.so
chmod +x /usr/local/lib/libgpac.so
ldconfig
neroAacEnc
wget ftp://ftp6.nero.com/tools/NeroDigitalAudio.zip
unzip NeroDigitalAudio.zip -d nero
cd nero/linux
sudo install -D -m755 neroAacEnc /usr/local/binln -s /usr/local/bin/neroAacEnc /usr/bin/neroAacEnc
uploadprogress
cd /usr/local/src
wget http://pecl.php.net/get/uploadprogress-1.0.0.tgz
tar -zxvf uploadprogress-1.0.0.tgz
cd uploadprogress-1.0.0
phpize
./configure && make && make install
Edit /usr/lib/php.ini and add:
extension = “uploadprogress.so”
ASM is a modular assembler, it is required by the x264 package.
codec:$ wget \ http://www.tortall.net/projects/yasm/releases/yasm-0.7.0.tar.gz codec:$ tar zfvx yasm-0.7.0.tar.gz codec:$ cd yasm-0.7.0 codec:$ ./configure codec:$ make && make install codec:$ cd ..
Related Posts:
VideoWhisper Video Recorder
The video recorder allows site users to record webcam videos easily from website pages. This can be use on various sites to implement online features like:
+ video sharing, on demand video content
+ video messaging, video email
+ video content on member profiles, video teasers, video questionnaires
+ video comments for online posts and items, video discussions, video forums
Videos are recorded as flv files on the rtmp server and can be played trough the rtmp protocol or by http players as on youtube (if published to a web accessible location).
For more details check the home page of VideoWhisper web based Video Recorder.

Video Broadcast
Enter Presentation
Enter Conference