Linux-CentOS7 Red5流媒体服务器的安装与配置
Red5 is an Open Source Flash Server written in Java that supports:
- Streaming Video (FLV, F4V, MP4, 3GP)
- Streaming Audio (MP3, F4A, M4A, AAC)
- Recording Client Streams (FLV and AVC+AAC in FLV container)
- Shared Objects
- Live Stream Publishing
- Remoting
- Protocols: RTMP, RTMPT, RTMPS, and RTMPE
Support via plugin:
一、安装
0、安装java
- yum install java-1.7.0-openjdk
https://github.com/Red5/red5-server/releases
选择red5-server-1.0.6-RELEASE-server.tar.gz,解压到 /usr/local/red5
2、设置为可执行
- cd /usr/local/red5
- chmod +x *.sh
- ./red5.sh
找到/usr/local/red5/webapps/live/WEB-INF/red5.properties文件,增加0.0.0.0 IP地址。
二、添加服务启动项
1、编辑启动脚本
- vi /etc/init.d/red5
- #!/bin/bash
- # For RedHat and cousins:
- # chkconfig: 2345 85 85
- # description: Red5 flash streaming server
- # processname: red5
- # Created By: Sohail Riaz ([email protected])
- 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/rc.d/init.d/red5
- chkconfig --add red5
- chkconfig red5 on
打开5080、1935等端口
4.启动red5
- /etc/init.d/red5 start
在浏览器中访问 http://yourip:5080
这里我们访问Red5自带的几个demo来测试Red5是否好用
Red5 多媒体服务占用端口 5080,RTMP 占用端口 1935,如果不能访问,请检查防火墙是否允许这两个端口。
6.直播地址
rtmp://yourip/live/流地址