SRS4.0.85流媒体搭建及HTTPS代理
生活随笔
收集整理的這篇文章主要介紹了
SRS4.0.85流媒体搭建及HTTPS代理
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
下載SRS4.0.85 :git clone -b v4.0.85 https://gitee.com/ossrs/srs.git
服務(wù)器配置參考鏈接:1-SRS 4.0開發(fā)環(huán)境搭建:包括推流、服務(wù)器配置、拉流測試 - 知乎
webRTC延遲基本在1s內(nèi),配置好webrtc文件后可用obs推流,見文Windows+nginx+rtmp+OBS中obs推流
另注:服務(wù)開啟命令:./objs/srs -c conf/rtc.conf
??????????將公網(wǎng)IP改到rtc.conf中的candidate 47.108.xx.xx;
? ? ? ? ?按照配置文件說明開放端口(linux):
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT #如國標(biāo)平臺接入需開udp-5060端口,否則獲取不到畫面 iptables -I INPUT -p udp --dport 5060 -j ACCEPT #最后不要忘 iptables-savenginx作Https代理
nginx配置文件如下,將nginx證書與密鑰配置好即可。
先開啟nginx服務(wù)再開啟srs服務(wù)
如果nginx沒有http2模塊,運(yùn)行以下命令
#安裝http2模塊 ./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module #直接make不覆蓋編譯 make #啟動命令 /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/srsnginx.conf #nginx.conf配置文件 worker_processes 1; events {worker_connections 1024; } ? http {include ? ? ? ? ? ? /etc/nginx/mime.types; ?server {listen ? ? ? 80;listen ? ? ? 443 ssl http2;server_name _;ssl_certificate ? ? /usr/local/srs/conf/server.crt;ssl_certificate_key /usr/local/srs/conf/server.key; ?# For SRS homepage, console and players# ? http://r.ossrs.net/console/# ? http://r.ossrs.net/players/location / {proxy_pass http://127.0.0.1:8080/;}# For SRS streaming, for example:# ? http://r.ossrs.net/live/livestream.flv# ? http://r.ossrs.net/live/livestream.m3u8location ~ /.+/.*\.(flv|m3u8|ts|aac|mp3)$ {proxy_pass http://127.0.0.1:8080$request_uri;}# For SRS backend API for console.location /api/ {proxy_pass http://127.0.0.1:1985/api/;}# For SRS WebRTC publish/play API.location /rtc/ {proxy_pass http://127.0.0.1:1985/rtc/;}} }總結(jié)
以上是生活随笔為你收集整理的SRS4.0.85流媒体搭建及HTTPS代理的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 毕业设计 单片机智慧农业管理系统 -大棚
- 下一篇: 初级、中级、高级测试/开发程序员的区别在