我使用Nginx作为代理,使用SRS作为Livestream服务器,下面是用于服务器块的Nginx配置:
`server {
listen 80;
listen 443 ssl http2;
server_name example.com;
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.m3u8
location ~ /.+/.*\.(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/;
}
}`对于配置,VLC播放livestream从URL看起来像https://example.com/live/livestream.m3u8很好。
但是从我的use软件中可以发布流,我需要使用Ip而不是域来正常工作,如:rtmp://my_public_ip/live
如果我用url替换,看起来像rtmp://example.com/live => OBS,那就不起作用了!
如何通过我的域从OBS发布流?
我试着使用vhost配置,但它没有起作用。
发布于 2022-04-24 03:27:09
请直接发布到SRS,而不是NGINX,并使用配置OBS:
rtmp://srs_server_ip/livelivestream请注意,永远不要将livestream放在Server配置中,它应该在StreamKey中,这是令人困惑的。
请阅读这里的更多内容
https://stackoverflow.com/questions/71688914
复制相似问题