eat oca test reload sql 分享 num curl
需要 FQ:
Mac 安装 RTMP 服务器过程记录下来!
执行命令:
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果已经安装过,而想要卸载:
- ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
如果已经安装过,则不用安装!
先 glone nginx 项目到本地:
- brewtaphomebrew/nginx
执行安装:
- brewinstallnginx-full --with-rtmp-module
通过操作以上步骤,nginx 和 rtmp 模块就安装好了
执行命令:
- nginx
出现如下页面信息,表示 nginx 服务器搭建成功了,而且已经安装了 RTMP 模块了:
下面开始来配置 nginx 的 rtmp 模块。首先,我们要看看 nginx 安装到哪里了:
- brewinfonginx-full
出现如下类似信息:
- ==> Caveats
- Docrootis: /usr/local/var/www
- Thedefault porthasbeensetin /usr/local/etc/nginx/nginx.confto8080 sothat
- nginxcanrunwithoutsudo.
- nginxwillloadallfilesin /usr/local/etc/nginx/servers/.
- - Tips -
- Run port80:
- $ sudochown root:wheel /usr/local/Cellar/nginx-full/1.10.0/bin/nginx
- $ sudochmod u+s /usr/local/Cellar/nginx-full/1.10.0/bin/nginx
- Reload config:
- $ nginx -s reload
- Reopen Logfile:
- $ nginx -s reopen
- Stop process:
- $ nginx -s stop
- Waiting onexitprocess
- $ nginx -s quit
- To havelaunchdstarthomebrew/nginx/nginx-fullnowandrestartat login:
- brew servicesstarthomebrew/nginx/nginx-fullOr,if youdon't want/need a backgroundserviceyoucanjust run:
- nginx
从这些信息中,可以看到 nginx.conf 文件在:
- /usr/local/etc/nginx/nginx.conf
nginx 完整路径:
- /usr/local/Cellar/nginx-full/1.10.0/bin/nginx
通过以下打开 nginx.conf 配置文件来配置:
- vi /usr/local/etc/nginx/nginx.conf
直接滚动到最后一行,以就是在 http {} 之后:
- http {
- 这里默认就有的,不用管这些
- }
- # 在http节点后面加上rtmp配置:
- rtmp {
- server {
- listen5920;
- applicationrtmplive {
- liveon;
- recordoff;
- }
- }
- }
重启 nginx:
- /usr/local/Cellar/nginx-full/1.10.0/bin/nginx -s reload
输入以下命令来安装 ffmpeg:
- brewinstallffmpeg
安装这个需要等一段时间,然后准备一个视频文件作为来推流,我们在安装一个支持 rtmp 协议的视频播放器,Mac 下可以用 VLC。
- ffmpeg -re -i/Users/huangyibiao/Desktop/test.mov -vcodeclibx264 -acodecaac -f flv rtmp://localhost:5920/rtmplive/room
将视频推流到服务器后,打开 VLC,然后 file->open network-> 输入:
- rtmp://localhost:5920/rtmplive/room
观看视频!
终于安装解决 RTMP 服务器了,后面可以自己尝试去学习相关技术了!
IOS 推流 搭建环境
来源: http://www.bubuko.com/infodetail-2036449.html