Mac System Installation Nginx+rtmp module

Source: Internet
Author: User
Tags curl

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.