Featured image of post OBS Multi-Streaming Struggles: Unnecessary Troubles

OBS Multi-Streaming Struggles: Unnecessary Troubles

Might as well not stream, just play by myself.

Long story short, I recently started live streaming my gameplay. I don’t expect many viewers, Just, Why not? Plus, every streaming platform offers playback. It’s like free storage for every game recording, why not take advantage of it?

To get to the point, as you can see, I recently needed to stream on multiple platforms simultaneously. However, OBS itself clearly doesn’t support multi-streaming, and due to its lack of proxy settings and other well-known reasons, I couldn’t stream to twitch.tv. So, I started looking for solutions.

Defining the Requirements

  • Multi-platform simultaneous streaming
  • Minimal performance impact
  • One stream requires a proxy

Multi-Streaming

There is a ready-to-use plugin for multi-streaming: Github

Download the .exe installer from the Release page. After installation, remember to check “Multi-Output” in the “Dock” menu. By default, a separate window will pop up, and you can take this opportunity to adjust the layout of OBS.

Enable Multi-Stream Panel

The plugin settings are straightforward, just follow the same steps as you would in the original OBS.

Bilibili Live Assistant

Oddly, Bilibili requires streamers with fewer than 50 followers to use their Live Assistant, and other domestic platforms may have similar rules. After enabling third-party streaming mode, the live panel will display the streaming configuration. You don’t need to follow the streaming address provided by the Live Assistant, as it inexplicably gives a changing local IP each time. Simply replace it with 127.0.0.1 or localhost.

Third-Party Streaming Mode in Bilibili Live Assistant Plugin Settings

Streaming to Twitch

Streaming to Twitch involves many unnecessary troubles due to the GFW.

OBS does not support proxy settings. Initially, I planned to use Clash’s TAP mode to force proxy OBS traffic, but Clash’s TAP does not listen to rtmp traffic, so that plan failed. I decided to set up a forwarding server that can communicate with Twitch without being affected by the GFW.

After some research, I found that Caddy does not support the RTMP protocol, while the nginx-rtmp module is specifically designed for RTMP. It seems to be the only choice.

Prerequisites:

  • Familiarity with basic Linux command line operations.
  • A server with docker and docker compose installed.
  • A suitable command line text editor, such as nvim or the default nano in most distros.

Create a directory:

1
mkdir nginx-rtmp && cd nginx-rtmp

Create docker-compose.yml:

1
2
3
4
5
6
7
8
9
services:
    nginx-rtmp:
        image: tiangolo/nginx-rtmp:latest
        container_name: nginx_rtmp
        ports:
          - "1935:1935" # RTMP port
        volumes:
          - ./nginx.conf:/etc/nginx/nginx.conf
        restart: unless-stopped

Create nginx.conf:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
worker_processes  auto;

events {
    worker_connections  1024;
}

rtmp {
    server {
        listen 1935;
        chunk_size 4096;

        application live {
            live on;
            push rtmp://live.twitch.tv/app/{Twitch Main Stream Key};
        }
    }
}

Start the setup:

1
2
docker compose up -d
# For older versions of compose plugin, use docker-compose up 

Don’t forget to open the firewall port. My firewall configuration is based on the article To Fix The Docker and UFW Security Flaw Without Disabling Iptables, and the command to open the port is:

1
ufw route allow proto tcp from any to any port 1935

After configuration, set the streaming target address in OBS to rtmp://server_ip/live, and any stream key will work. Once set, you can start streaming.

Netch

If you don’t have a server, you can also use Netch to proxy the OBS process for streaming.

First, download Netch version 1.9.2, making sure it’s version 1.9.2. Add a process mode, include the OBS folder, and then enable the proxy for that process mode.

Create a Process Mode

Conclusion

To stream simultaneously on Twitch and Bilibili, I encountered many unnecessary troubles. I could blame OBS for not having built-in proxy support, or blame tools like Clash Verge for not supporting RTMP. But ultimately, the blame lies with the GFW. Although the final result is satisfactory, the experience of going through all this trouble just for streaming is far from pleasant. Maybe in the future, I should look into modifying the Mihomo kernel to support RTMP protocol, or develop an independent implementation to forward OBS traffic. Whatever the case, streaming smoothly in this land is a long and arduous journey.

Finally, feel free to follow my Twitch channel: https://www.twitch.tv/powerfullz233

Licensed under CC BY-NC-SA 4.0
Built with Hugo
Theme Stack designed by Jimmy