Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save e04/3914d98d6d0a55c689ab724ac6896081 to your computer and use it in GitHub Desktop.
Save e04/3914d98d6d0a55c689ab724ac6896081 to your computer and use it in GitHub Desktop.
Building a IRL Streaming Setup with go-irl

This article is out of date. Please refer to the following repository

go-irl: A modern SRTLA Streaming Stack


Step-by-Step Setup Guide

Follow these steps to configure the entire pipeline on your PC.

Prerequisites

  • Download the pre-built binaries for go-srtla, srt-live-reporter, and obs-srt-bridge from their respective GitHub releases pages.

  • Have OBS Studio installed.

  • Your PC must be accessible from the internet on the port you choose for go-srtla (e.g., port 5000). This usually requires port forwarding on your router to direct incoming traffic on port 5000 to your PC's local IP address.


Step 1: Run go-srtla

This is the public-facing entry point for your stream.

  1. Open a terminal or command prompt.

  2. Navigate to the directory where you saved the go-srtla binary.

  3. Run the following command:

    ./go-srtla -srtla_port 5000 -srt_hostname 127.0.0.1 -srt_port 5001
    • -srtla_port 5000: go-srtla will listen for incoming SRTLA connections from your mobile device on port 5000.
    • -srt_hostname 127.0.0.1 -srt_port 5001: After aggregating the stream, it will forward it as a standard SRT stream to localhost on port 5001.

Leave this terminal window running.


Step 2: Run srt-live-reporter

This tool receives the stream from go-srtla and prepares it for OBS.

  1. Open a new terminal or command prompt.

  2. Navigate to the directory where you saved the srt-live-reporter binary.

  3. Run the following command:

    ./srt-live-reporter -from "srt://:5001?mode=listener" -to "udp://:5002" -wsport 8888
    • -from "srt://:5001?mode=listener": It will listen for the SRT stream from go-srtla on port 5001.
    • -to "udp://:5002": It will forward the video data to OBS via UDP on port 5002.
    • -wsport 8888: It will start a WebSocket server on port 8888 to provide real-time statistics.

Leave this terminal window running.


Step 3: Run obs-srt-bridge

This tool serves the browser source that integrates with OBS.

  1. Open a third terminal or command prompt.

  2. Navigate to the directory where you saved the obs-srt-bridge binary.

  3. Run the following command:

    ./obs-srt-bridge -port 9999
    • -port 9999: It will start a web server on port 9999. The Browser Source in OBS will connect to this.

Leave this terminal window running.


Step 4: Configure OBS Studio

Now, configure OBS to receive the stream and use the bridge for stats and scene switching.

  1. Create Scenes:

    • Create two scenes in OBS. For this guide, we'll name them ONLINE and OFFLINE. The OFFLINE scene can contain a "Be Right Back" message or an image.
  2. Add the Media Source (Video Feed):

    • Go to the ONLINE scene.
    • Add a new source by clicking the + button in the "Sources" dock and select Media Source.
    • Uncheck the box for "Local File".
    • In the "Input" field, enter udp://127.0.0.1:5002.
    • In the "Input Format" field, enter mpegts.
    • IMPORTANT: Uncheck the box for Restart playback when source becomes active. This prevents the video from stuttering every time obs-srt-bridge switches back to this scene.
    • Click OK.
  3. Add the Browser Source (Stats and Scene Switching):

    • In the ONLINE scene, add a new source by clicking + and selecting Browser.
    • In the "URL" field, enter the following URL. You can customize the parameters as needed.
    http://localhost:9999/app?wsport=8888&onlineSceneName=ONLINE&offlineSceneName=OFFLINE&type=simple
    
    • wsport=8888: Tells the bridge to connect to the WebSocket on port 8888 (from srt-live-reporter).
    • onlineSceneName=ONLINE: The name of your "good connection" scene.
    • offlineSceneName=OFFLINE: The name of your "bad connection" scene.
    • type=simple: The display type for stats (simple, graph, or none).
    • Set the Width and Height as desired.
    • IMPORTANT: For automatic scene switching to work, scroll down in the properties window and set Page permissions to Advanced access to OBS.
    • Click OK.

Step 5: Configure Your Mobile App

Finally, configure your mobile streaming app (e.g., IRL Pro, Moblin).

  1. Set the destination URL to point to your PC's public IP address and the port you configured in go-srtla.

    srtla://<YOUR_PUBLIC_IP_ADDRESS>:5000
    
    • Replace <YOUR_PUBLIC_IP_ADDRESS> with your actual public IP. You can find this by searching "what is my IP" in a browser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment