Showing posts with label Red5 Media Server. Show all posts
Showing posts with label Red5 Media Server. Show all posts

Thursday, February 27, 2014

How to install Red5 media server 1.0 on Centos redhat

Best part about red5 is it is open source, Red5 Media Server 1.0 delivers a powerful video streaming and multi-user solution it is Based on Java and some of most powerful open source frameworks, To install Red5 media server 1.0 in centOS follow the steps below.



  • SSH your server as root user
Step 1 Install Java in your server.
  • yum install java-1.7.0-openjdk

Step 2 Now time to Install ANT as it is prerequisite for red5 media server follow the steps below.
  • cd /usr/local/src
  • wget http://archive.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
Step 3 Now we have to export paths of ANT and Java
  • export ANT_HOME=/usr/local/ant
  • export JAVA_HOME=/usr/lib/jvm/java
  • export PATH=$PATH:/usr/local/ant/bin
  • export CLASSPATH=.:$JAVA_HOME/lib/classes.zip
  • echo 'export ANT_HOME=/usr/local/ant' >> /etc/bashrc
  • echo 'export JAVA_HOME=/usr/lib/jvm/java' >> /etc/bashrc
  • echo 'export PATH=$PATH:/usr/local/ant/bin' >> /etc/bashrc
  • echo 'export CLASSPATH=.:$JAVA_HOME/lib/classes.zip' >> /etc/bashrc
Step4 Finally we will install red5 media server
  • wget http://www.red5.org/downloads/red5/1_0_1/red5-1.0.1.tar.gz
  • tar zxvf red5-1.0.1.tar.gz 
  • mv /usr/local/src/red5-server-1.0  /usr/local/red5
  • mv * /usr/local/red5
Step 5 We have installed red5 media server now we need to create service to start stop and restart red5 media server, Copy the content below and paste it to the file red5 below
  • vi /etc/init.d/red5
 PROG=red5
RED5_HOME=/usr/local/red5
DAEMON=$RED5_HOME/$PROG.sh
PIDFILE=/var/run/$PROG.pid
 
# Source function library
. /etc/rc.d/init.d/functions
 
[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5
 
RETVAL=0
 
case "$1" in
    start)
    echo -n $"Starting $PROG: "
    cd $RED5_HOME
    $DAEMON >/dev/null 2>/dev/null &
    RETVAL=$?
    if [ $RETVAL -eq 0 ]; then
        echo $! > $PIDFILE
        touch /var/lock/subsys/$PROG
    fi
    [ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"
    echo
    ;;
    stop)
    echo -n $"Shutting down $PROG: "
    killproc -p $PIDFILE
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG
    ;;
    restart)
    $0 stop
    $0 start
    ;;
    status)
    status $PROG -p $PIDFILE
    RETVAL=$?
    ;;
    *)
    echo $"Usage: $0 {start|stop|restart|status}"
    RETVAL=1
esac
 
exit $RETVAL
  • chmod +x /etc/init.d/red5
  • /etc/init.d/red5 start
  • Make sure port 1935 and 5080 are open
  • now is IP:5080 to access your red5 media server

Red5 is installed if you face any issue at any step do let me know i am always here to help you out.

Friday, November 15, 2013

Error occurred during initialization of VM Could not reserve enough space for object heap Could not create the Java virtual machine

We get this error when java is running out of space and resulting in not functioning of Java virtual machine and it can be easily resolved by increasing the heap size.

=========================
[root@vps red5]# ./red5.sh
Running on  Linux
Starting Red5
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
==========================

That means you need to increase the Heap-size.


SSH Server 

Run the command below


export CATALINA_OPTS="-Xms1024m -Xmx1024m"

*Note It will increase your heap size to 1024MB

If still red5 doesn't work increase more memory if still don't work 
Reboot server and then give it a try and If still doesn't work no way left increase RAM.

Tuesday, August 27, 2013

Red5 server down



cd /opt/red5

if it does not exist there search red5 directory from the command below.

find /-name red5

Once you find the directory go inside that directory and run the command below.

nohup ./red5.sh &

*Trick If doesent work run it in screen
./red5.sh

But it will work only till the time screen is running.
then check it by Ip:5080
using nohup command red5 keeps running even after we exit.