Linux-CentOS7 Red5流媒体服务器的安装与配置

来源:互联网 发布:手机淘宝卖家客户端 编辑:程序博客网 时间:2024/04/29 03:04

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:

  • WebSocket (ws and wss)
  • HLS
  • RTSP (From Axis-type cameras)

一、安装

0、安装java

yum install java-1.7.0-openjdk
1、下载

https://github.com/Red5/red5-server/releases

选择red5-server-1.0.6-RELEASE-server.tar.gz,解压到 /usr/local/red5


2、设置为可执行

cd /usr/local/red5chmod +x *.sh
3、安装

./red5.sh
4、编辑配置文件

找到/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 (sohaileo@gmail.com)PROG=red5RED5_HOME=/usr/local/red5DAEMON=$RED5_HOME/$PROG.shPIDFILE=/var/run/$PROG.pid# Source function library. /etc/rc.d/init.d/functions[ -r /etc/sysconfig/red5 ] && . /etc/sysconfig/red5RETVAL=0case "$1" instart)echo -n $"Starting $PROG: "cd $RED5_HOME$DAEMON >/dev/null 2>/dev/null &RETVAL=$?if [ $RETVAL -eq 0 ]; thenecho $! > $PIDFILEtouch /var/lock/subsys/$PROGfi[ $RETVAL -eq 0 ] && success $"$PROG startup" || failure $"$PROG startup"echo;;stop)echo -n $"Shutting down $PROG: "killproc -p $PIDFILERETVAL=$?echo[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROG;;restart)$0 stop$0 start;;status)status $PROG -p $PIDFILERETVAL=$?;;*)echo $"Usage: $0 {start|stop|restart|status}"RETVAL=1esacexit $RETVAL
2.将启动脚本添加到服务

chmod +x /etc/rc.d/init.d/red5chkconfig --add red5chkconfig red5 on
3.设置CentOS防火墙

打开5080、1935等端口

4.启动red5

/etc/init.d/red5 start
5.测试Red5

在浏览器中访问 http://yourip:5080
这里我们访问Red5自带的几个demo来测试Red5是否好用
Red5 多媒体服务占用端口 5080,RTMP 占用端口 1935,如果不能访问,请检查防火墙是否允许这两个端口。

6.直播地址
rtmp://yourip/live/流地址

0 0
原创粉丝点击