rtmp服务器信息,搭建RTMP服务器

半年前记录的了, 但是一直忙于工作, 没有时间整理...

1.安装Homebrew(如果还没安装的话)

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2.安装Nginx

brew tap homebrew/nginx

brew install nginx-full --with-rtmp-module

启动nginx

nginx

测试(不出意外的话, 会看到Welcome to nginx!)

localhost:8080

3.配置RTMP

打开配置文件(mac 10.11 默认的地址)

vi /usr/local/etc/nginx/nginx.conf

在配置文件最后面(或者最前面, 不要嵌套在 http{ } 中间)添加RTMP配置.(修改配置后, 重新加载/启动Nginx)

rtmp {

server {

listen 1935;

application rtmplive {

live on;

record off;

}

}

}

关于RTMP配置信息, 看这里RTMP配置

配置完成之后需要重新启动Nginx服务器

推流地址: rtmp://192.168.0.101:1935/rtmplive

推流要加上密钥(房间号), 完整路径如:rtmp://192.168.0.101:1935/rtmplive/room

至此完毕!

其他

nginx -s reload //重新加载

nginx -s reopen //重新打开

nginx -s stop //停止

nginx -s quit //退出

//Nginx安装路径

/usr/local/Cellar/nginx-full/

//Nginx配置文件路径

/usr/local/etc/nginx/nginx.conf

//Nginx服务器根目录

/usr/local/var/www

//卸载Homebrew(如果需要卸载的话)

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

//Nginx

https://github.com/Homebrew/homebrew-nginx