初次搭建,以跑起来为目的,其它高深的东西以后再说。
1.搭建nginx,见我的那篇搭建的博客。
2.在github上下载nginx-rtmp-module-master,我直接下载zip压缩包,当然你也可以git clone。git 地址:https://github.com/arut/nginx-rtmp-module。
3.在linux上解压,我解压在/home/shaoyangdd/software/nginx-rtmp-module-master路径下。
4.将nginx-rtmp-module添加到nginx。到nginx的源码路径下(不是安装路径),执行:
./configure --add-module=/home/shaoyangdd/software/nginx-rtmp-module-master
然后make最后make install。
到此如果没报什么错就算安装好了。
下面测试一下。
5.将nginx-rtmp-module-master\test的nginx.conf拷贝到nginx的安装路径下的conf目录中,(把原来的ngix.conf备份一下),我的是/usr/local/nginx/conf。
6.将新的nginx.conf的下面一段代码改一下。
root /path/to/nginx-rtmp-module/test;
}
root /path/to/nginx-rtmp-module/test/www;
}
http://localhost:8080/record.html 这个链接访问的是 /path/to/nginx-rtmp-module/ test/www下的record.html 既有录又有播 这俩把我搞蒙圈了
http://localhost:8080/rtmp-publisher/player.html 这个链接访问的是/path/to/nginx-rtmp-module/test/rtmp-publisher下的player.html 这个播
http://localhost:8080/rtmp-publisher/publisher.html 这个链接访问的是/path/to/nginx-rtmp-module/test/rtmp-publisher下的publisher.html 这个录