首先需要下载nginx和nginx rtmp模块
nginx: https://github.com/nginx/nginx
nginx rtmp: https://github.com/arut/nginx-rtmp-module
指定nginx rtmp编译
nignx./configure –add-module=/path/to/nginx-rtmp-module
make
make install
默认nginx目录在/usr/local/nginx下
配置/usr/local/nginx/conf/nginx.conf
#user nobody;
worker_processes 1;
error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid logs/nginx.pid;
events {
worker_connections 1024;1
}
rtmp_auto_push on;
rtmp {
server { listen 1688; application push { live on; #iqiyi push 奇艺推播地址/开播码; #huya push rtmp://ws.upstream.huya虎牙推播地址; } }123456789101112131415161718192021
}
启动nignx后,在OBS中设置推流地址为nginx地址就可以开播了例如 rtmp://127.0.0.1:1688/push
这样就可以一次在多个平台同时直播了!