使用nginx-rtmp-win32-v0.3实现OBS单设备转发推流实现多平台同时直播

一.准备工具

nginx-rtmp-win32-v0.3:文章底部下载

OBS官网:https://obsproject.com/download

OBS官网下载64位:https://cdn-fastly.obsproject.com/downloads/OBS-Studio-27.2-Full-Installer-x64.exe

OBS官网下载32位:https://cdn-fastly.obsproject.com/downloads/OBS-Studio-27.2-Full-Installer-x86.exe

二.部署环境nginx-rtmp-win32-v0.3

1.解压nginx-rtmp-win32-v0.3得到文件结构,注意文件夹和文件结构不可改名,不可有中文目录。

2.到你需要转发推流的各个平台获取推流码和直播码,若只有两行则拼接即可。

  • 例斗鱼:

rtmp地址:rtmp://sendtc3.douyu.com/live

直播码:4348741rqIHcc6Ek?wsSecret=bff5dc15bd3af0f7bba92a5f28c4291b&wsTime=620b8971&wsSeek=off&wm=0&tw=0&roirecognition=0&record=flv&origin=tct

则推流码是(rtmp地址)+("/")+(直播码):rtmp://sendtc3.douyu.com/live/4348741rqIHcc6Ek?wsSecret=bff5dc15bd3af0f7bba92a5f28c4291b&wsTime=620b8971&wsSeek=off&wm=0&tw=0&roirecognition=0&record=flv&origin=tct

  • 例虎牙:

推流地址:rtmp://tx.direct.huya.com/huyalive/1648954729-1648954729-0-3298032914-10057-A-1641628623-1?seq=1644923237031&type=simple

则推流码是(推流地址):rtmp://tx.direct.huya.com/huyalive/1648954729-1648954729-0-3298032914-10057-A-1641628623-1?seq=1644923237031&type=simple

  • 例哔哩哔哩:

服务器地址:rtmp://live-push.bilivideo.com/live-bvc/

串流秘钥:?streamname=live_2303475_6534930&key=d78d7c1c8518ea3ebe19a9e3cf45d2a6&schedule=rtmp&pflag=1

则推流码是(服务器地址)+(串流秘钥):rtmp://live-push.bilivideo.com/live-bvc/?streamname=live_2303475_6534930&key=d78d7c1c8518ea3ebe19a9e3cf45d2a6&schedule=rtmp&pflag=1

3.设置你的推流码,按照第2步获取到推流码之后,填入到option.txt文件中,一行一条,格式如下("push "+推流码+";")。

push rtmp://sendtc3.douyu.com/live/4348741rqIHcc6Ek?wsSecret=bff5dc15bd3af0f7bba92a5f28c4291b&wsTime=620b8971&wsSeek=off&wm=0&tw=0&roirecognition=0&record=flv&origin=tct;
push rtmp://tx.direct.huya.com/huyalive/1648954729-1648954729-0-3298032914-10057-A-1641628623-1?seq=1644923237031&type=simple;
push rtmp://live-push.bilivideo.com/live-bvc/?streamname=live_2303475_6534930&key=d78d7c1c8518ea3ebe19a9e3cf45d2a6&schedule=rtmp&pflag=1;

4.接下来直接运行【启动 nginx 服务.bat】即可正常启动服务,若要关闭就运行【结束 nginx 服务.bat】。

5.最后一步使用OBS进行推流,推流地址设置为【rtmp://127.0.0.1:6630/live】,点击开始推流,就大功告成啦!

1644922948-nginx-rtmp-win32-v0.3.zip (下载397)
声明:本文为原创,作者为 Svlik,转载时请保留本声明及附带文章链接:https://www.svlik.com/2809.html