Installing and Integrating Red5 with Kaltura CE5

Within this blog post we will guide you step-by-step on How to install Red5 server and integrate it with Kaltura CE.
Installing and Integrating Red5 with Kaltura CE5 can be a difficult task and I hope that after this blog your mission will be completed.

This blog post will be divided into 3 Main paragraphs.
[sspluslist]

[/sspluslist]

NOTE:The below code samples assume you are using Ubuntu.
If you are using Fedora or CentOS there will be minor changes.

Pre-requisites

First we need to install the 4 prerequisites which are: JAVA, SVN, ANT, and chkconfig.
NOTE: If you’re installing Red5 on your Kaltura machine and not on dedicated server don’t install JAVA as you probably already installed JAVA-6 and it may cause collisions with the data warehouse.

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get -y -qq install oracle-java7-installer
sudo apt-get -y -qq install subversion
sudo apt-get -y -qq install ant
sudo apt-get -y -qq install chkconfig

After installing the above we need to set the environment variables for JAVA and ANT

export JAVA_HOME=/usr/lib/jvm/java-7-oracle/
export ANT_HOME=/usr/share/ant/
export PATH=$PATH:/usr/share/ant/bin
export CLASSPATH=/usr/share/red5/boot.jar
echo 'export ANT_HOME=/usr/share/ant' >> /etc/bashrc
echo 'export JAVA_HOME=/usr/lib/jvm/java-7-oracle' >> /etc/bashrc
echo 'export PATH=$PATH:/usr/share/ant/bin' >> /etc/bashrc
echo 'export CLASSPATH=/usr/share/red5/boot.jar' >> /etc/bashrc

Red5 Installation

First we need to download the Red5.
Go to Red5 Website download page and download Red5 version 1.0 or above.
Upload the file to your Red5 server and open it in /usr/share/red5/ directory.

mkdir /usr/share/red5
cp red5-1.0.0.tar.gz /usr/share/red5/
cd /usr/share/red5/
tar -xzvf red5-1.0.0.tar.gz

After that create a file /usr/share/red5/red5 script and copy the content from HERE to the red5 script.
This file will serve as the Red5 stop/start script so we’ll make a soft link to it to /etc/init.d/red5.
NOTE: The syntax of the red 5 script is suitable for CentOS and not for Ubuntu, if you would like to resolve the errors you get you can read more in our Red5 init Script for Ubuntu post

vim /usr/share/red5/red5
### Copy the content from http://blog.kaltura.org/wp-content/uploads/2011/12/Red5-Init-script.txt to the file ###
dos2unix /usr/share/red5/red5
chmod 744 /usr/share/red5/red5
chmod 744 /usr/share/red5/red5.sh
ln -s /usr/share/red5/red5 /etc/init.d/red5
mkdir /var/lock/subsys

Now we’ll add the Red5 to boot-up when the server is started/rebooted.

chkconfig --add red5
chkconfig red5 on

Now you can start the Red5 server.

/etc/init.d/red5 start

Kaltura CE integration

Now the last part is to integrate the Red5 with your Kaltura CE.
First we should install oflaDemo.
1. Go to your Red5 Server on port 5080.
http://Red5_Server_Ip:5080/
2. Click on “Install a ready-made application”
3. Select “oflaDemo” and click on “install”
To verify that oflaDemo is running, Go to: http://your.server.com:5080/demos/ofla_demo.html and in the server address – above the connect button – enter “rtmp://yourserver.com/oflaDemo” And click “connect”.
If the video plays well – Red5 installation complete and we can start integrating it with our Kaltura CE!

cd /usr/share/red5/webapps/oflaDemo
mv streams streams_x
mkdir  /opt/kaltura/web/content/webcam
ln -s /opt/kaltura/web/content/webcam ./streams – adding webcam and streams save location
ln -s /opt/kaltura/web/content /usr/share/red5/webapps/oflaDemo/streams

NOTE:If you are using NFS you should make the symbolic links to the NFS.
Example: ln -s /nfs/export/share/web/content/webcam /usr/share/red5/webapps/oflaDemo/streams/content

Adjust the Kaltura Contribution Wizard uiConf file:
vim /opt/kaltura/web/content/uiconf/kaltura/samplekit/kcw_2.6.4/kcw_samplekit.xml
Add the RTMP URL of your site (search for “rtmp” in the file):
change to “rtmp://yourip/oflaDemo”

25 thoughts on “Installing and Integrating Red5 with Kaltura CE5

  1. Pingback: Red5 init Script for Ubuntu Panda OS Consulting and Development

  2. I am very close. I can record from the webcam, it goes into Kaltura fine. It won’t allow me to play the video, though, right after recording it. I am wondering if it has to do with this second symbolic link:
    ln -s /opt/kaltura/web/content /usr/share/red5/webapps/oflaDemo/streams
    Since streams already exists in this location from the first link, it won’t allow it to be created.
    Thoughts?
    Thanks

  3. Hi Alan,

    Try to delete the original /usr/share/red5/webapps/oflaDemo/streams and to create it as symbolic link like your suggestion.
    If it still won’t work, before trying to play the entry (video), open the network tab and check the api call.
    If you don’t know how to do that then just clock f12 >> go to “Network” tab and then play the video.
    Check the api call and the response.
    If you don’t know tell me and I’ll assist you.

  4. Hi Roy,
    I figured out the issue. The second symbolic link should be:
    ln -s /opt/kaltura/web/content /usr/share/red5/webapps/oflaDemo/streams/content
    you left off the content at the very end – this needs to be in the streams folder with a link back to /opt/kaltura/web/content.
    Thanks

  5. Roni, thanks for the post. Everything goes well until the last two commands that fails as below:

    ubuntu@ip-172-31-18-219:/usr/share/red5$ chkconfig –add red5
    /sbin/insserv: No such file or directory
    red5 0:off 1:off 2:off 3:off 4:off 5:off 6:off
    ubuntu@ip-172-31-18-219:/usr/share/red5$ chkconfig red5 on
    /sbin/insserv: No such file or directory

    Any ideas?

    Phil

  6. Ok, spoke too soon. Fixed that by

    sudo ln -s /usr/lib/insserv/insserv /sb

    then running

    chkconfig –add red5
    chkconfig red5 on

    from root. I then get:

    red5 0:off 1:off 2:on 3:on 4:on 5:on 6:off

    but not before a whole bunch of warnings like:

    The script you are attempting to invoke has been converted to an Upstart
    job, but lsb-header is not supported for Upstart jobs.
    insserv: warning: script ‘hwclock’ missing LSB tags and overrides
    insserv: Default-Start undefined, assuming empty start runlevel(s) for script `h wclock’
    insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `h wclock’

    and same for chkconfig red5 on:

    The script you are attempting to invoke has been converted to an Upstart
    job, but lsb-header is not supported for Upstart jobs.
    insserv: warning: script ‘hwclock’ missing LSB tags and overrides
    insserv: Default-Start undefined, assuming empty start runlevel(s) for script `h wclock’
    insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `h wclock’

    I then start Red5 and get:

    * Starting red5: 7415
    * red5 is running
    But pointing my browser to the url port 5080 nothing connects.

    Any pointers?

    Phil

  7. HI Phil,

    First try stopping the service by:
    # sudo service red5 stop

    Then run the service by:
    # sudo service red5 start

    And try running scripts through “service” action next time.
    After that, check if it works, if not please share your logs and errors.

  8. Roy, sorry to be a pain. I now have the mediaplayer up, but the media window is showing noise and the output is:

    (69) Connections: true | true
    (19675) connected?: true
    (19998) NetConnection.onStatus:
    mode = 1
    fmsVer = RED5/1,0,0,0
    capabilities = 31
    data =
    version = 4,0,0,1121
    type = red5

    description = Connection succeeded.
    code = NetConnection.Connect.Success
    level = status

    (19998) catchVideos: [type Function]
    (20132) :
    hobbit_vp6.flv =
    size = 6544259
    name = hobbit_vp6.flv
    lastModified = 28/02/14 15:36:58

    startrekintodarkness_vp6.flv =
    size = 3137481
    name = startrekintodarkness_vp6.flv
    lastModified = 28/02/14 15:36:59

    Any ideas?

    Phil

  9. Hi. Thank you for your instructions. I nearly have everything working except I’m receiving the following error when recording via webcam:

    error: ArgumentError: Error #1063 text: Error #2095
    error: ReferenceError: Error #1069 text: Error #2095

    Any help would be really appreciated.

    Andrew

    1. Hi Andrew,

      Glad you solve the issue. The error you got is indeed configuration error.
      It will be great if you’ll write the steps you’ve did to solve this issue.

      1. Hi Andrew, what configuration steps did you take?
        Also note that this refers to an older version of Red5 and the configuration might have changed since.

        Feel free to contact us, if you need professional support.

    2. Andrew, What basic configuration you have to check?I have same problem, tnx!

      error: ArgumentError: Error #1063 text: Error #2095
      error: ReferenceError: Error #1069 text: Error #2095

  10. Hi, anyone got nginx rtmp module working with Kaltura for livestreaming? Nginx by itself works fine for RTMP and HLS so what is required is the integration between the two platform to allow provisioning livestreams from Kaltura itself.

    Cheers

      1. Hi Leon! I need to run my own server running kaltura with red5, i tryied and running both in a virtualbox, kaltura is running, red5 too, kalturaCE 4 and red5 1.0 both runing fine in this one instance i can´t get webcam to record (error: ArgumentError: Error #1063 text: Error #2095 error: ReferenceError: Error #1069 text: Error #2095), an in other install, kalturaCE 4 and red5 0.9 i get “no scope oflaDemo error….” Can you help me? Many thanks!

          1. Tnx Roni! I’m on it right now, installing from repo on vmware fresh centos 6.6 setup. Ill keep updating soon.

Leave a Reply

Your email address will not be published. Required fields are marked *