How to Stream from OBS to Raspberry Pi RTMP Server

Setting up a private streaming pipeline allows you to host your own broadcasts without relying on external platforms like YouTube or Twitch. This article provides a step-by-step guide on how to configure OBS Studio to stream directly to a custom RTMP server hosted on a Raspberry Pi. You will learn how to install and configure the Nginx RTMP module on your Raspberry Pi, find your local network details, configure the broadcast settings in OBS Studio, and test the video feed using a media player.

Step 1: Install and Configure the RTMP Server on Raspberry Pi

To handle the incoming stream, your Raspberry Pi needs an RTMP server. The most efficient way to achieve this is by using Nginx with the RTMP module.

First, update your package lists and install Nginx along with the RTMP module by running the following commands in your Raspberry Pi terminal:

sudo apt update
sudo apt install nginx libnginx-mod-rtmp -y

Once the installation is complete, you must configure Nginx to accept the RTMP stream. Open the Nginx configuration file using a text editor:

sudo nano /etc/nginx/nginx.conf

Scroll to the bottom of the file and append the following configuration block:

rtmp {
    server {
        listen 1935;
        chunk_size 4096;

        application live {
            live on;
            record off;
        }
    }
}

Save and close the file (in Nano, press Ctrl+O, Enter, then Ctrl+X).

Now, restart the Nginx service to apply the changes:

sudo systemctl restart nginx

Step 2: Locate Your Raspberry Pi IP Address

OBS Studio needs the local IP address of your Raspberry Pi to target the RTMP server. To find this address, run the following command in the Raspberry Pi terminal:

hostname -I

Note the primary IP address returned (for example, 192.168.1.150).

Step 3: Configure OBS Studio

With the RTMP server active on your Raspberry Pi, you can now configure OBS Studio to send its video output to it.

  1. Open OBS Studio on your computer.
  2. Click on Settings in the bottom-right control panel.
  3. Select the Stream tab from the left sidebar.
  4. Set the Service dropdown menu to Custom…
  5. In the Server field, enter your RTMP URL using your Raspberry Pi’s IP address and the application name configured in Step 1: rtmp://<YOUR_RASPBERRY_PI_IP>/live (e.g., rtmp://192.168.1.150/live)
  6. In the Stream Key field, enter any custom identifier you prefer (for example, test-stream). You will use this key to identify the specific stream.
  7. Click Apply and then OK.

Step 4: Start and Verify the Stream

You are now ready to begin broadcasting and testing the connection.

  1. In the main OBS Studio window, set up your video sources.
  2. Click Start Streaming in the control panel.
  3. To verify the stream is active, open a media player that supports network streams, such as VLC Media Player, on another device connected to the same network.
  4. In VLC, go to Media > Open Network Stream…
  5. Enter the complete stream URL: rtmp://<YOUR_RASPBERRY_PI_IP>/live/test-stream
  6. Click Play. The player will display your live OBS stream with minimal latency.