1. Installation command
Ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)" If you want to uninstall RUBY-E after installation, "$ (Curl- Fssl https://raw.githubusercontent.com/Homebrew/install/master/uninstall) "2. Install Nginx first clone Nginx project to local brew tap Homebrew/nginx Installation: Brew Install Nginx-full--with-rtmp-module at this point, the Nginx and rtmp modules are installed with the input command: Nginx opens in the browser http://localhost:8080
2. Errors may occur during installation
I need to upgrade the brew during the installation process
Brew Update-v
3, after the installation of common instructions
Query installation path:
Brew Info Nginx-full
Nginx Installation location /usr/local/cellar/nginx-full/1.10.1/bin/nginxnginx configuration file is in the same location /usr/local/etc/nginx/ Nginx.confnginx Server root directory location /usr/local/var/www
4. Configure RTMP Service
/usr/local/etc/nginx/nginx.conf rtmp and HTTP nodes in the same
# Append the rtmp configuration to the HTTP node: rtmp { server { listen 1935; Application MyApp { live on; #record keyframes; #record_path/tmp; #record_max_size 128K; #record_interval 30s; #record_suffix. this.is.flv; #on_publish Http://localhost:8080/publish; #on_play Http://localhost:8080/play; #on_record_done http://localhost:8080/record_done; } Application HLs { live on; HLS on; Hls_path/tmp/app; Hls_fragment 5s;}}}
5, query the RTMP service is normal
After modifying the configuration file, execute nginx-s Reload
Execute sudo lsof-i-p | Grep-i "Listen" Query port 1935 is open
6. Live test
Installing FFmpeg
Brew Install FFmpeg
Installing VLC Player
Prepare MP4 file Push stream test, play with VLC
Push stream:
Ffmpeg-re-i/users/lunli/rtmp/keep.mp4-vcodec libx264-acodec aac-f flv rtmp://127.0.0.1:1935/myapp/room
Play:
Rtmp://localhost:1935/myapp/room
7. If an error is encountered
Uninstall Nginx, reinstall
8. Results
9, the video file reference Https://github.com/sunjinshuai/Keep/blob/master/KeepGuidePage/keep.mp4
Mac System Installation Nginx+rtmp module