1 |
ruby -e "$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install )" |
2. Install nginx
First clone nginx project to the local
1 |
brew tap denji/nginx |
brew tap homebrew / nginx source is dead
refer https://github.com/denji/homebrew-nginx
Perform the installation:
1 |
brew install nginx-full --with-rtmp-module |
At this point, nginx and rtmp module is now installed
enter the command:
1 |
nginx |
Open in the browser http: // localhost: 8080
Query installation path: brew info nginx-full
3. Configure Services RTMP
/usr/local/etc/nginx/nginx.conf consistent in RTMP and Http node
1 |
nginx -c /usr/local/etc/nginx/nginx.conf |
Nginx -c parameter specifies the location of the file nginx.conf
Plus rtmp node configuration to http:
1 |
rtmp { |
4. Query rtmp service is normal
After completion of the implementation modify configuration files
1 |
nginx -s reload |
carried out
1 |
sudo lsof -i -P | grep -i "listen" |
Query whether to open ports 1935
5. Live Test
Install ffmpeg
1 |
brew install ffmpeg |
Install vlc player , mp4 files ready to plug-flow test, play with vlc
Streaming :
1 |
ffmpeg -re -i / Volumes / WORK / Moorgen / Presentation / Demo video /moorgen.mp4 -vcodec libx264 -acodec aac -f flv rtmp: //127.0.0.1: 1935 / myapp / room |
Play :
1 |
rtmp://localhost:1935/myapp/room |
Original: Big Box OSX install nginx module and rtmp