LoginSignup
7
10

More than 5 years have passed since last update.

Macでnginxを使ったRTMP配信のテスト環境を用意する

Last updated at Posted at 2016-06-16

ストリーミング配信のテストをしたいので、
Macのローカルへ環境を作ることにしました。

nginxはhomebrewでインストールします。
最終的にはたったこれだけのことで終わるんですが
全然わからなくて延々と調査してました。。。

あとはrtmp://[ipアドレス]/liveとかにNSStreamなんかで動画送ってやればいいと思います。

homebrewのインストール

■ 【El Capitan】Mac OSX 10.11にHomebrewインストール
http://qiita.com/aoioooii/items/c14922eede6a83a750da

nginx環境のインストール

nginx-fullを利用します。
$ brew info nginx-fullでわかるmodule名をインストールの時に指定しないとダメなんですね。。。

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

/usr/local/etc/nginx/nginx.confにRTMPサーバの情報を登録

/usr/local/etc/nginx/nginx.conf
rtmp {
    server {
        listen 1935;
         application live {
            live on;
            wait_video on;
            hls on;
            hls_path /usr/local/etc/nginx/html/;
            hls_fragment 5s;
        }
    }
}

それぞれのパラメータに関しては以下の記事で解説されています。
■ nginxでrtmp配信サーバを構築する【完全版】
http://variedtastefinder.jp/blog/?p=1782

起動と終了

## 起動
$ nginx
## 終了
$ nginx -s stop

起動してるときにhttp://localhost:8080へアクセスすれば、Welcome to nginx!とか表示されると思います。

7
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
10