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 -xzvfpcre-8.38.tar.gz
cdpcre-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 -zxvfnginx-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
截圖:
總結
- 上一篇: OSG造成屏幕闪烁,且鼠标不能操作的一行
- 下一篇: 【量产工具修复】U盘插上没反应,格式化提