1.确保安装homebrew ---安装则跳到第二步nginx
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"git
2.brew tap nginxgithub
brew install nginx-full --with-rtmp-module(安装rtmp模块的nginx)vim
3.输入nginx 启动服务器ruby
http://localhost:8080服务器
出现上面的字符,说明nginx启动成功app
4.配置rtmp: 利用vim命令curl
vim /usr/local/etc/nginx/nginx.confurl
#配置rtmp server
rtmp {
server{
#指定服务端口
listen 1935;
chunk_size 4000;
#指定流应用
application live
{
live on;
record off;
allow play all;
}
}
}server
5.nginx -s reload 从新启动nginx
6.利用ffmpeg推流
ffmpeg -re -i abc.flv -c copy -f flv rtmp://localhost:1935/live/room
7.利用VLC软件查看推流结果
双击查看
8.查看推流结果