nigix安装
树莓派安装nginx,参考http://blog.csdn.net/zizi7/article/details/54347223
1. 下载PCRE 并安装.
主页地址: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.38.tar.gz
2. 解压 tar -xzvf pcre-8.38.tar.gz
cd pcre-8.38
cmake .
sudo make
sudo make install
3. 安装OpenSSL
sudo apt-get install libssl-dev
4. 下载nginx 和 nginx rtmp 模块
下载nginx源码
http://nginx.org/download/nginx-1.10.0.tar.gz
解压 tar -zxvf nginx-1.10.0.tar.gz
下载nginx rtmp 模块源码
https://codeload.github.com/arut/nginx-rtmp-module/zip/master
解压unzip master,解压到nginx-rtmp-module-master文件夹
执行nginx 编译配置
./configure --add-module=/path/to/nginx-rtmp-module-master
sudo make
sudo make install
5. 启动nginx
nginx 默认安装目录 /usr/local/nginx
/usr/local/nginx/sbin 目录下nginx 服务器主程序, 启动 sudo ./nginx
6. 查看
/usr/local/nginx/sbin$ ps -ef | grep nginx
root 1394 1474 0 18:11 ? 00:00:00 nginx: master process ./nginx
nobody 1395 1394 0 18:11 ? 00:00:00 nginx: worker process
1570 1027 0 18:22 pts/32 00:00:00 grep --color=auto nginx
7. 在浏览器中输入 http://localhost/ , 可以看到nginx 的首页
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
8. 添加rtmp 支持
sudo vi conf/nginx.conf
rtmp {
server {
listen 1935;
application live {
live on;
record off;
}
}
}
9, 重启 nginx
sudo ./sbin/nginx -t
sudo ./sbin/nginx -s reload
10. 添加测试源, 推流到服务器
ffmpeg -re -i ~/testcontent/MP4_H.264_MP_L3.1_720P_1Mbps_29.585fps_AAC_LC.mp4 -c copy -f flv rtmp://192.168.36.29:1935/live
或者直接采集屏幕
ffmpeg -f x11grab -follow_mouse centered -r 25 -s cif -i :0.0 -f flv rtmp://192.168.36.29:1935/live
11. 使用vlc在局域网机器上打开rtmp测试流
rtmp://192.168.36.29:1935/live
截图: